<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>ALLEGRO 5 - invinite loop an end in _al_win_input_exit</title>
		<link>http://www.allegro.cc/forums/view/599421</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 14 Mar 2009 01:36:54 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi,</p><p>when I quit my program, the app hangs in _al_win_input_exit-function at WaitForSingleObject(ack_event, INFINITE). Found some old stuff in this forum here, but don&#39;t know whether the solution is still the same...<br />So what could be my mistake.... forget to free memory ?</p><p>I use MSVC 2005 and only the sound stuff from allegro 4.9.8 .</p><p>Hope there&#39;s help ;-)</p><p>Cheers, I
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HansiSchmidt)</author>
		<pubDate>Mon, 02 Mar 2009 23:19:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Can you provide a simple program that illustrates this behavior?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Mon, 02 Mar 2009 23:38:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Maybe allegro.log has some useful info?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Milan Mimica)</author>
		<pubDate>Mon, 02 Mar 2009 23:54:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>&gt;&gt; Can you provide a simple program that illustrates this behavior? </p><p>I have no simple program. This sound stuff is part of our C#-App. We use allegro in a c++ - SoundManager-dll. That is wrapped in a SoundManagerWrapper-Dll ( managed, assemply ) and this we use in a C#-app... no way to provide usefull source code... what a pity..</p><p>The log says:</p><p>// LOG START</p><p>ALLEGRO_SYSTEM_INTERFACE created.<br />al-winput INFO: Input thread started.<br />Render-to-texture: 1<br />ALSA not available on this platform (error code: 1)<br />sample matrix:<br /> 1.000000 0.000000<br /> 0.000000 1.000000</p><p>// LOG END</p><p>Funny, because I take the autodetect to install the audio <br />&gt; al_install_audio(ALLEGRO_AUDIO_DRIVER_AUTODETECT) , so no need to say NO ALSA ..
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HansiSchmidt)</author>
		<pubDate>Tue, 03 Mar 2009 15:15:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You may not have one, but we&#39;re going to need one. Its a common request. We need the simplest example possible that shows the issues you are having, otherwise we can&#39;t know who&#39;s problem it is.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 03 Mar 2009 15:30:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What a pity.... but there&#39;s no program actually, because I only make init, create global voice and global mixer and create a stream:</p><p>// *****************************************<br />// INIT<br />// *****************************************</p><p>if ( !al_init() ) <br />{<br />   LOG_ERROR(&quot;Could not init allegro !&quot;);<br />   return ;<br />}	</p><p>// init sound stuff<br />if ( al_install_audio(ALLEGRO_AUDIO_DRIVER_AUTODETECT) ) <br />{<br />	LOG_ERROR(&quot;Could not init sound !&quot;);<br />	return ;<br />}	</p><p>// CREATE VOICE<br />m_GlobalVoice = al_create_voice( 44100,				                     ALLEGRO_AUDIO_DEPTH_INT16,		                       		                             _al_count_to_channel_conf(2) );</p><p>m_GlobalMixer = al_create_mixer( 44100,<br />		                             ALLEGRO_AUDIO_DEPTH_FLOAT32,		                       		                             _al_count_to_channel_conf(2) );</p><p>// attach mixer to voice<br />if ( al_attach_mixer_to_voice(m_GlobalVoice,m_GlobalMixer) != 0)<br />     LOG_ERROR(&quot;Error, can&#39;t attach voice to mixer !!&quot;);	</p><p>// *****************************************<br />// Create Stream and attaching to GlobalMixer<br />// *****************************************</p><p>m_pStream = al_create_stream( buffer_count,			                          m_pSoundResource-&gt;GetSampleCount(),									  m_pSoundResource-&gt;GetFrequency(),									  _al_word_size_to_depth_conf(word_size),									  _al_count_to_channel_conf(channels) );</p><p>al_attach_stream_to_mixer(m_GlobalMixer, m_pStream)</p><p>That&#39;s all for the source code. There&#39;re no other filling/playing stuff. <br />A bit tricky is to use allegro in a managed wrapper dll, because net doesn&#39;t support tls. Initially we use to use allegro 4 as static lib in our soundmanager.dll, but this went wrong with this version. So now we use dlls and had to redefine this Mingw define in tls.c from</p><p>#if defined ALLEGRO_MINGW32 &amp;&amp; ( \<br />   <u>_GNUC</u>_ &lt; 4 || (__GNUC__ == 4 &amp;&amp; <u>_GNUC_MINOR</u>_ &lt; 2) || \<br />   (__GNUC__ == 4 &amp;&amp; <u>_GNUC_MINOR == 2 &amp;&amp; <u>_GNUC_PATCHLEVEL</u></u> &lt; 1))</p><p>to</p><p>#if defined OUR_NO_NATIVE_TLS || (ALLEGRO_MINGW32 &amp;&amp; ( \<br />	__GNUC__ &lt; 4 || (__GNUC__ == 4 &amp;&amp; <u>_GNUC_MINOR</u>_ &lt; 2) || \<br />	(__GNUC__ == 4 &amp;&amp; <u>_GNUC_MINOR == 2 &amp;&amp; <u>_GNUC_PATCHLEVEL</u></u> &lt; 1)) )</p><p>So the tls is supported in our dll.But don&#39;t know the side effects of this hack...</p><p>Yes, that&#39;s the keys.... and maybe you can help me ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HansiSchmidt)</author>
		<pubDate>Tue, 03 Mar 2009 16:03:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So make a program from that code, and see if you have the same problem.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 03 Mar 2009 16:58:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You mean I should create another program with the same code to check its behavior ?</p><p>hmmm....... any other ideas ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HansiSchmidt)</author>
		<pubDate>Tue, 03 Mar 2009 20:46:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You should create a simple Allegro based program using ONLY the allegro code you&#39;ve been using, and a little extra code to test that code.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 03 Mar 2009 20:55:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
That is wrapped in a SoundManagerWrapper-Dll ( managed, assemply ) and this we use in a C#-app... no way to provide usefull source code... what a pity..
</p></div></div><p>
That means the bug could be in any of those other pieces of code as well. It&#39;s impossible for us to diagnose what the problem is if we can&#39;t reproduce it ourselves.<br />We&#39;re not psychic. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Funny, because I take the autodetect to install the audio<br />&gt; al_install_audio(ALLEGRO_AUDIO_DRIVER_AUTODETECT) , so no need to say NO ALSA ..
</p></div></div><p>
It <i>is</i> a bit weird that it&#39;s looking for ALSA on Windows, but it shouldn&#39;t matter. All that&#39;s saying is that it failed to use ALSA for sound, which is fine.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
You mean I should create another program with the same code to check its behavior ?</p><p>hmmm....... any other ideas ?
</p></div></div><p>
Look. You want us to help you find the problem, right? Who knows, maybe it&#39;s a bug in Allegro we need to fix. But you have to help us do that by giving us code that we can run and that misbehaves for you. It&#39;s not that we do not want to help you otherwise, we just can&#39;t.</p><p>That said, do any of Allegro&#39;s examples show the same problem?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Tue, 03 Mar 2009 20:57:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I can see the problem for you... no usefull code - no help...<br />So maybe I have to create a small app that uses my soundmanager.dll...</p><p>&gt;&gt; That said, do any of Allegro&#39;s examples show the same problem? </p><p>These examples are win apps in c++ with no .NET-connection... <br />All of these examples are easy but many things were did automatically, e.g. using standard-Stream feeders, creating stream from file (al_stream_from_file) and so on.... I&#39;m not able to do it in this way, I have to use this stuff more deeper with using e.g. al_load_stream_wav.... there&#39;s to much auto in the samples.... but you have absolutely right.... without nice source code, nobody can help me accurately...</p><p>I have to consider my stuff and my questions for help... <br />Thanks till now...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HansiSchmidt)</author>
		<pubDate>Tue, 03 Mar 2009 21:52:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
So maybe I have to create a small app that uses my soundmanager.dll...
</p></div></div><p>Better would be just to take the code in that dll that uses allegro, and put it in a simple test program.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 03 Mar 2009 22:26:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok, now I use my allegro stuff in a non .NET-App and my program doesn&#39;t want to quit as well in this _al_win_input_exit. For what is </p><p>WaitForSingleObject(ack_event, INFINITE);</p><p>waiting ?</p><p>And if nobody knows for what allegro is waiting for eternity, how can I debug this event stuff ? Is there an array or where can I find a reason to wait ?</p><p>I don&#39;t want to change allegro.... but finally I have to ... perhaps. <br />INFINITE -&gt; 100 (ms)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HansiSchmidt)</author>
		<pubDate>Tue, 10 Mar 2009 19:42:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Do the example which come with Allegro work?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Wed, 11 Mar 2009 00:06:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I noticed that too. Happens sometimes and a switch in/out of debugger makes it continue. I didn&#39;t look into it yet, but I will.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Milan Mimica)</author>
		<pubDate>Wed, 11 Mar 2009 02:17:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>&gt;&gt; Do the example which come with Allegro work? </p><p>Yes, they do...correctly </p><p>_al_win_input_init</p><p>and</p><p>_al_win_input_exit </p><p>without waiting at</p><p>WaitForSingleObject(ack_event, INFINITE);</p><p>Seems, that all the fancy / magic events are comming at the end and no one has to wait for something that nobody seems to know exactly :-(</p><p>&gt;&gt; Happens sometimes and a switch in/out of debugger makes it continue.</p><p>Do you mean that this is not happen if I compile in RELEASE or if I don&#39;t debug <br />with MSVC-IDE ?</p><p>Update:<br />Ok, I&#39;m brassed off... my INFINITY takes 500ms now... and everything is fine...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HansiSchmidt)</author>
		<pubDate>Wed, 11 Mar 2009 13:45:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I just happens sometimes, it&#39;s one of those bugs. You can&#39;t make a diagnosis just by looking at the symptoms.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Milan Mimica)</author>
		<pubDate>Wed, 11 Mar 2009 23:47:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>&gt; You can&#39;t make a diagnosis just by looking at the symptoms. </p><p>In principle - YES. But my question was, what is allegro at this point waiting for. Guess that this can&#39;t be all events in our universe, but some ending streaming stuff, special shut-down-allegro stuff and so on...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HansiSchmidt)</author>
		<pubDate>Thu, 12 Mar 2009 14:07:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The function is described here: <a href="http://msdn.microsoft.com/en-us/library/ms687032.aspx">http://msdn.microsoft.com/en-us/library/ms687032.aspx</a></p><p>So basically, it waits for the event in the first parameter. For some reason, this event does not occur sometimes. To fix the problem, someone (who has Windows, so not me) has to figure out why this event does not occur.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Thu, 12 Mar 2009 23:23:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It waits for input evens, it&#39;s perfectly clear what it does and how it should work, to me at least.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Milan Mimica)</author>
		<pubDate>Fri, 13 Mar 2009 01:18:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>&gt;&gt; It waits for input evens, <br />&gt;&gt; it&#39;s perfectly clear what it does and how it should work, to me at least. </p><p>Ok, seems, that nobody understands, that I&#39;m looking for the specific / the missing input event. I do know, what &quot;WaitForSingleObject&quot; does...</p><p>But that&#39;s the coolness of Open Source stuff.... if you don&#39;t know what there&#39;s going on -&gt; change it !!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HansiSchmidt)</author>
		<pubDate>Fri, 13 Mar 2009 13:38:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
But that&#39;s the coolness of Open Source stuff.... if you don&#39;t know what there&#39;s going on -&gt; change it !!
</p></div></div><p>

<img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" /> <br />Not knowing what&#39;s going on was never a reason to change anything but your own knowledge. Not the code you don&#39;t understand.</p><p>Can&#39;t help you on this event stuff though. Because I don&#39;t know what it&#39;s about.<br />Just thought that the above statement was kind of irritating.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (count)</author>
		<pubDate>Fri, 13 Mar 2009 14:48:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Actually, the WaitForSingleObject() you are referring to waits for the input thread to acknowledge that it ended, after it has been instructed to end with an <a href="http://msdn.microsoft.com/en-us/library/ms684954(VS.85).aspx">APC</a>. Looking at your logfile, the input thread didn&#39;t process the APC for some reason.<br />I can&#39;t reproduce this any more. The problem might be solved already in SVN, with the latest memory corruption fix in the input code.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Milan Mimica)</author>
		<pubDate>Fri, 13 Mar 2009 23:21:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I can&#39;t reproduce this any more. The problem might be solved already in SVN, with the latest memory corruption fix in the input code.
</p></div></div><p>You know what, that would make sense. A bug like that (that shouldn&#39;t be possible) could easily be caused by memory corruption.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sat, 14 Mar 2009 01:36:54 +0000</pubDate>
	</item>
</rss>
