alsa-project / alsa-utils

The Advanced Linux Sound Architecture (ALSA) - utilities
GNU General Public License v2.0
197 stars 136 forks source link

nhlt: Revert SSP_ANALOG device_type field #248

Closed andyross closed 10 months ago

andyross commented 10 months ago

This partially reverts commit 3a47ef2487ed ("topology: nhlt: intel: support more device types and directions"), which changed the default device_type in the endpoint descriptor from zero to SSP_ANALOG.

This change breaks the Linux kernel NHLT parser (which AFAICT doesn't recognize SSP_ANALOG at all), producing errors like:

[56458.583812] sof-audio-pci-intel-mtl 0000:00:1f.3: no matching blob for sample rate: 48000 sample width: 32 channels: 2 [56458.583833] sof-audio-pci-intel-mtl 0000:00:1f.3: failed to prepare widget dai-copier.SSP.SSP0-Codec.playback [56458.583840] sof-audio-pci-intel-mtl 0000:00:1f.3: Failed to prepare connected widgets [56458.583847] sof-audio-pci-intel-mtl 0000:00:1f.3: error: failed widget list set up for pcm 1 dir 0 [56458.583853] sof-audio-pci-intel-mtl 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_hw_params on 0000:00:1f.3: -22

Revert for compatibility.

plbossart commented 10 months ago

The revert isn't really needed, there's a kernel fix now.

https://lore.kernel.org/alsa-devel/20231127120657.19764-1-peter.ujfalusi@linux.intel.com/

kv2019i commented 10 months ago

FYI @andyross @plbossart @perexg https://github.com/thesofproject/sof/issues/8396 for some background. In short, we should have blocked merge of this PR, but we did not and discovered this way too late (alsa-utils release was already out).

There's a still a problem if you use upstream alsa-utils to generate tplg files, and try to use them with kernel that does not have the fix. But granted, this affects a fairly small crowd.

andyross commented 10 months ago

FWIW: arch linux has actually shipped alsa-utils 1.2.10 with this regression, which is how I hit this. Other distros might too. But the workaround is trivial as long as you know about it. I'll leave this PR up until the kernel patch propagates far enough for us to cherry pick it internally.

plbossart commented 10 months ago

The kernel patches are in @tiwai 's tree now, see https://lore.kernel.org/alsa-devel/87r0kbnp4b.wl-tiwai@suse.de/

perexg commented 10 months ago

I applied this revert. It seems like a more safer solution. The code should be extended to set the device_type different than zero (NHLT_DEVICE_TYPE_SSP_BT_SIDEBAND).