Re: [PATCH] ALSA: hda/generic: Use "Input Source" for the capture source selector

From: songxiebing

Date: Tue Oct 27 2026 - 04:41:34 EST


>>If that's true, PA is broken for all other AC97-based PCI cards?
>>Let's verify the PA behavior more at first.
>>
>>
>>Takashi
>
>Ok,i will take me quite a while to verify this.
>
>Thanks,
>Bob

Hi Takashi,

We verified the PulseAudio behavior, and you are right -- PulseAudio does
handle the split "Capture Source" control. My earlier claim was wrong, so
please disregard that part (and the patch).

What actually happens:

- alsa-lib exposes a control named "Capture Source" as one exclusive
capture switch per enum item, named after the item (Mic, Line, ...).
- PulseAudio's input paths match those per-item elements directly, e.g.
[Element Line] with "switch = mute" on the line-in path and
"switch = off" on the other paths (analog-input-*.conf). So the split
control is usable as-is; PulseAudio does not need
snd_mixer_selem_has_capture_switch_exclusive(), because writing such a
switch makes alsa-lib update the underlying "Capture Source" enum.

The reason it did not switch to Line on our machine was simply the mute
state of the source:

- PulseAudio restored the source's mute state as "muted"
(module-device-restore).
- pa_alsa_path_set_mute() then writes the per-item switches with !muted,
i.e. it sets [Element Line] to off.
- Turning an exclusive capture switch off does not write the enum
(alsa-lib only writes the enumerated value for channels whose switch
bit is set), so "Capture Source" keeps its previous value.
- As soon as the source is unmuted, PulseAudio sets [Element Line] to on
and the source switches to Line as expected.

So this is not a kernel/driver naming problem; it's a userspace
mute-state issue, and we will handle it on the userspace side.

Thanks,
Bob