Re: Audio/Video synchronization
Re: Audio/Video synchronization
- Subject: Re: Audio/Video synchronization
- From: Jeff Moore <email@hidden>
- Date: Thu, 15 Jun 2006 11:56:06 -0700
On Jun 15, 2006, at 8:36 AM, Rahul wrote:
I think I have made some progress with your inputs. Hopefully I
will get it
done soon. The current strategy is something like this:
1. I am holding the output unit to its promise. Let's say it gives
a time
stamp saying it will play 2048 bytes when the device sample time
reaches
2126.0.
2. So now I will wait till the sample time of the device reaches
2126.0 from
its current value. When it reaches 2126.0 , I am sure that it has
kept its
promise and played exactly 2048 bytes.
3. I now map this value into the samples of input packet that I
have given
it. Find the one it is playing and set the master clock to the time
stamp of
this.
That seems like it should work a bit better. At least, you're
trusting the time stamps from the HAL =)
There is however one more thing that is bothering me. The data that I
supply to the output audio unit is from a buffer. Now there is a
requirement
wherein I have to stop and dump everything that the audio unit is
currently
playing and going to play. For this , I have dumped the data from
the source
buffer and I have tried using AudioOutputUnitStop followed by
AudioUnitReset
asking the audio unit to do the same.
But after starting the output unit again ( after some 3 sec), I
find that
it has not dumped the samples which it was supposed to play before
performing stop. Now these samples are played after I do start.
Is there a way I can tell the audio unit to dump everything that it is
currently holding?
That seems odd. AUHAL doesn't do any buffering unless you are also
using it's built-in AudioConverter. And even then, the buffering
should only happen for very small amounts of data related to the care
and feeding of the rate converter. Neither the HAL nor the driver do
any sort of buffering of the data either.
This is definitely puzzling. What happens if, when you start things
up again after stopping, you output all zeroes? Does it play silence?
--
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