Re: Driver seems a little dizzy while running more than on mediaplayer
Re: Driver seems a little dizzy while running more than on mediaplayer
- Subject: Re: Driver seems a little dizzy while running more than on mediaplayer
- From: Jeff Moore <email@hidden>
- Date: Thu, 26 Feb 2009 12:12:08 -0800
Sorry this took so long.
On Feb 25, 2009, at 12:52 PM, David Tan wrote:
Hi Jeff,
Thanks for your reply!
Yes, the noise only occurs in multi-client-case.
So you mean: every user-space client has its own thread to call
IOAudioEngine::clipOutputSamples(), right?
This is correct.
And every time of clipOutputSamples() being called, all audio data
in mixBuf
are for just one client, right?
No. I believe that this has the output of the mixer in the IOAudio
family. So it has the mixed audio for all the clients for that time
slice.
If I got misunderstanding of your comments, please correct me.
I was referring to how your driver handles dropping time stamps for
the HAL. There are multiple real time threads running when there are
multiple user clients. If you are not careful with when you take your
time stamp, this extra thread activity will introduce errors in your
time stamp by causing extra scheduling latency for the thread on which
the time stamp is taken. The usual example of this is when a driver
takes it's time stamp in a secondary interrupt. The real time thread
activity will cause scheduling latency which introduces jitter into
such a driver's time stamp.
Actually I have an interim buffer to maintain the audio data from
user-space
client, and a write and a read pointer respectively to it. While
clipOutputSamples() is being called, I move the audio data in mixBuf
into
this interim buffer and update the write pointer. At the same time,
a DCL
program will read data in this interim buffer and transmit them to my
Firewire device. Of course, I'll update the read pointer of it
during this
operation.
Regarding the timing issue you said, I wonder if there's structure
problem
of my current solution. Usually, how should we handle the timing in
case of
multi-client?
Thanks a lot!
Sincerely yours,
David Tan
Software Engineer
Dextrys Co., Ltd.
-----Original Message-----
From: coreaudio-api-bounces+david.tan=email@hidden
[mailto:coreaudio-api-bounces+david.tan=email@hidden]
On
Behalf Of Jeff Moore
Sent: 2009年2月23日 9:39
To: Apple CoreAudio-API
Subject: Re: Driver seems a little dizzy while running more than on
mediaplayer
If your driver is only making noise when there are multiple clients,
it probably means that your driver has a problem with threading. It
sounds like the multiple real time threads in the client processes is
perturbing your driver timing enough to cause it to drop bad time
stamps.
On Feb 23, 2009, at 3:57 AM, David Tan wrote:
I'm working on an kernel Firewire audio driver and found a
troublesome issue.
While I’m using more than one player (e.g. iTunes and HALLab)
to
play music, sometime there’ll be noise. And then I have to
stop both
of them and start playing again, the noise will disappear.
My question is: what’s CoreAudio do in this case? Anything I
should
pay special attention to in my driver to eliminate the noise?
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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