Strange SDL_mixer problem

I have strange problem with audio playback in SDL_Mixer. I’am running
my program on Ubuntu 9.04 and Fedora 11 with same problem. My program is
developed for nonstop running, but after some time it stops playing
sounds (chunks and music). When I try to play some chunk, number
returned from Mix_Playing(-1) increments but no sound is played and
number returned from Mix_Playing(-1) never decrements. I do not know
where is problem, but if I try to run my program via valgrind this error
appears much faster (normally it takes about 1 day, in valgrind few
minutes). Also Mix_CloseAudio(); take long time if there is error with
This is my start_up function where I init SDL:

int start_up(void){

      return 0;
print_message("SYSTEM: SDL inicializovano.\n");

screen = SDL_SetVideoMode(2560, 960, 0, SDL_FULLSCREEN | 


 if (screen == NULL){
       print_message("ERROR: Problem: %s\n", SDL_GetError());
      return 0;
 print_message("SYSTEM: Video mode nastaven.\n");

 if(Mix_OpenAudio(44100, AUDIO_S16SYS, 2, 1024) < 0){
       print_message("ERROR: Warning: Couldn't set 44100 Hz 16-bit 

audio - Reason: %s\n", SDL_GetError());
Mix_Volume(-1, 128);
print_message(“SYSTEM: Audio nastaveno.\n”);

    // Inicializace SDL_ttf
    if(TTF_Init() == -1){
        print_message("ERROR: Unable to initialize SDL_ttf: %s\n", 

return 0;

   return 1;


My play sound function:

if(Mix_PlayChannel(-1, sound, 0)==-1){
print_game_message(“ERROR: Mix_PlayChannel: %s\n”,Mix_GetError());

Kind regards,

Vojtech Hejduk