Re: Fwd: [PATCH] ALSA: hda/generic: Add mic autoswitch support for dyn_adc_switch mode

From: Zhang Heng

Date: Mon May 18 2026 - 03:08:22 EST


I set the default control name to "input source" when name is NULL, and made no other changes.
kylin@kylin-pc:~/桌面$ amixer -c1 contents
numid=16,iface=CARD,name='Front Headphone Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off
numid=12,iface=CARD,name='Front Mic Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off
numid=14,iface=CARD,name='Line Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off
numid=15,iface=CARD,name='Line Out Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off
numid=13,iface=CARD,name='Rear Mic Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off
numid=11,iface=MIXER,name='Master Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
numid=10,iface=MIXER,name='Master Playback Volume'
; type=INTEGER,access=rw---R--,values=1,min=0,max=80,step=0
: values=52
| dBscale-min=-80.00dB,step=1.00dB,mute=0
numid=4,iface=MIXER,name='Headphone Playback Switch'
; type=BOOLEAN,access=rw------,values=2
: values=on,on
numid=3,iface=MIXER,name='Headphone Playback Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=80,step=0
: values=80,80
| dBscale-min=-80.00dB,step=1.00dB,mute=0
numid=19,iface=MIXER,name='PCM Playback Volume'
; type=INTEGER,access=rw---RW-,values=2,min=0,max=255,step=0
: values=255,255
| dBscale-min=-51.00dB,step=0.20dB,mute=0
numid=2,iface=MIXER,name='Line Out Playback Switch'
; type=BOOLEAN,access=rw------,values=2
: values=off,off
numid=1,iface=MIXER,name='Line Out Playback Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=80,step=0
: values=0,0
| dBscale-min=-80.00dB,step=1.00dB,mute=0
numid=9,iface=MIXER,name='Capture Switch'
; type=BOOLEAN,access=rw------,values=2
: values=on,on
numid=8,iface=MIXER,name='Capture Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=80,step=0
: values=80,80
| dBscale-min=-74.00dB,step=1.00dB,mute=0
numid=5,iface=MIXER,name='Loopback Mixing'
; type=ENUMERATED,access=rw------,values=1,items=2
; Item #0 'Disabled'
; Item #1 'Enabled'
: values=0
numid=6,iface=MIXER,name='Auto-Mute Mode'
; type=ENUMERATED,access=rw------,values=1,items=2
; Item #0 'Disabled'
; Item #1 'Enabled'
: values=1
numid=7,iface=MIXER,name='Input Source'
; type=ENUMERATED,access=rw------,values=1,items=3
; Item #0 'Front Mic'
; Item #1 'Rear Mic'
; Item #2 'Line'
: values=0
numid=18,iface=PCM,name='Capture Channel Map'
; type=INTEGER,access=r----R--,values=2,min=0,max=36,step=0
: values=0,0
| container
| chmap-fixed=FL,FR
numid=17,iface=PCM,name='Playback Channel Map'
; type=INTEGER,access=r----R--,values=2,min=0,max=36,step=0
: values=0,0
| container
| chmap-fixed=FL,FR
kylin@kylin-pc:~/桌面$

kylin@kylin-pc:~/桌面$
kylin@kylin-pc:~/桌面$ amixer -c1 controls
numid=16,iface=CARD,name='Front Headphone Jack'
numid=12,iface=CARD,name='Front Mic Jack'
numid=14,iface=CARD,name='Line Jack'
numid=15,iface=CARD,name='Line Out Jack'
numid=13,iface=CARD,name='Rear Mic Jack'
numid=11,iface=MIXER,name='Master Playback Switch'
numid=10,iface=MIXER,name='Master Playback Volume'
numid=4,iface=MIXER,name='Headphone Playback Switch'
numid=3,iface=MIXER,name='Headphone Playback Volume'
numid=19,iface=MIXER,name='PCM Playback Volume'
numid=2,iface=MIXER,name='Line Out Playback Switch'
numid=1,iface=MIXER,name='Line Out Playback Volume'
numid=9,iface=MIXER,name='Capture Switch'
numid=8,iface=MIXER,name='Capture Volume'
numid=5,iface=MIXER,name='Loopback Mixing'
numid=6,iface=MIXER,name='Auto-Mute Mode'
numid=7,iface=MIXER,name='Input Source'
numid=18,iface=PCM,name='Capture Channel Map'
numid=17,iface=PCM,name='Playback Channel Map'
kylin@kylin-pc:~/桌面$

kylin@kylin-pc:~/桌面$ amixer -c1 scontents
Simple mixer control 'Master',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 80
Mono: Playback 52 [65%] [-28.00dB] [on]
Simple mixer control 'Headphone',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 80
Mono:
Front Left: Playback 80 [100%] [0.00dB] [on]
Front Right: Playback 80 [100%] [0.00dB] [on]
Simple mixer control 'PCM',0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 255 [100%] [0.00dB]
Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Line Out',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 80
Mono:
Front Left: Playback 0 [0%] [-80.00dB] [off]
Front Right: Playback 0 [0%] [-80.00dB] [off]
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 80
Front Left: Capture 80 [100%] [6.00dB] [on]
Front Right: Capture 80 [100%] [6.00dB] [on]
Simple mixer control 'Auto-Mute Mode',0
Capabilities: enum
Items: 'Disabled' 'Enabled'
Item0: 'Enabled'
Simple mixer control 'Input Source',0
Capabilities: cenum
Items: 'Front Mic' 'Rear Mic' 'Line'
Item0: 'Front Mic'
Simple mixer control 'Loopback Mixing',0
Capabilities: enum
Items: 'Disabled' 'Enabled'
Item0: 'Disabled'
kylin@kylin-pc:~/桌面$

kylin@kylin-pc:~/桌面$ amixer -c1 scontrols
Simple mixer control 'Master',0
Simple mixer control 'Headphone',0
Simple mixer control 'PCM',0
Simple mixer control 'Line Out',0
Simple mixer control 'Capture',0
Simple mixer control 'Auto-Mute Mode',0
Simple mixer control 'Input Source',0
Simple mixer control 'Loopback Mixing',0
kylin@kylin-pc:~/桌面$