• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Audio Video sync with Core Audio Queue Services
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Audio Video sync with Core Audio Queue Services


  • Subject: Re: Audio Video sync with Core Audio Queue Services
  • From: William Stewart <email@hidden>
  • Date: Tue, 3 Nov 2009 10:39:02 -0800

Hi Stephen

Could you file a bug report - ideally with some code running that illustrates the problem. We're not sure what's going on, and rather than "play 20 questions", it will be much easier to just work our way through it.

Thanks

Bill

http://bugreporter.apple.com


From: Stephen Thomas <email@hidden>
Date: November 1, 2009 9:10:18 PM PST
To: William Stewart <email@hidden>
Cc: email@hidden
Subject: Re: Audio Video sync with Core Audio Queue Services

Hi William,

Thanks for the reply.

I have tried getting audio timeline and deriving timing info from get time api of AQ.
Logic is as follows:

1) I obtain the audio buffer of duration 32 ms. Each buffer will have a time stamp associated with it.
2) Whenever AQ calls callback asking for more buffer, I get the time stamp of processed audio buffer.
It is referred as base time stamp. Now I need to get the time stamp of the audio buffer which is getting played.

TimeStamp = BaseTimeStamp - (SamplesSent - SamplesPlayed)/SamplingRate;

Code:
#define BUFFER_DURATION  32
AudioTimeStamp currentTime = {0};
AudioQueueGetCurrentTime (m_AudioQueueHandle, m_AudioQueueTimeLine, &currentTime, &discontinuity);
       
Float64 offset = (Float64)( ((Float64)m_udwPacketsSent * BUFFER_DURATION * (m_StreamFormat.mSampleRate / 1000)) - currentTime.mSampleTime)/m_StreamFormat.mSampleRate;

timeStamp.m_Timestamp = m_BaseTimeStamp.m_Timestamp - offset;

Problems encountered:
1) When I used the call "AudioQueueGetCurrentTime" in the AQ's callback. Audio became jerky. It looks like AudioQueueGetCurrentTime is costly call. So I had to place the call in separate timer call.
2) The time stamp obtained does not seems to be of the buffer getting played. Still AV is out of sink in one of the MacBookPro.

In the systems where AV sink is fine, the offset is "0.009", whereas in defective system it is "0.1".

Please help me analyzing what is going wrong here.

Regards
Stephen




 _______________________________________________
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

References: 
 >Re: Audio Video sync with Core Audio Queue Services (From: Stephen Thomas <email@hidden>)

  • Prev by Date: Re: AU, plugin tempo, musical time information
  • Next by Date: Re: AU, plugin tempo, musical time information
  • Previous by thread: Re: Audio Video sync with Core Audio Queue Services
  • Next by thread: Re: iPhone remoteIO audio unit question
  • Index(es):
    • Date
    • Thread