Sound glitches with double buffered playback
Posted: Mon Apr 01, 2013 8:07 pm
Hi,
My audio playback has glitches that sound like crackling every time I submit a new buffer in the voice callback. I've tried using both asndlib and aesndlib but they both exhibit the same problem. I've tried reading streaming PCM data and reading it from memory, bitrates of 44100 and 48000, and both stereo and mono. Larger buffers obviously make the problem less frequent but the problem doesn't go away. I'm positive that I can feed the data fast enough as I am currently testing with 16 32kB buffers, of which 13 are constantly full. The only thing I can think of is that the callback/interrupt is taking too long and the DSP is running out of data before it is fed another buffer. I'm really not doing anything in the callback though apart from setting the current read buffer with AESND_SetVoiceBuffer() and signalling the audio streaming thread to process another buffer.
Has anybody else had this problem or do you have any ideas? I would really appreciate some input as I have been pulling my hair out for a couple days.
Thanks,
cdmac
My audio playback has glitches that sound like crackling every time I submit a new buffer in the voice callback. I've tried using both asndlib and aesndlib but they both exhibit the same problem. I've tried reading streaming PCM data and reading it from memory, bitrates of 44100 and 48000, and both stereo and mono. Larger buffers obviously make the problem less frequent but the problem doesn't go away. I'm positive that I can feed the data fast enough as I am currently testing with 16 32kB buffers, of which 13 are constantly full. The only thing I can think of is that the callback/interrupt is taking too long and the DSP is running out of data before it is fed another buffer. I'm really not doing anything in the callback though apart from setting the current read buffer with AESND_SetVoiceBuffer() and signalling the audio streaming thread to process another buffer.
Has anybody else had this problem or do you have any ideas? I would really appreciate some input as I have been pulling my hair out for a couple days.
Thanks,
cdmac