如何解决ubuntu中使用SDL_OpenAudio失败返回错误信息no such audio device
SDL
Simple Directmedia Layer
项目地址:https://gitcode.com/gh_mirrors/sd/SDL

·
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.
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.
转自http://forums.libsdl.org/viewtopic.php?t=7609




Simple Directmedia Layer
最近提交(Master分支:6 个月前 )
e20e27e1 - 4 天前
4c82b584
Fixes https://github.com/libsdl-org/SDL/issues/12472
5 天前
更多推荐
所有评论(0)