From: Takashi Iwai <tiwai@suse.de>
To: Shengjiu Wang <shengjiu.wang@gmail.com>
Cc: Shengjiu Wang <shengjiu.wang@nxp.com>,
lars@metafoo.de, perex@perex.cz, tiwai@suse.com,
broonie@kernel.org, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org
Subject: Re: [RESEND PATCH] ALSA: dmaengine_pcm: terminate dmaengine before synchronize
Date: Mon, 24 Jun 2024 14:39:12 +0200 [thread overview]
Message-ID: <87cyo6plan.wl-tiwai@suse.de> (raw)
In-Reply-To: <CAA+D8APZ8-3NFceuQeTnEL-K4reUGGfrgyG63jyjydFA6o_4MA@mail.gmail.com>
On Fri, 21 Jun 2024 04:21:19 +0200,
Shengjiu Wang wrote:
>
> On Thu, Jun 20, 2024 at 3:56 PM Takashi Iwai <tiwai@suse.de> wrote:
> > But, this may need more rework, too; admittedly it imposes the
> > unnecessary resume of the stream although it shall be stopped and
> > closed immediately after that. We may have some optimization in
> > addition.
>
> The suspended_state is not cleared that the resume may be called again
> at the end of stream.
Right, that's the known side effect of this approach.
> Will you push the code?
I'm rethinking of this again, and I'm inclined rather to take your
patch for now. The side-effect above would be much higher impact in
theory, so I'm not quite sure whether the behavior is acceptable.
Basically, a missing piece is the shortcut state change from SUSPENDED
to CLOSED. Most drivers don't care as the SUSPENDED state is almost
equivalent with STOPPED state, and they don't support RESUME (hence
the application needs to re-initialize via PREPARE). But a case like
dmaengine, there can be inconsistency as you pointed out.
By putting snd_pcm_resume() at the beginning of close procedure like
my patch, the state change itself is corrected. However, it imposes
unnecessary resume, which should be avoided.
Ultimately, we may need some flag or conditional trigger for clearing
this pending SUSPENDED state. But it needs further consideration.
thanks,
Takashi
next prev parent reply other threads:[~2024-06-24 12:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-20 2:40 [RESEND PATCH] ALSA: dmaengine_pcm: terminate dmaengine before synchronize Shengjiu Wang
2024-06-20 7:57 ` Takashi Iwai
2024-06-21 2:21 ` Shengjiu Wang
2024-06-24 12:39 ` Takashi Iwai [this message]
2024-06-25 11:26 ` Takashi Iwai
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=87cyo6plan.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=shengjiu.wang@gmail.com \
--cc=shengjiu.wang@nxp.com \
--cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox