Re: Core Audio thread priority
Re: Core Audio thread priority
- Subject: Re: Core Audio thread priority
- From: Paul Davis <email@hidden>
- Date: Thu, 14 Oct 2010 23:10:00 -0400
On Thu, Oct 14, 2010 at 10:46 PM, Evan Olcott
<email@hidden> wrote:
> Just exploring an angle here - a user (and frequent poster here whom I respect greatly) gave us a tip with regards to the CoreAudio thread running in a desktop application, but just looking for some clarification/insight...
>
> Is there any benefit to modifying the CoreAudio thread's priority after the launch of an application?
>
> Let me snip a bit from our conversation:
> -----
> As far as I recall, audio playback with CoreAudio has always required that application developers modify their own thread priority to be real-time fixed, rather than the usual degrading priority that programs get. When I say "CoreAudio thread" I really just mean the thread within your application that handles audio. You certainly have a separate thread for audio, apart from the GUI thread. My experience is that setting the proper thread priority not only gets rid of glitches, but it actually lowers the CPU usage of an audio application.
> -----
>
> In all my years working in CoreAudio, I've never come across this documented anywhere or given as an example in sample code. Can someone clarify if this is actually true, and if so, how to take advantage of this?
JACK uses realtime scheduling if requested by the user (its actually
the default now). this involves semantically a lot more than changing
the priority - it puts the thread into a different scheduling class
than ordinary threads.
thankfully, OS X makes this vastly simpler than most pthread-based
systems. the jack code to do this is 1 line:
setThreadToPriority(thread, 96, TRUE, 10000000);
the performance improvement compared to linux is not as big, but it is
still noticeable if the machine has any noticeable other load.
--p
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden