<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>[a5] audio freezes on closing</title>
		<link>http://www.allegro.cc/forums/view/606696</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 14 Mar 2011 20:09:51 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;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 <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />.</p><p>Here&#39;s sound init part (al_install_audio and al_init_acodec_addon was called previously):
</p><div class="source-code snippet"><div class="inner"><pre>    voice <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_voice"><span class="a">al_create_voice</span></a><span class="k2">(</span>freq, ALLEGRO_AUDIO_DEPTH_INT16, ALLEGRO_CHANNEL_CONF_2<span class="k2">)</span><span class="k2">;</span>
    mixer <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_mixer"><span class="a">al_create_mixer</span></a><span class="k2">(</span>freq, ALLEGRO_AUDIO_DEPTH_INT16, ALLEGRO_CHANNEL_CONF_2<span class="k2">)</span><span class="k2">;</span>
    
    <a href="http://www.allegro.cc/manual/al_attach_mixer_to_voice"><span class="a">al_attach_mixer_to_voice</span></a><span class="k2">(</span>mixer, voice<span class="k2">)</span><span class="k2">;</span>
    <a href="http://www.allegro.cc/manual/al_set_default_mixer"><span class="a">al_set_default_mixer</span></a><span class="k2">(</span>mixer<span class="k2">)</span><span class="k2">;</span>

    <span class="k1">if</span> <span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/al_reserve_samples"><span class="a">al_reserve_samples</span></a><span class="k2">(</span><span class="n">16</span><span class="k2">)</span><span class="k2">)</span>
        NOTICE<span class="k2">(</span><span class="s">"audio"</span>, <span class="s">"al_reserve_samples :("</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

I’ve tried to use only al_reserve_samples(), and it’s working the same, except it freeze almost every time on closing <img src="http://www.allegro.cc/forums/smileys/sad.gif" alt=":(" />.</p><p>I’ve tried to stop/destroy all samples and streams before closing app, that didn’t help either.</p><p>And I also tried to call al_uninstall_audio, and it freezes on it.</p><p>So is there some real absolutely correct way to close sound system?</p><p>Using MinGW builds from this site.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SuperEndeg)</author>
		<pubDate>Mon, 14 Mar 2011 14:02:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Does ex_stream work?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Mon, 14 Mar 2011 15:28:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><b>Elias</b><br />If you mean ex_stream_file and ex_stream_seek from &quot;examples&quot; directory than I don&#39;t know. I&#39;ve got compiled library only.</p><p>I&#39;ve tried to remove all code that plays streaming data. It works the same.</p><p>It not freezes only if al_reserve_samples not been called. Don&#39;t get any sound, thought.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SuperEndeg)</author>
		<pubDate>Mon, 14 Mar 2011 16:11:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ah, yes, ex_stream_file I meant. Can you compile and run it? I&#39;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.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Mon, 14 Mar 2011 17:03:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><a href="http://dl.dropbox.com/u/1899593/allegro/al_sound_test.c">http://dl.dropbox.com/u/1899593/allegro/al_sound_test.c</a><br /><a href="http://dl.dropbox.com/u/1899593/allegro/al_sound_test_bin.zip">http://dl.dropbox.com/u/1899593/allegro/al_sound_test_bin.zip</a></p><p>Here&#39;s minimal version of sound freezing app. It&#39;s not freezing every time, sometimes I thought that bug is gone.</p><p>But if you comment out all mixer/voice code it&#39;s starting to freeze every time <img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" />.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SuperEndeg)</author>
		<pubDate>Mon, 14 Mar 2011 20:09:51 +0000</pubDate>
	</item>
</rss>
