Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"unable to open slave" possible hardware errors or warnings prevent running of project / simple_test.py #121

Open
Dainah-0xdeadc0de opened this issue Sep 30, 2024 · 4 comments

Comments

@Dainah-0xdeadc0de
Copy link

Should note I'm on AMD hardware.
Not sure if the project is talking to my hardware correctly.

I get this at the beginning of running simple test.

ALSA lib pcm_dsnoop.c:567:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:404:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:404:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c:1036:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:481:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:481:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

Which leads to the following


/run/media/dainah/Data/GITHUB/RealtimeSTT-0.2.42/venv/lib/python3.12/site-packages/torch/hub.py:293: UserWarning: You are about to download and run code from an untrusted repository. In a future release, this won't be allowed. To add the repository to your trusted list, change the command to {calling_fn}(..., trust_repo=False) and a command prompt will appear asking for an explicit confirmation of trust, or load(..., trust_repo=True), which will assume that the prompt is to be answered with 'yes'. You can also use load(..., trust_repo='check') which will only prompt for confirmation if the repo is not already trusted. This will eventually be the default behaviour
  warnings.warn(
[2024-09-30 09:23:44.679] [ctranslate2] [thread 35881] [warning] The compute type inferred from the saved model is float16, but the target device or backend do not support efficient float16 computation. The model weights have been automatically converted to use the float32 compute type instead.
Downloading: "https://github.com/snakers4/silero-vad/zipball/master" to /home/dainah/.cache/torch/hub/master.zip
RealTimeSTT: root - WARNING - Audio queue size exceeds latency limit. Current size: 22. Discarding old audio chunks.
Traceback (most recent call last):
  File "/run/media/dainah/Data/GITHUB/RealtimeSTT-0.2.42/tests/simple_test.py", line 8, in <module>
    print(recorder.text(), end=" ", flush=True)
          ^^^^^^^^^^^^^^^
  File "/run/media/dainah/Data/GITHUB/RealtimeSTT-0.2.42/RealtimeSTT/audio_recorder.py", line 1177, in text
    self.wait_audio()
  File "/run/media/dainah/Data/GITHUB/RealtimeSTT-0.2.42/RealtimeSTT/audio_recorder.py", line 1035, in wait_audio
    if self.start_recording_event.wait(timeout=0.02):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/threading.py", line 655, in wait
    signaled = self._cond.wait(timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/threading.py", line 359, in wait
    gotit = waiter.acquire(True, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt
@realyukii
Copy link

is this issue the same as #11 ?

@KoljaB
Copy link
Owner

KoljaB commented Dec 5, 2024

RealtimeSTT depends on the faster-whisper library, which in turn uses CTranslate2. It's creator Guillaume Klein says here that AMD is not officially supported in CTranslate2. Here is an issue from faster-whisper repo that says it might be possible to enable these backends by compiling CTranslate2 from the source with the desired backend before installing faster-whisper.

So - if I got this right - this would mean for MPS acceleration you would first compile CTranslate2 with the necessary backend support (MPS enabled). Then proceed with the installation of RealtimeSTT - which installs faster-whisper, but this should not override the manually compiled version of CTranslate2.

I'd also check if portaudio is installed (apt-get install -y portaudio19-dev). Also on some systems the input device does not get detected correctly and has to be set manually using input_device_index parameter. This script lists all devices and can help with finding the correct input device for recording.

@Dainah-0xdeadc0de
Copy link
Author

So this is probably some weird interaction with my OS environment being Linux. I'll have to investigate a fix more.
I got the project TECHNICALLY working on latest 0.3.92 release / main branch. I still get all the ALSA errors, unknown card, etc etc.
What I did was pipe some video talking audio through qpwgraph into the python listening port, and it works.

So I mainly have to figure out why it doesn't like my mic, or why it's not defaulting to some detected hardware, idk....
I'll play around with it more.

Say something...
Detected text: You couldn't even kill Sergeant Suds dude. It's over, too.
Detected text: Oh, now we get a gumball machine, well.
Detected text: You know, I do be loving my gumballs.
Detected text: But I think it's good scaling skill just to get silver badge. Yeah, yeah.

@Dainah-0xdeadc0de
Copy link
Author

OK, so maybe I found a fix?
Through your environment, install ffmpeg-python 0.2.0, that resolved it for me for now.
I still get all the error popups but detection works.

ALSA lib pcm_dsnoop.c:567:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:404:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:404:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c:1036:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:481:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:481:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
[2024-12-16 21:44:25.693] [ctranslate2] [thread 57071] [warning] The compute type inferred from the saved model is float16, but the target device or backend do not support efficient float16 computation. The model weights have been automatically converted to use the float32 compute type instead.
Say something...
Detected text: Nope, still just wait for it. Come on.
Detected text: Oh wait, there it goes.
Detected text: Nice.
RealtimeSTT shutting down
Exiting application due to keyboard interrupt

Process finished with exit code 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants