[alsa-devel] my ALS drv gives DMA underrun

Norbert van Bolhuis nvbolhuis at aimvalley.nl
Thu May 29 16:27:57 CEST 2008

Lee Revell wrote:
> On Wed, May 28, 2008 at 11:17 AM, Norbert van Bolhuis
> <nvbolhuis at aimvalley.nl> wrote:
>> probably this question is asked many times.
>> Anyway, I hope the experts are willing to help me here.
>> I simply don't know how to avoid the DMA overrun that I'm facing
>> when playing a tone.
> Not calling snd_pcm_period_elapsed at the right time would cause the
> behavior you see.    This function wakes up any apps that are waiting
> to send data to the sound device.
> Where can I find the source code for your driver?
> Lee

thanks for you answer.
I'm a bit reluctant to send the full source code, the driver isn't finished
and will go to a customer first.

snd_pcm_period_elapsed is called many times and of course on every TX DMA irq,
otherwise there wouldn't be calls to snd_pcm_update_hw_ptr_interrupt (see trace).

I noticed that I don't suffer from underruns though, only when doing some
printk's in the kernel the underruns occur. otherwise everything is fine
(DMA keeps running)!

The reason I suspected underrun was because whenever my DMA buffer wraps
back to the start, the sound stops playing and i hear a lot of noise.
When I started to investigate what was going on (with printk's), underruns

I still wonder what PCM substream->boundary is, it's defined as
"pointer's wrap point".
Does this mean it's the same as nr_of_frames_in_DMA_buffer ?

This message has been scanned for viruses and is believed to be clean

More information about the Alsa-devel mailing list