Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: lower "no backend DAIs enabled for ... Port" log severity

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>
Link: https://lore.kernel.org/r/20230805171435.31696-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Hans de Goede and committed by
Mark Brown
f957172b a3440da4

+6 -2
+6 -2
sound/soc/soc-pcm.c
··· 38 38 switch (ret) { 39 39 case -EPROBE_DEFER: 40 40 case -ENOTSUPP: 41 + case -EINVAL: 41 42 break; 42 43 default: 43 44 dev_err(rtd->dev, ··· 2467 2466 2468 2467 /* there is no point preparing this FE if there are no BEs */ 2469 2468 if (list_empty(&fe->dpcm[stream].be_clients)) { 2470 - dev_err(fe->dev, "ASoC: no backend DAIs enabled for %s\n", 2471 - fe->dai_link->name); 2469 + /* dev_err_once() for visibility, dev_dbg() for debugging UCM profiles */ 2470 + dev_err_once(fe->dev, "ASoC: no backend DAIs enabled for %s, possibly missing ALSA mixer-based routing or UCM profile\n", 2471 + fe->dai_link->name); 2472 + dev_dbg(fe->dev, "ASoC: no backend DAIs enabled for %s\n", 2473 + fe->dai_link->name); 2472 2474 ret = -EINVAL; 2473 2475 goto out; 2474 2476 }