Re: DMA buffer gets played only once

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux