[SDL] Mix_OpenAudio: No available audio device

Pedro Izecksohn izecksohn at yahoo.com
Sun Jan 16 13:04:03 PST 2005

   The code:

#include <stdlib.h>
#include "SDL.h"
#include "SDL_mixer.h"

int main (int argc, char ** argv) {

if(SDL_Init(SDL_INIT_AUDIO)==-1) {
    fprintf(stderr, "SDL_Init: %s\n", SDL_GetError());

if(Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 1024) == -1) {
  fprintf(stderr, "Mix_OpenAudio: %s\n", Mix_GetError());

return 0;

produces sometimes "Mix_OpenAudio: No available audio device" and othertimes 
"open /dev/sequencer: Permission denied". What should I do?

I use Linux 2.6.7-klg, KDE with artsd. KDE sounds work fine, and also Kaffeine 
works fine. "la /dev/sequencer" prints "crw-rw----  1 root audio 14, 1 
2004-04-24 13:08 /dev/sequencer".

More information about the SDL mailing list