All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>,
	Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	"shiiba (Renesas)" <naoya.shiiba.nx@renesas.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: Re: Question about SNDRV_PCM_STATE_DRAINING and DMA	transfer
Date: Fri, 26 Sep 2014 09:35:37 +0200	[thread overview]
Message-ID: <54251749.4040603@ladisch.de> (raw)
In-Reply-To: <87wq8rm20r.wl%kuninori.morimoto.gx@gmail.com>

Kuninori Morimoto wrote:
> We noticed that DMA seems transfered +1 time when Ctrl-C happen.
> But, is this correct ? is this our driver bug ?
> [...]
> 7. DMA transfer interrupt happen
>
>    It calls snd_pcm_period_elapsed() and try to transfer next 2048 byte
>    snd_pcm_playback_avail() in snd_pcm_update_state() return 8192 this time.
>    then, it calls snd_pcm_drain_done()
>
> 9. snd_soc_dai_ops :: trigger called with SNDRV_PCM_TRIGGER_STOP
>
>    driver stops DMA transfer

There is no strong synchronization between snd_pcm_drain() and the rest
of the system; snd_pcm_drain() just waits for an underrun to happen.

In other words, the last actual DMA transfer is likely to contain
invalid (outdated) samples, but gets aborted immediately.


Regards,
Clemens

  reply	other threads:[~2014-09-26  7:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-26  4:36 Question about SNDRV_PCM_STATE_DRAINING and DMA transfer Kuninori Morimoto
2014-09-26  7:35 ` Clemens Ladisch [this message]
2014-09-26  8:03   ` Kuninori Morimoto
2014-09-26  8:15     ` Jaroslav Kysela
2014-09-26  8:45       ` Kuninori Morimoto
2014-09-26 10:07         ` Jaroslav Kysela
2014-09-26 10:31           ` Kuninori Morimoto

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=54251749.4040603@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@gmail.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=naoya.shiiba.nx@renesas.com \
    /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.