<div dir="ltr">A TCP/IP style select() type function might be useful - add a set of queries to a set and then either poll for changes or wait on them.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 2 April 2014 12:23, Chris Robinson <span dir="ltr"><<a href="mailto:chris.kcat@gmail.com" target="_blank">chris.kcat@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 03/30/2014 03:15 PM, Austin Hicks wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'd settle for a good way to be notified of when buffers finish and when<br>
sources state change-whether or not I'm implementing this myself.  Does<br>
anyone have any design info for this kind of thing?<br>
</blockquote>
<br>
There really shouldn't be much of an issue with using a background thread that checks every 10ms or so. You probably won't get much better than that anyway due to OS scheduling (and OpenAL Soft itself updates every 21~23ms by default).<br>

<br>
With Alure, I basically do just what was suggested. Start up a background thread, which periodically wakes up and checks if sources have changed state, and checks if any streaming sources have processed buffers, and calls the appropriate callbacks.<br>

<br>
If that's still a problem, see below.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I saw the previous thread about realtime audio and blocking callbacks,<br>
and understand why that could be a problem; nevertheless, the case for<br>
having OpenALSoft allow it is simple: condition variables, or other<br>
cross-thread data structures can be used for notification to something<br>
else on another thread.  Is generic callbacks as big a problem to do<br>
outside OpenALSoft as I think it is?  I've not yet managed to come up<br>
with a good solution, but I may just not be seeing it.<br>
</blockquote>
<br>
There's other issues besides real-time blocking. Language bindings, for instance, can have varying amounts of difficulty calling into a native function from C. Threading can also be an issue since there's no guarantee the app and OpenAL Soft would be using the same thread methods, which can cause problems if the app expects some thread data to be there in the callback that was never set up by the thread creation methods.<br>

<br>
Something I can do, though, is add a new synchronization object. Something that could let you check and/or wait for various conditions on a source; a state change, a change in the number of processed buffers, a property change taking effect, etc. That way you can simply make your thread sleep until something happens that you're interested in, then you get woken up and can deal with it as you want.<br>

______________________________<u></u>_________________<br>
openal mailing list<br>
<a href="mailto:openal@openal.org" target="_blank">openal@openal.org</a><br>
<a href="http://openal.org/mailman/listinfo/openal" target="_blank">http://openal.org/mailman/<u></u>listinfo/openal</a><br>
</blockquote></div><br></div>