All of lore.kernel.org
 help / color / mirror / Atom feed
From: Norbert van Bolhuis <nvbolhuis@aimvalley.nl>
To: alsa-devel@alsa-project.org
Subject: Re: my ALS drv gives DMA underrun
Date: Thu, 29 May 2008 16:27:57 +0200	[thread overview]
Message-ID: <483EBD6D.5020200@aimvalley.nl> (raw)
In-Reply-To: <75b66ecd0805281710g5852332dw230d30d5995dd279@mail.gmail.com>

Lee Revell wrote:
> On Wed, May 28, 2008 at 11:17 AM, Norbert van Bolhuis
> <nvbolhuis@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
occured.

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

      reply	other threads:[~2008-05-29 14:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-28 15:17 my ALS drv gives DMA underrun Norbert van Bolhuis
2008-05-29  0:10 ` Lee Revell
2008-05-29 14:27   ` Norbert van Bolhuis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=483EBD6D.5020200@aimvalley.nl \
    --to=nvbolhuis@aimvalley.nl \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.