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

bug: Failed to initialized SDL: dsp: No such audio device with March 15th 2024 Raspberry Pi OS #88

Closed
AIWintermuteAI opened this issue May 28, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@AIWintermuteAI
Copy link
Owner

Describe the bug

Running on Raspberry Pi 4 with reSpeaker

whisper_init_state: kv cross size =    8.79 MB
ERROR: Failed to initialized SDL: dsp: No such audio device
Traceback (most recent call last):
  File "/home/pi/whispercpp/examples/stream/stream.py", line 30, in main
    transcription = self.transcriber.stream_transcribe(callback=self.store_transcript_handler, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/venvs/whisper/lib/python3.11/site-packages/whispercpp/__init__.py", line 257, in stream_transcribe
    raise RuntimeError("Failed to initialize audio capture device.")
RuntimeError: Failed to initialize audio capture device.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/whispercpp/examples/stream/stream.py", line 100, in <module>
    transcriber.main(**vars(args))
  File "/home/pi/whispercpp/examples/stream/stream.py", line 32, in main
    assert transcription is not None, "Something went wrong!"
           ^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Something went wrong!

To reproduce

No response

Expected behavior

No response

Environment

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 6.6.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linux

@AIWintermuteAI AIWintermuteAI added the bug Something isn't working label May 28, 2024
@AIWintermuteAI AIWintermuteAI self-assigned this May 28, 2024
@AIWintermuteAI
Copy link
Owner Author

Possible workaround - use older Raspberry Pi OS image,
https://downloads.raspberrypi.org/raspios_lite_arm64/images/
raspios_lite_arm64-2023-10-10
which was used originally.

I'm traveling in June, will be back to fixing it the beginning of July.

@MrDavid949
Copy link

Great video on YT :) I'm also seeing the same issue described above, kernel version 6.6.31+rpt-rpi-v8

@CameronMccutcheon02
Copy link

Having a similar issue with the list_audio_devices argument.

Not using a reSpeaker, instead using a USB webcam I had lying around which has an audio channel. Should return something on list_audio_devices but returns the same: ERROR: Failed to initialized SDL: dsp: No such audio device

Kernel Version: 6.6.20+rpt-rpi-v8
Python venv: Python 3.11.2

@AIWintermuteAI
Copy link
Owner Author

I've been fixing the CI issues and it's green again cc9d098
I'll work on SDK issue now

@lintweaker
Copy link

lintweaker commented Jul 17, 2024

I've been fixing the CI issues and it's green again cc9d098 I'll work on SDK issue now

Nice! I just hit this bug yesterday, hopefully you'll manage to resolve the issue soon. Looking forward to trying the stream option

@AIWintermuteAI
Copy link
Owner Author

AIWintermuteAI commented Jul 18, 2024

Okay, I got one step closer to solving it.
Looks like the issue with certain library not being installed during the wheel build (f#@#ing bazel with its f#@#ing "hermetic" builds, hermetic my a#@).

From the latest Raspberry Pi OS (Linux raspberrypi 6.6.31+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux)

  1. Clean the build cache
./tools/bazel clean --expunge
  1. Install the libs
sudo apt-get install libsdl2-mixer-2.0-0
sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
  1. Rebuild the whisper and reinstall it
./tools/bazel build //:whispercpp_wheel
pip install --force-reinstall $(./tools/bazel info bazel-bin)/*.whl

I'll do a clean build to see which one did the trick (likely libsdl2-mixer-2.0-0) and then update the README.

@AIWintermuteAI
Copy link
Owner Author

sudo apt-get install libasound2-dev

Only this command is necessary. You MUST rebuild and reinstall the bindings after.

@AIWintermuteAI
Copy link
Owner Author

Closed with d549400

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants