On 10/11/2011 03:10 PM, Paul Davis wrote:
As promised, here's what I found.
Our Wine provides the following required tweaks:
* Kontakt needs to be able to get and set realtime thread priority with
* Kontakt needs to be able to call Get/SetThreadPriority() without a
trip to the wine server.
* Kontakt's helper threads need to be prevented from running while audio
processing is underway unless there is a core available for them to
process on. For our host, we solved this by running them with
SCHED_FIFO/P-1, where our audio processing threads are running at
SCHED_RR/P. So, if our host is using core1, their threads can run on
core2. But if our host is using both core1 and core2 for audio
processing, they won't wake up until processing is over.
The other crucial piece appears to be improvements to the kernel between
2.6.24 and 2.6.33. We found that even with the thread priorities fixed,
we could mess up kontakt's performance by dropping disk caches (echo 2 >
/proc/sys/vm/drop_caches). That got fixed in 2.6.33, presumably by
improvements in preemtibility.
That was three week's of work! But I'm glad to have got to the bottom of
it. And thanks to the list for helping point me in the right direction.
- Michael Ost
Linux-audio-dev mailing list