Couldn't open audio device: No available audio device |
Couldn't open audio device: No available audio device |
Ryan C. Gordon
Guest
|
If you built your own SDL, you probably didn't have development headers for PulseAudio (or ALSA), so it's trying to use /dev/dsp, which doesn't exist on many modern Linux systems (hence, SDL_Init(SDL_INIT_AUDIO) succeeds, but no devices are found when you try to open one). "apt-get install libasound2-dev libpulse-dev" and rebuild SDL...let the configure script find the new headers so it includes PulseAudio and ALSA support. If you didn't build your own SDL, maybe you can force it to use a different audio path: SDL_AUDIODRIVER=pulse ./mytestprogram or SDL_AUDIODRIVER=alsa ./mytestprogram One of those two solutions will (probably) fix your problem. --ryan. _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
Re: Couldn't open audio device: No available audio device |
NiGHTS
|
I tried your first suggestion of running apt-get for those libraries, then downloading the latest SDL source code and recompiling the library. It now works perfectly!
In a related question, when running this program outside of my development environment on another computer, what Ubuntu packages should I install to ensure that it plays sound correctly? And finally, what the heck is asla or pulseaudio? No one really explains how it relates to SDL and what's its for and how its used. |
|||||||||||
|
Couldn't open audio device: No available audio device |
Patrick Baggett
Guest
|
On Thu, Oct 6, 2011 at 2:36 PM, NiGHTS wrote:
PulseAudio: A sound "server". Both of these are well explained in so many other sources it isn't really worth trying to give a poor explanation. SDL uses different "backends" to support Linux sound. As you'll find out, Linux has a very fragmented and somewhat incompatible series of sound APIs. It is hit or miss whether a certain API is available/useful on a given Linux system. To counteract that, SDL can try different APIs to see which one works. In the end, you see the clean SDL API and don't have to deal with writing backends to support every sound API under the sun.
|
|||||||||||||||
|