Skip to content

alsa-ucm: Fix UCM devices which names share a prefix being seen as the same

Before this commit ucm_port_contains() was using a strncmp to compare UCM-device-names without first checking that the part of the port_name being compared and the device-name have the same length, this was causing it to return true for both "InternalMic-IN1" and "InternalMic-IN12" when port_name contained "InternalMic-IN1".

We hit this with the bytcr_rt5651 UCM profile which has "InternalMic-IN1", "InternalMic-IN2" and "InternalMic-IN12" devices, for devices with their internal mic connected to IN1, or IN2, or using stereo internal mics connected to both. This problem resulted in various problems including the RECMIXL? BST2 switch getting turned on when selecting only "InternalMic-IN1", as well as confusing the gnome-control-center sound panel, which could not figure out which device is selected in this case.

Signed-off-by: Hans de Goede hdegoede@redhat.com

Merge request reports