Hi,
On 8/4/23 16:42, Takashi Iwai wrote:
On Fri, 04 Aug 2023 16:06:45 +0200, Pierre-Louis Bossart wrote:
On 8/4/23 08:26, 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 repeats of this in the log after the user has logged into a GNOME session.
IMHO userspace should not be able to get the kernel to spam dmesg like this. Lower the severity of the "no backend DAIs enabled" log message for dai-s with the dynamic flag set to avoid this.
And also changes _soc_pcm_ret() to not log for -EINVAL errors, to fix the other error. Userspace passing wrong parameters should not lead to dmesg messages.
Maybe, but it's a questionable flow if pipewire tries to open stuff without the mixer values set-up. Is there something done about this?
I'm working with the pipewire folks to see if we can fix this on pipewire's side too:
Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3407
I think it's an oft-seen problem when user runs the system without installing a proper UCM profile.
The reason why I am pushing back is that we had a similar issue with HDaudio where HDMI/DP PCM devices were opened without checking if the jack was connected.
It really makes no sense for userspace to try and open devices that are known to be problematic. We can push kernel error logs below the rug, it doesn't make the programming flows better.
Downgrading the message also hides to show what's wrong there. Although the message doesn't indicate how to fix the problem, no message would make debug harder.
So in general I agree that it's annoying and it should be fixed, but hiding all as default can be bad, too. Maybe we can introduce a counter and shut out after three strikes?
Right, this also happens with unsupported codecs (either unsupported in the kernel or no UCM profile available yet). So making this less "chatty" would be good.
I would prefer to just go for only log this once rather then three strikes though, then we can simply use 'dev_err_once()' for this.
Regards,
Hans