From: Takashi Iwai <tiwai@suse.de>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH v2 0/2] Add snd_card_disconnect_sync() helper
Date: Fri, 13 Oct 2017 11:43:59 +0200 [thread overview]
Message-ID: <s5hh8v3pelc.wl-tiwai@suse.de> (raw)
In-Reply-To: <87efq7v2qf.wl%kuninori.morimoto.gx@renesas.com>
On Fri, 13 Oct 2017 11:11:42 +0200,
Kuninori Morimoto wrote:
>
>
> Hi Takashi
>
> > > I tested this patch-set.
> > > I noticed that it doesn't work if I used DPCM
> > > (Kernel has Oops).
> > > I will investigate it next week
> >
> > Could you show the Oops message if you have?
> > My concern is whether it happens by stopping at disconnect, or it's
> > just another missing piece.
>
> OK, but kernel log doesn't help you.
> see below
>
> My environment now is I'm using DPCM.
> FE : rsnd
> FE : rsnd
> BE : ak4613
>
> 1st issue is that kernel need below patch.
> I guess BE is using dummy driver, and it doesn't have ops(?).
> If this is needed, I can post it.
No, this can't be right. Every PCM implementation mandates the
presence of a trigger callback. It's a must. If a fix needed, it has
to be fixed in the driver side.
> -----------------------
> diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
> index 2fec2fe..972408b 100644
> --- a/sound/core/pcm_native.c
> +++ b/sound/core/pcm_native.c
> @@ -1241,7 +1241,8 @@ static int snd_pcm_do_stop(struct snd_pcm_substream *substream, int state)
> {
> if (substream->runtime->trigger_master == substream &&
> snd_pcm_running(substream))
> - substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP);
> + if (substream->ops && substream->ops->trigger)
> + substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP);
> return 0; /* unconditonally stop all substreams */
> }
> -----------------------
> After this patch, my driver side clock counter mismatch Oops happen.
> It seems this is because FE side wasn't called snd_pcm_stop();
> (= BE side only called snd_pcm_stop()).
So the check might work around an Oops, but it's no "fix", per se.
> I could confirm this by printing who's stop was called by local quick hack.
>
> Maybe timing reason, if kernel has Oops for some reasons,
> then, both BE/FE snd_pcm_stop() are called.
> If no Oops, BE snd_pcm_stop() only called.
Any pending delayed work (like rtd->delayed_work)?
This is flushed at soc_cleanup_card_resources(), but it's called at
card removal, thus it's too late for the hot-removal of the
component.
thanks,
Takashi
next prev parent reply other threads:[~2017-10-13 9:44 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-11 10:16 [PATCH v2 0/2] Add snd_card_disconnect_sync() helper Takashi Iwai
2017-10-11 10:16 ` [PATCH v2 1/2] ALSA: add snd_card_disconnect_sync() Takashi Iwai
2017-10-11 11:22 ` Takashi Sakamoto
2017-10-11 12:19 ` Takashi Iwai
2017-10-11 13:13 ` Takashi Iwai
2017-10-11 10:16 ` [PATCH v2 2/2] ALSA: pcm: Forcibly stop at disconnect callback Takashi Iwai
2017-10-13 7:39 ` [PATCH v2 0/2] Add snd_card_disconnect_sync() helper Kuninori Morimoto
2017-10-13 7:44 ` Takashi Iwai
2017-10-13 9:11 ` Kuninori Morimoto
2017-10-13 9:43 ` Takashi Iwai [this message]
2017-10-13 17:11 ` Mark Brown
2017-10-16 2:26 ` Kuninori Morimoto
2017-10-16 15:37 ` Takashi Iwai
2017-10-17 0:59 ` Kuninori Morimoto
2017-10-17 10:37 ` Takashi Iwai
2017-10-17 20:05 ` Mark Brown
2017-10-18 2:08 ` Kuninori Morimoto
2017-10-18 6:10 ` Takashi Iwai
2017-10-18 7:13 ` Kuninori Morimoto
2017-10-17 14:25 ` Takashi Sakamoto
2017-10-17 14:34 ` Takashi Iwai
2017-10-17 15:16 ` Takashi Sakamoto
2017-10-17 16:09 ` 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=s5hh8v3pelc.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=kuninori.morimoto.gx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox