[a5] audio freezes on closing

I'm trying to add sound to my little app. Initialization part works fine. But when I get to closing part, I get jammed sound. And from this state I can only kill app. This happens only some times and it’s really annoying :).

Here's sound init part (al_install_audio and al_init_acodec_addon was called previously):

    voice = al_create_voice(freq, ALLEGRO_AUDIO_DEPTH_INT16, ALLEGRO_CHANNEL_CONF_2);
    mixer = al_create_mixer(freq, ALLEGRO_AUDIO_DEPTH_INT16, ALLEGRO_CHANNEL_CONF_2);
    al_attach_mixer_to_voice(mixer, voice);

    if (!al_reserve_samples(16))
        NOTICE("audio", "al_reserve_samples :(");

I’ve tried to use only al_reserve_samples(), and it’s working the same, except it freeze almost every time on closing :(.

I’ve tried to stop/destroy all samples and streams before closing app, that didn’t help either.

And I also tried to call al_uninstall_audio, and it freezes on it.

So is there some real absolutely correct way to close sound system?

Using MinGW builds from this site.


Does ex_stream work?


If you mean ex_stream_file and ex_stream_seek from "examples" directory than I don't know. I've got compiled library only.

I've tried to remove all code that plays streaming data. It works the same.

It not freezes only if al_reserve_samples not been called. Don't get any sound, thought.


Ah, yes, ex_stream_file I meant. Can you compile and run it? I'd just like to have a complete source file where someone can try and re-produce the problem and using one of the existing examples always is best as everyone already has them.



Here's minimal version of sound freezing app. It's not freezing every time, sometimes I thought that bug is gone.

But if you comment out all mixer/voice code it's starting to freeze every time ???.

Thread #606696. Printed from Allegro.cc