[Live-devel] Buffer underrrun PCM->uLaw
Braden Ackerman
braden at blacksumac.com
Mon May 6 16:41:38 PDT 2013
Greetings,
I'm trying to stream uLaw audio from our ios-app to an arm based board
via RTP. I've been following testWAVAudioStreamer and using
uLawFromPCMAudioSource except that I'm getting the audio data from a
call back that's sent from an AudioQueue (ios) instead of from file.
Basically streaming from a device.
I've written a sub class of FramedSource.
The issue I'm having seems to be buffer under run. If I let the buffer
build up a bit before starting the thread with live555 in it, the
playback is perfect until the buffer gets closer to empty. Normally,
(or after the built up buffer is depleted, which happens quickly) the
audio then sounds like it's skipping. 0.5 second or so of audio,
silence, repeat.
I've tried:
- Sleeping in deliverFrame() until the buffer has data (stupid, for sure).
- Implementing an eventTrigger to call deliverFrame0() when the buffer has data.
- I've investigated the "watchVariable" but I don't feel this is
applicable to my problem.
Currently the source is:
16-bit mono PCM @ 8k sample rate.
mRecordFormat.mSampleRate = 8000.0;
mRecordFormat.mChannelsPerFrame = 1;
mRecordFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger |
kLinearPCMFormatFlagIsPacked;
mRecordFormat.mBitsPerChannel = 16;
mRecordFormat.mBytesPerPacket = mRecordFormat.mBytesPerFrame =
(mRecordFormat.mBitsPerChannel / 8) * mRecordFormat.mChannelsPerFrame;
mRecordFormat.mFramesPerPacket = 1;
I'm putting it through uLawFromPCMAudioSource, is there any chance
it's expecting a different sample rate?
I have the ability to record directly in uLaw, but I don't see a
"Source" for uLaw audio. So, I used the uLawFromPCMAudioSource and
record in 16bit mono PCM.
I'm going to be posting the source of this portion of the app when
it's working properly for all to use.
Thanks for your time folks.
As well, thanks for the work on an excellent library.
-Braden Ackerman
P.S. VLC complains like this:
main warning: buffer way too early (-685667), clearing queue
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 (355750), dropping buffer
main warning: buffer way too late (227750), dropping buffer
main warning: buffer way too late (355750), dropping buffer
main warning: buffer way too late (227750), dropping buffer
More information about the live-devel
mailing list