<br><br><div class="gmail_quote">On Wed, Feb 3, 2010 at 6:40 PM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On 03.02.2010, at 18:01, Eliot Miranda wrote:<br>
&gt; Our sound processing depends on a high-prirority thread running for a short time every 20 milliseconds to push data through the sound processing paths (microphone recording, OpenAL for spatialization, and so on).  On linux this approach is not immediately applicable<br>

<br>
</div>Scheduling in Linux sucked for a long time, only optimized for server work. Depending on the kernel your users have running it may still be totally unsuitable for anything multimedia. There was a big hubbub about that on LKML where the leading developers did not even acknowledge there was a problem with the scheduler. A rewritten scheduler demonstrated much better performance, but was not accepted as-is. Google for Con Kolivas to learn more. It supposedly has gotten better but only very recently.<br>

<br>
You need to find someone to talk to who knows this stuff, I&#39;m only watching from afar. Here&#39;s the general idea:<br>
<br>
<a href="http://x264dev.multimedia.cx/?p=185" target="_blank">http://x264dev.multimedia.cx/?p=185</a></blockquote><div><br></div><div>Thanks Bert!  Plenty to investigate here, but building a special kernel is something I didn&#39;t bargain for ;)</div>
<div><br></div><div><br></div><div>I think one interim solution to explore is to run the sound pump from the VM thread in the VM&#39;s check for events code.  In the Cog VMs a 1KHz heartbeat updates the wall clock and causes the VM to break out of native code and check for events (ideally the heartbeat is a separate thread).  An mentioned, on linux the heartbeat is a software signal from an interval timer.  The software interrupt serves also to interrupt any system calls (e.g. in relinquishProcessorForMilliseconds).  I can extend the heartbeat to set a flag saying &quot;run the sound pump&quot; which will be checked by the VM when checking for events and it will invoke the sound pump code.  The problem here is that any long-running activities that aren&#39;t interruptable by the software interrupt (OpenGL rendering?) will delay the sound pump.  So this is either doomed to failure or might just work depending on those other activities.  Comments?  Try it, waste of time?</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
<font color="#888888"><br>
- Bert -<br>
<br>
<br>
</font></blockquote></div><br>