question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AUDIO SDL2 unable to open mixer while trying to load a sound

See original GitHub issue

Versions

  • Python: 3.6.8
  • OS: Ubuntu 18.04.3 LTS
  • Kivy installation method:
python3 -m pip install kivy
python -m pip install ffpyplayer

Description

I get a audio device error while trying to load a sound on python through kivy audio. I’ve wrote the code in Windows and it runs perfectly, but now i’m trying to run it on an ubuntu machine and it give me this error.

Code and Logs

from kivy.core.audio import SoundLoader
bell = SoundLoader.load('audios/bell.wav')
[INFO   ] [Logger      ] Record log in /home/artotim/.kivy/logs/kivy_19-09-25_10.txt
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "/home/artotim/.local/lib/python3.6/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.6.8 (default, Aug 20 2019, 17:12:48) 
[GCC 8.3.0]
[INFO   ] [Python      ] Interpreter at "/usr/bin/python3"
[INFO   ] [Factory     ] 184 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
[INFO   ] [GL          ] OpenGL version <b'3.1 Mesa 19.0.8'>
[INFO   ] [GL          ] OpenGL vendor <b'VMware, Inc.'>
[INFO   ] [GL          ] OpenGL renderer <b'llvmpipe (LLVM 8.0, 256 bits)'>
[INFO   ] [GL          ] OpenGL parsed version: 3, 1
[INFO   ] [GL          ] Shading version <b'1.40'>
[INFO   ] [GL          ] Texture max size <8192>
[INFO   ] [GL          ] Texture max units <32>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Audio       ] Providers: audio_sdl2 (audio_ffpyplayer ignored)
[INFO   ] [GL          ] NPOT texture support is available
xclip version 0.12
Copyright (C) 2001-2008 Kim Saunders et al.
Distributed under the terms of the GNU GPL
[INFO   ] [Clipboard   ] Provider: xclip
[INFO   ] [CutBuffer   ] cut buffer support enabled
[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 0x7faa1eb3ead8>" was accessed, it will be removed in a future version
[WARNING] [AudioSDL2   ] Unable to load /home/artotim/Desktop/fighterapp/audios/bell.wav: b"Audio device hasn't been opened"

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:20 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
johnlawrenceaspdencommented, Feb 6, 2020

I solved this on debian by installing all the kivy dependencies:

sudo apt-get install python-pip build-essential git python python-dev ffmpeg libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev zlib1g-dev

And then uninstalling kivy

pip uninstall kivy

And reinstalling it, telling pip not to use precompiled wheels:

pip install --no-binary kivy kivy

1reaction
vince06frcommented, Dec 18, 2020

I solved this on debian by installing all the kivy dependencies:

sudo apt-get install python-pip build-essential git python python-dev ffmpeg libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev zlib1g-dev

And then uninstalling kivy

pip uninstall kivy

And reinstalling it, telling pip not to use precompiled wheels:

pip install --no-binary kivy kivy

Thank you for the trick, it save my day on ubuntu 20.04 with python3.8, kivy 2.0.0 and ffpyplayer 4.3.2

Read more comments on GitHub >

github_iconTop Results From Across the Web

No sound when using SDL_mixer - c++ - Stack Overflow
I'm using Windows 8.1 64 bit with VC 2013. Code: SDL_Init(SDL_INIT_EVERYTHING); // Create window Mix_Init(MIX_INIT_MP3 | MIX_INIT_OGG | MIX_ ...
Read more >
Unable to init SDL mixer: ALSA: Couldn't open audio device ...
I am on Fedora 25 which is using PulseAudio. As far as I can gather from this error, it's that something is attempting...
Read more >
Simple SDL Audio API tutorial (Not using SDL Mixer) - YouTube
▻Lesson Description: In this lesson I demonstrate how to use the Sound API in SDL. You will hear the playback of a 'collision'...
Read more >
Issues with audio player : r/kivy - Reddit
When I attempt to run the following code on a debian system: def ... [CRITICAL] [AudioSDL2 ] Unable to open mixer: b'No such...
Read more >
SDL_mixer/Mix_OpenAudio - SDL Wiki
If you aren't particularly concerned with the specifics of the audio device, and your data isn't in a specific format, the values you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found