[Live-devel] Audio skipping - Seems to be timing related
Braden Ackerman
braden at blacksumac.com
Fri May 10 10:50:38 PDT 2013
Greetings,
Thank you Ross for your response mid-week.
I believe I've correctly implemented your suggestion, but I'm still
experiencing the same issue.
Recap: I'm trying to send mu-law audio over RTP. The audio comes from the
microphone on an ios device, via AudioQueue.
I'm following testWaveAudioStreamer.
I've subclassed FramedSource and pass the audio through
uLawFromPCMAudioSource after it's stored in a circular FIFO buffer (after
being returned from the ios AudioQueue callback after mic capture).
Issue: I get "skipping" ~ 0.5 sec audio, then ~ 0.5 sec silence.
The buffer is still under running (causing a sleep in deliverFrame() which
I believe should never be happening once I have this correctly implemented).
As per Ross' excellent suggestion I've set fDurationInMicroseconds like
this:
int fNumChannels =1;
int fBitsPerSample = 16;
int fSamplingFrequency = 8000;
unsigned fPlayTimePerSample = 1e6/(double)fSamplingFrequency;
unsigned bytesPerSample = (fNumChannels*fBitsPerSample)/8;
fDurationInMicroseconds =(unsigned)((fPlayTimePerSample*fFrameSize)/
bytesPerSample);
-----
The fDurationInMicroseconds works out to 500000 microseconds, which would
make sense as each buffer returned from the ios AudioQueue is about 0.5
seconds.
I'll paste some output from VLC. If anyone can point me in the right
direction to correct my error here I'd appreciate it immensely.
FYI, I'll be posting this code publicly once it's working for all to use.
Thanks so much for your time, and the hard work on an excellent library.
Best regards,
Braden Ackerman
VLC complains like this:
main warning: timing screwed, stopping resampling
main warning: buffer too late (179500), up-sampling
main warning: buffer way too late (358875), dropping buffer
main warning: buffer way too late (230875), dropping buffer
main warning: buffer way too late (356000), dropping buffer
main warning: buffer way too late (228000), dropping buffer
main warning: buffer way too late (356000), dropping buffer
main warning: buffer way too late (228000), dropping buffer
main warning: buffer way too late (356000), dropping buffer
main warning: buffer way too late (347500), dropping buffer
main warning: buffer way too late (219500), dropping buffer
main warning: buffer way too late (347500), dropping buffer
main warning: buffer way too late (219500), dropping buffer
main warning: buffer way too late (347500), dropping buffer
main warning: buffer way too late (219500), dropping buffer
main debug: audio output is starving (-720558), playing silence
main warning: buffer way too late (322098), dropping buffer
main warning: buffer way too late (194098), dropping buffer
main warning: buffer way too late (322098), dropping buffer
main warning: buffer way too late (194098), dropping buffer
main warning: buffer way too early (-177606), clearing queue
main warning: timing screwed, stopping resampling
main warning: buffer too early (-51609), down-sampling
main warning: timing screwed, stopping resampling
main warning: buffer too late (128016), up-sampling
main warning: buffer way too early (-231484), clearing queue
main warning: timing screwed, stopping resampling
main warning: buffer way too late (245727), dropping buffer
main warning: buffer too late (117727), up-sampling
main warning: buffer way too late (297227), dropping buffer
main warning: buffer way too early (-126440), clearing queue
main warning: timing screwed, stopping resampling
main warning: buffer way too late (195604), dropping buffer
main warning: buffer too late (67604), up-sampling
main warning: audio output out of sync, adjusting dates (-44447 us)
main warning: computed PTS is out of range (36360), clearing out
main warning: timing screwed, stopping resampling
main warning: not synchronized (-44445 us), resampling
main warning: buffer too early (-44445), down-sampling
main debug: audio output is starving (-971888), playing silence
rtp warning: 1 packet(s) lost
main debug: End of audio preroll
rtp warning: 1 packet(s) lost
main debug: End of audio preroll
main warning: resampling stopped after 1060698 usec (drift: 0)
main warning: buffer too late (179500), up-sampling
rtp warning: 1 packet(s) lost
rtp warning: 1 packet(s) lost
main debug: End of audio preroll
main warning: resampling stopped after 894671 usec (drift: -179375)
rtp warning: 1 packet(s) lost
main debug: End of audio preroll
main warning: buffer too late (179500), up-sampling
main warning: buffer way too early (-370330), clearing queue
main warning: timing screwed, stopping resampling
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130510/17031e67/attachment-0001.html>
More information about the live-devel
mailing list