All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: pcm: send DAPM_STREAM_STOP event in dpcm_fe_dai_shutdown
@ 2020-12-02 19:33 Ranjani Sridharan
  2020-12-03 14:31 ` Mark Brown
  2020-12-07 17:20 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Ranjani Sridharan @ 2020-12-02 19:33 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, hdegoede, broonie, Ranjani Sridharan, Pierre-Louis Bossart

A recent change removed the call to send the DAPM_STREAM_STOP
event in dpcm_fe_dai_shutdown. But this causes a regression
when a PCM prepare is not paired with a hw_free. So, add
the DAPM_STREAM_STOP event back to dpcm_fe_dai_shutdown()
to fix this.

The new sequence would be:
soc_pcm_prepare()
    -> SND_SOC_DAPM_STREAM_START

soc_pcm_hw_free()
    -> soc_pcm_hw_free()
	-> SND_SOC_DAPM_STREAM_STOP

dpcm_fe_dai_shutdown()
    -> SND_SOC_DAPM_STREAM_STOP

Note that the DAPM_STREAM_STOP will be called twice but it seems
harmless.

Fixes: a27b421f1d04 ('ASoC: pcm: call snd_soc_dapm_stream_stop() in soc_pcm_hw_clean')

Reported-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/soc-pcm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 5250124dc8f5..ae062e4d1ce8 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1860,6 +1860,9 @@ static int dpcm_fe_dai_shutdown(struct snd_pcm_substream *substream)
 	/* now shutdown the frontend */
 	soc_pcm_close(substream);
 
+	/* run the stream stop event */
+	dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_STOP);
+
 	fe->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE;
 	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
 	return 0;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: pcm: send DAPM_STREAM_STOP event in dpcm_fe_dai_shutdown
  2020-12-02 19:33 [PATCH] ASoC: pcm: send DAPM_STREAM_STOP event in dpcm_fe_dai_shutdown Ranjani Sridharan
@ 2020-12-03 14:31 ` Mark Brown
  2020-12-05 17:08   ` Hans de Goede
  2020-12-07 17:20 ` Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2020-12-03 14:31 UTC (permalink / raw)
  To: Ranjani Sridharan; +Cc: tiwai, hdegoede, alsa-devel, Pierre-Louis Bossart

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

On Wed, Dec 02, 2020 at 11:33:43AM -0800, Ranjani Sridharan wrote:
> A recent change removed the call to send the DAPM_STREAM_STOP
> event in dpcm_fe_dai_shutdown. But this causes a regression
> when a PCM prepare is not paired with a hw_free. So, add
> the DAPM_STREAM_STOP event back to dpcm_fe_dai_shutdown()
> to fix this.

Hans, does this fix the issue you were seeing?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: pcm: send DAPM_STREAM_STOP event in dpcm_fe_dai_shutdown
  2020-12-03 14:31 ` Mark Brown
@ 2020-12-05 17:08   ` Hans de Goede
  0 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2020-12-05 17:08 UTC (permalink / raw)
  To: Mark Brown, Ranjani Sridharan; +Cc: tiwai, alsa-devel, Pierre-Louis Bossart

Hi,

On 12/3/20 3:31 PM, Mark Brown wrote:
> On Wed, Dec 02, 2020 at 11:33:43AM -0800, Ranjani Sridharan wrote:
>> A recent change removed the call to send the DAPM_STREAM_STOP
>> event in dpcm_fe_dai_shutdown. But this causes a regression
>> when a PCM prepare is not paired with a hw_free. So, add
>> the DAPM_STREAM_STOP event back to dpcm_fe_dai_shutdown()
>> to fix this.
> 
> Hans, does this fix the issue you were seeing?

Yes I can confirm that this fixes the errors which I was seening with asoc/for-5.11:

Tested-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: pcm: send DAPM_STREAM_STOP event in dpcm_fe_dai_shutdown
  2020-12-02 19:33 [PATCH] ASoC: pcm: send DAPM_STREAM_STOP event in dpcm_fe_dai_shutdown Ranjani Sridharan
  2020-12-03 14:31 ` Mark Brown
@ 2020-12-07 17:20 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2020-12-07 17:20 UTC (permalink / raw)
  To: Ranjani Sridharan, alsa-devel; +Cc: tiwai, hdegoede, Pierre-Louis Bossart

On Wed, 2 Dec 2020 11:33:43 -0800, Ranjani Sridharan wrote:
> A recent change removed the call to send the DAPM_STREAM_STOP
> event in dpcm_fe_dai_shutdown. But this causes a regression
> when a PCM prepare is not paired with a hw_free. So, add
> the DAPM_STREAM_STOP event back to dpcm_fe_dai_shutdown()
> to fix this.
> 
> The new sequence would be:
> soc_pcm_prepare()
>     -> SND_SOC_DAPM_STREAM_START
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: pcm: send DAPM_STREAM_STOP event in dpcm_fe_dai_shutdown
      commit: bb9dd3ce6177e1f8cf01b0d45e6bd9b93f656bd0

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-07 17:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 19:33 [PATCH] ASoC: pcm: send DAPM_STREAM_STOP event in dpcm_fe_dai_shutdown Ranjani Sridharan
2020-12-03 14:31 ` Mark Brown
2020-12-05 17:08   ` Hans de Goede
2020-12-07 17:20 ` Mark Brown

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.