Sound glitches with double buffered playback

Post Reply
cdmac
Posts: 10
Joined: Tue Jul 13, 2010 8:00 pm

Sound glitches with double buffered playback

Post by cdmac » 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

Oibaf
Posts: 34
Joined: Mon Jul 04, 2011 1:03 pm

Re: Sound glitches with double buffered playback

Post by Oibaf » Sun Apr 21, 2013 4:35 pm

You should also use these instructions for a double buffer routine:

ASND_TestVoiceBufferReady
ASND_TestPointer
ASND_AddVoice

Look at this spanish tutorial in the sound section;

http://www.elotrolado.net/hilo_curso-de ... on_1257837

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests