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

[CRITICAL] [AudioSDL2 ] Unable to open mixer: b'No such audio device' #6512

Closed
clickworkorange opened this issue Sep 11, 2019 · 5 comments
Closed

Comments

@clickworkorange
Copy link

Versions

  • Python: 3.5.3
  • OS: Raspbian Jessie
  • Kivy: 1.11.1
  • Kivy installation method: Custom build with --disable-video-kmsdrm --disable-video-x11 --disable-video-wayland --disable-pulseaudio --disable-esd Also built and installed SDL2_mixer-2.0.4.

Description

I have a very simple Kivy app on a Pi2B which should play a sound through a USB soundcard, but it crashes on launch with [CRITICAL] [AudioSDL2 ] Unable to open mixer: b'No such audio device'

Code and Logs

from kivy.app import App
from kivy.core.audio import SoundLoader

sound = SoundLoader.load("one.wav"), 
sound.play()

My asound.conf:

pcm.!default {
type plug
slave {
  pcm "hw:1,0"
  }
}

ctl.!default {
type hw
card 1
}

$ aplay -l returns:

**** List of PLAYBACK Hardware Devices ****
card 1: AUDIO [USB  AUDIO], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

What I've tried

I have confirmed that the USB sound card works and is set as system default by executing aplay one.wav as the same user which runs the Kivy app. It also shows up as the only card in alsamixer. I have searched here and the Internet at large but get no results(!) for "AudioSDL2" "Unable to open mixer" "No such audio device", so my only hope is that this is a know issue here.

@matham
Copy link
Member

matham commented Sep 11, 2019

Please post the full error log.

@matham matham added the awaiting-reply Waiting for reply from issue opener, will be closed if no reply label Sep 11, 2019
@clickworkorange
Copy link
Author

clickworkorange commented Sep 11, 2019

Not much in it I'm afraid...

$ python test.py 
[INFO   ] [Logger      ] Record log in /home/station/.kivy/logs/kivy_19-09-11_2.txt
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "/usr/local/lib/python3.5/dist-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516]
[INFO   ] [Python      ] Interpreter at "/usr/bin/python"
[INFO   ] [Factory     ] 184 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO   ] [Audio       ] Providers: audio_sdl2 (audio_ffpyplayer ignored)
[CRITICAL] [AudioSDL2   ] Unable to open mixer: b'No such audio device'
[WARNING] Deprecated property "<AliasProperty name=filename>" of object "<kivy.core.audio.audio_sdl2.SoundSDL2 object at 0x75bb6f80>" was accessed, it will be removed in a future version
[WARNING] [AudioSDL2   ] Unable to load /home/station/one.wav: b"Audio device hasn't been opened"

@no-response no-response bot removed the awaiting-reply Waiting for reply from issue opener, will be closed if no reply label Sep 11, 2019
@matham
Copy link
Member

matham commented Sep 11, 2019

This is an sdl2 error. For some reason sdl2 mixer cannot open the audio output device. I'm guessing you need to enable pulseaudio. Either way though this is not a kivy bug.

@matham matham closed this as completed Sep 11, 2019
@clickworkorange
Copy link
Author

clickworkorange commented Sep 11, 2019

Thank you, and fair enough! I wasn't sure myself so thought I'd start here. The putrid pile of pus that is pulseaudio won't come anywhere near any of my machines though, so I'll need to find a way around that.

@clickworkorange
Copy link
Author

For anyone else ending up here: this was (of course) a PBK - I had built SDL2 (not SDL2_mixer) without having libasound2-dev installed, and I failed to spot the lack of ALSA in the configure output - schoolboy error!

~/Sources/SDL2-2.0.10/build $ ../configure 
...
Audio drivers   : disk dummy oss
...

~/Sources/SDL2-2.0.10/build $ sudo apt-get install libasound2-dev 
...
~/Sources/SDL2-2.0.10/build $ ../configure 
...
Audio drivers   : disk dummy oss alsa(dynamic)
...

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

2 participants