[PlanetCCRMA] Re: PlanetCCRMA digest, Vol 1 #1858 - 2 msgs

Fernando Lopez-Lezcano nando@ccrma.Stanford.EDU
Wed Oct 25 11:19:02 2006


On Tue, 2006-10-24 at 18:02 -0700, Anthony Green wrote:
> On Tue, 2006-10-24 at 17:44 -0700, Fernando Lopez-Lezcano wrote:
> > Even if that made it to the mainline kernel I bet it would take quite a
> > while for that to be enabled in a stock Fedora kernel...
> 
> Just out of curiosity, what do you think is the best way to measure the
> impact of kernel tuning on audio performance?

Well, there used to be a tool for that but it was a long long time ago.
I think Takashi had written it but I may be mistaken. 

What I usually do is run Jack with 128 or 64 frames and load the
computer with different tasks. If preemption is working fine and the
interrupt realtime priorities (for the PREEMPT_RT case only, I think)
are correctly set there should be _no_ xruns no matter what you do.
There are ways to try to trace what is causing an xrun so that the
kernel gurus might try to fix it - honestly I rarely do that, my time is
so scarce... 

> The default Fedora kernel is built with CONFIG_PREEMPT_VOLUNTARY.  What
> would CONFIG_PREEMPT do?  What about increasing the timer frequency?
> etc...

The config options are (in order of performance gain for low latency):
  no preemption
  CONFIG_PREEMPT_VOLUNTARY
  CONFIG_PREEMPT_DESKTOP
  CONFIG_PREEMPT_RT

So the default Fedora kernel has some preemption. Better than nothing.
_DESKTOP is better and _RT is the best - my memory is fuzzy about the
exact things that each adds to the base preemption stuff, one of them I
think is getting rid of the big kernel lock (which used to be used for
getting smp to work) but that may have migrated to the base kernel
already, _RT surely adds IRQ tasks (the lower half) that run at
SCHED_FIFO and need to be prioritized properly (_and_ jack's realtime
priority needs to be set accordingly). 

About timer frequency... sigh... it got downgraded by default to 250Hz
and that impacts MIDI timing significantly. The change was argued in the
lkml for a while but the impact on battery life for laptops was deemed
more important, I think. So yes, the Planet CCRMA kernels are compiled
with HZ=1000 and that makes things better. 

-- Fernando