All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Franke <markus.franke@s2002.tu-chemnitz.de>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: DMA buffer gets played only once
Date: Thu, 06 Sep 2007 10:06:22 +0530	[thread overview]
Message-ID: <46DF83C6.1090002@hrz.tu-chemnitz.de> (raw)
In-Reply-To: <s5hbqch8e5o.wl%tiwai@suse.de>

Hi,

Takashi Iwai wrote:
>> At least this is the behaviour I experienced.
> 
> It's your mis-interpretation of START/STOP concenpt in the ALSA
> framework.  The trigger START and STOP mean the start/stop of the
> whole streaming operation.  It's basically called from the outside,
> i.e. the application starts/stops the stream.  If you need to keep
> some DMA start/stop operations internally, do it in the driver
> lowlevel side internally.

thanks for reply but as already stated this is the behaviour I 
_experienced_. I don't know why also continuously calls trigger START, 
play one period, trigger STOP. Here is some pseudo code:

---snip---
pcm_trigger()
{
	case SNDRV_PCM_TRIGGER_START:
                 /* start the DMA Transfer */
                 ret = startTransfer(dma_devaddr, params->ch_num, 
num_blocks, vi1888_pcm_dma_userCallback, substream);
                 break;
...
}




vi1888_pcm_dma_userCallback() // gets called upon completion of DMA 
transfer
{
         prtd->period_ptr += prtd->period_size;
         if (prtd->period_ptr >= prtd->dma_buffer_end) {
                 prtd->period_ptr = prtd->dma_buffer;
         }

	/* reconfigure channel according to new period pointer */

         /* start the next DMA Transfer */
         ret = startTransfer(dma_devaddr, params->ch_num, num_blocks, 
vi1888_pcm_dma_userCallback, substream();

         /* notify Alsa for the elapsed periods */
         snd_pcm_period_elapsed(substream);
}

---snap---

After each call to snd_pcm_period_elapsed() Alsa calls 
pcm_trigger(TRIGGER_STOP).

Please tell me what I am doing wrong in these callbacks?


Thanks in advance,
Markus

  reply	other threads:[~2007-09-06  4:34 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 [this message]
2007-09-06  5:14         ` Trent Piepho
2007-09-06  6:10           ` Markus Franke
2007-09-06  6:27             ` Markus Franke
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=46DF83C6.1090002@hrz.tu-chemnitz.de \
    --to=markus.franke@s2002.tu-chemnitz.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /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.