Skip to content

alsa-ucm: Set up hardware volumes again on duplicate port additions

While initializing ALSA cards with UCM, we call pa_alsa_ucm_add_port() for each UCM device for each UCM verb. This checks if a port has been already added by name and skips port initialization if it is already done. Different UCM verbs can have devices with the same name, which means their port names end up being the same. So, this port creation step currently is only done for one UCM verb for both UCM devices.

Volume control setup is also part of this process. The UCM devices only know about the volume mixer information from the UCM verb that they are defined in, so the volume control setup is done for one UCM verb at a time. Skipping this setup when a same-named port exists means only the profiles belonging to the first initialized UCM verb have working hardware volume control.

Move the volume control setup out of the port initialization block so that we try to do it every time, therefore for every UCM verb. However, check that we don't run it twice for the same UCM verb for a port.

In theory, the PlaybackVolume etc. value can be different per-verb for the same device, so we can't simplify this code to a single volume setup per port.

Signed-off-by: Alper Nebi Yasak alpernebiyasak@gmail.com

Merge request reports

Loading