All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Franke <markus.franke@s2002.tu-chemnitz.de>
To: Trent Piepho <xyzzy@speakeasy.org>
Cc: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org
Subject: Re: DMA buffer gets played only once
Date: Thu, 06 Sep 2007 11:57:03 +0530	[thread overview]
Message-ID: <46DF9DB7.80705@hrz.tu-chemnitz.de> (raw)
In-Reply-To: <46DF99E6.30608@hrz.tu-chemnitz.de>

I just found out that the problem of multiple calls of 
TRIGGER_START/TRIGGER_STOP might be caused by using ossplay (oss 
emulation layer) for testing. If I use aplay, TRIGGER_START gets called 
once but then Alsa goes in a loop continuously calling pcm_pointer().
Return values of pcm_pointer() look like the following:

---snip---
pcm_pointer returns 0
pcm_pointer returns 1024
pcm_pointer returns 2048
pcm_pointer returns 3072
pcm_pointer returns 4096
pcm_pointer returns 5120
pcm_pointer returns 6144
pcm_pointer returns 7168
pcm_pointer returns 0
pcm_pointer returns 1024
pcm_pointer returns 2048
pcm_pointer returns 3072
pcm_pointer returns 4096
pcm_pointer returns 5120
pcm_pointer returns 6144
pcm_pointer returns 7168
---snap---

Finally I get a message saying:

---snip---
ALSA sound/core/pcm_native.c:1525: playback drain error (DMA or IRQ 
trouble?)
---snap---

Hope this helps.

Regards,
Markus Franke

Markus Franke wrote:
> Hi,
> 
> Trent Piepho wrote:
>> You need to make sure the buffer size is an integer multiple of the period
>> size if you wrap like this.
> 
> Yeah I have to take care of this but right now my buffersize is 32768 
> bytes and the period size is 4096 bytes which should work I think.
> 
>> I found that ALSA would call TRIGGER_STOP if it detected an overrun.
> 
> Yeah that's right. I guess this is my case because xrun() is getting 
> called somewhere. So how can I fix this underrun problem?
> 
>> Check the value returned for every call of your pointer callback.  I found out
>> that ALSA was calling the pointer callback before the first IRQ, which was
>> something I hadn't planned on and the values confused ALSA.
> 
> That's not my case. pcm_pointer gets called after the first DMA 
> transaction is finished. (DMA transfer finished callback gets called 
> before pcm_pointer) Also the values which are returned by pcm_pointer 
> look quite reasonable. (see also my very first posting in this thread, 
> look for the printk's "pcm_pointer returns <value>")
> 
> 
> Thanks for your effort,
> 
> Markus Franke
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

  reply	other threads:[~2007-09-06  6:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-05  6:20 DMA buffer gets played only once Markus Franke
2007-09-05  9:04 ` Clemens Ladisch
2007-09-05  9:17   ` Markus Franke
2007-09-05 12:55     ` Takashi Iwai
2007-09-06  4:36       ` Markus Franke
2007-09-06  5:14         ` Trent Piepho
2007-09-06  6:10           ` Markus Franke
2007-09-06  6:27             ` Markus Franke [this message]
2007-09-06 10:56               ` Takashi Iwai
2007-09-06 13:39               ` Trent Piepho

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=46DF9DB7.80705@hrz.tu-chemnitz.de \
    --to=markus.franke@s2002.tu-chemnitz.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    --cc=xyzzy@speakeasy.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.