All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: lower "no backend DAIs enabled for ... Port" log severity
@ 2023-08-05 17:14 Hans de Goede
  2023-08-07 14:05 ` Pierre-Louis Bossart
  2023-08-07 21:34 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Hans de Goede @ 2023-08-05 17:14 UTC (permalink / raw)
  To: Pierre-Louis Bossart, Liam Girdwood, Mark Brown, Takashi Iwai
  Cc: Hans de Goede, alsa-devel

If SNDRV_PCM_IOCTL_PREPARE is called when the mixer settings linking
frontend and backend have not been setup yet this results in
e.g. the following errors getting logged:

[   43.244549]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
[   43.244744]  Baytrail Audio Port: ASoC: error at dpcm_fe_dai_prepare on Baytrail Audio Port: -22

pipewire triggers this leading to 96 lines getting logged
after the user has logged into a GNOME session.

Change the actual "no backend DAIs enabled for ... Port" error to
dev_err_once() to avoid it getting repeated 48 times. While at it
also improve the error by hinting the user how to fix this.

To not make developing new UCM profiles harder, also log the error
at dev_dbg() level all the time (vs once). So that e.g. dyndbg can
be used to (re)enable the messages.

Also changes _soc_pcm_ret() to not log for -EINVAL errors, to fix
the other error getting logged 48 times. Userspace passing wrong
parameters should not lead to dmesg messages.

Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3407
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
- Switch the logging to a combination of dev_err_once() with
  improved log-message + dev_dbg() with shorter log message
---
 sound/soc/soc-pcm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 8896227e4fb7..3aa6b988cb4b 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -38,6 +38,7 @@ static inline int _soc_pcm_ret(struct snd_soc_pcm_runtime *rtd,
 	switch (ret) {
 	case -EPROBE_DEFER:
 	case -ENOTSUPP:
+	case -EINVAL:
 		break;
 	default:
 		dev_err(rtd->dev,
@@ -2466,8 +2467,11 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream)
 
 	/* there is no point preparing this FE if there are no BEs */
 	if (list_empty(&fe->dpcm[stream].be_clients)) {
-		dev_err(fe->dev, "ASoC: no backend DAIs enabled for %s\n",
-				fe->dai_link->name);
+		/* dev_err_once() for visibility, dev_dbg() for debugging UCM profiles */
+		dev_err_once(fe->dev, "ASoC: no backend DAIs enabled for %s, possibly missing ALSA mixer-based routing or UCM profile\n",
+			     fe->dai_link->name);
+		dev_dbg(fe->dev, "ASoC: no backend DAIs enabled for %s\n",
+			fe->dai_link->name);
 		ret = -EINVAL;
 		goto out;
 	}
-- 
2.41.0


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

* Re: [PATCH v2] ASoC: lower "no backend DAIs enabled for ... Port" log severity
  2023-08-05 17:14 [PATCH v2] ASoC: lower "no backend DAIs enabled for ... Port" log severity Hans de Goede
@ 2023-08-07 14:05 ` Pierre-Louis Bossart
  2023-08-07 21:34 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Pierre-Louis Bossart @ 2023-08-07 14:05 UTC (permalink / raw)
  To: Hans de Goede, Liam Girdwood, Mark Brown, Takashi Iwai; +Cc: alsa-devel



On 8/5/23 12:14, Hans de Goede wrote:
> If SNDRV_PCM_IOCTL_PREPARE is called when the mixer settings linking
> frontend and backend have not been setup yet this results in
> e.g. the following errors getting logged:
> 
> [   43.244549]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
> [   43.244744]  Baytrail Audio Port: ASoC: error at dpcm_fe_dai_prepare on Baytrail Audio Port: -22
> 
> pipewire triggers this leading to 96 lines getting logged
> after the user has logged into a GNOME session.
> 
> Change the actual "no backend DAIs enabled for ... Port" error to
> dev_err_once() to avoid it getting repeated 48 times. While at it
> also improve the error by hinting the user how to fix this.
> 
> To not make developing new UCM profiles harder, also log the error
> at dev_dbg() level all the time (vs once). So that e.g. dyndbg can
> be used to (re)enable the messages.
> 
> Also changes _soc_pcm_ret() to not log for -EINVAL errors, to fix
> the other error getting logged 48 times. Userspace passing wrong
> parameters should not lead to dmesg messages.
> 
> Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3407
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>


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

* Re: [PATCH v2] ASoC: lower "no backend DAIs enabled for ... Port" log severity
  2023-08-05 17:14 [PATCH v2] ASoC: lower "no backend DAIs enabled for ... Port" log severity Hans de Goede
  2023-08-07 14:05 ` Pierre-Louis Bossart
@ 2023-08-07 21:34 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2023-08-07 21:34 UTC (permalink / raw)
  To: Pierre-Louis Bossart, Liam Girdwood, Takashi Iwai, Hans de Goede
  Cc: alsa-devel

On Sat, 05 Aug 2023 19:14:35 +0200, Hans de Goede wrote:
> If SNDRV_PCM_IOCTL_PREPARE is called when the mixer settings linking
> frontend and backend have not been setup yet this results in
> e.g. the following errors getting logged:
> 
> [   43.244549]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
> [   43.244744]  Baytrail Audio Port: ASoC: error at dpcm_fe_dai_prepare on Baytrail Audio Port: -22
> 
> [...]

Applied to

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

Thanks!

[1/1] ASoC: lower "no backend DAIs enabled for ... Port" log severity
      commit: 1f566435141047ca7db26aa4b0b6647a25badaee

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] 3+ messages in thread

end of thread, other threads:[~2023-08-07 21:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-05 17:14 [PATCH v2] ASoC: lower "no backend DAIs enabled for ... Port" log severity Hans de Goede
2023-08-07 14:05 ` Pierre-Louis Bossart
2023-08-07 21:34 ` 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.