[haiku] Scheduler (was: Re: Re: Multi-track recording and compositing)

  • From: "Cyan" <cyanh256@xxxxxxxxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Sat, 06 Jun 2009 23:13:42 +0100 BST

André Braga <meianoite@xxxxxxxxx> wrote:

> I'm guessing here that you're experiencing either buffer corruption
> or clipping due to errors in sample rate conversion.

There is definitely sample-rate-conversion-induced distortion when
the HDA driver is used in the default configuration (it operates at
192kHz which forces SRC), but I think Stephan mentioned that there
is also a system timing problem of some kind?


I was trying to decrease the buffer size on the HDA driver; it
works fine with a buffer of 64 frames under R5, but apparently under
Haiku the buffer size needs to be very much larger, to a point where
the delay is actually bothersome during casual use.
This definitely points to a timing problem somewhere -- under normal
operation there shouldn't be a problem with soundcard buffers in
the range of 16-64 frames (that's over 300us per buffer; quite a
margin of error).


I posted a scheduler timing test app the last time this topic came up
( http://knothole.no-ip.org/timingtest.zip ) which got a few
downloads, but I haven't heard of anyone running this under Haiku
yet. Did anyone try it?


I would think the most likely causes would be any one of:

1) The scheduler,

2) The Media Kit,

3) Or other hardware drivers (not the soundcard driver) keeping
   interrupts disabled for more than 10us. This definitely
   messes the system timing up, no matter how good the scheduler
   or media kit are!


If the timing test app doesn't show any significant jitter (say,
under 100us at all times), that would point to (2). Otherwise it
surely has to be (1) or (3).
The following have been ruled out as causes (by testing under R5):

1) The Haiku Media Kit Mixer,
2) The HDA driver,
3) (sort of) The Haiku Multi Audio add-on (but only an old version
   was tested, so this might not be conclusive).


Sorry, I don't have enough time to run any tests at the moment, but
if anyone's in Haiku right now, that might be something to look at.


Other related posts: