Skip to content

alsa-mixer: store the ucm_device with the order of their priority

Hui Wang requested to merge jason77wang/pulseaudio:reorder_ucm_device into master

There is some case that multiple ucm devices share an amixer Jack like "Headphones", "Headset" and "Mic2" share the "Headphone Mic Jack", When the Jack state is changed, the module-switch-on-port-available will process them in the order they are in the jack->ucm_devices, and the last device will decide the final setting.

But usually users put priority for those devices and expect the final setting is based on the highest priority device if there is no other policies like manual selection. So here do some change to store the ucm_devices according to their priority (from low to high).

For example, we have ucm devices definition like below (ucm2):

           SectionDevice."Mic2" {
                    Comment "Headphones Stereo Microphone"
		...
                    Value {
                            CapturePriority 200
			...
            }

            SectionDevice."Headset" {
                    Comment "Headset Mono Microphone"
		...
                    Value {
                            CapturePriority 300
			...
                    }
            }

Without this patch, the final setting is based on Mic2, after applying this patch, the final setting is based on the Headset (with higher priority than Mic2).

Signed-off-by: Hui Wang hui.wang@canonical.com

Edited by Hui Wang

Merge request reports