HDA: introduce HDA and NoACP open arguments

For debugging purposes, it is useful to force a UCM configuration
for all HDA configurations. Note that these arguments are not supposed
to be used as part of the stable UCM API; they are solely for debugging.

Example:

	alsaucm -c "<<<HDA=1,NoACP=1>>>hw:0" dump text

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2026-07-01 16:15:24 +02:00
commit c2d5f60c32
2 changed files with 31 additions and 14 deletions

View file

@ -1,7 +1,7 @@
Syntax 8 Syntax 8
Define.Use "" # a non-empty string to use UCM configuration for HDA devices Define.Use "${var:@HDA}" # a non-empty string to use UCM configuration for HDA devices
Define.Done "" # a non-empty string to skip the end error Define.Done "" # a non-empty string to skip the end error
Define.AcpCardId "$${find-card:field=name,return=id,regex='^acp(|6[23x]|-pdm-mach)$'}" Define.AcpCardId "$${find-card:field=name,return=id,regex='^acp(|6[23x]|-pdm-mach)$'}"
Define.MicType "hda" Define.MicType "hda"
@ -24,9 +24,15 @@ If.acp {
Type String Type String
Empty "${var:AcpCardId}" Empty "${var:AcpCardId}"
} }
False { False.If.noacp {
Define.Use y Condition {
Define.MicType "acp" Type String
Empty "${var:@NoACP}"
}
True {
Define.Use y
Define.MicType "acp"
}
} }
} }
@ -49,14 +55,24 @@ If.use {
Control "name='Master Playback Switch'" Control "name='Master Playback Switch'"
} }
True { True {
Include.led.File "/common/ctl/led.conf"
Include.init.File "/HDA/init.conf" Include.init.File "/HDA/init.conf"
Macro [ If.acp {
{ CtlNew { Arg="name='Mic ACP LED Capture Switch' type=bool,count=1 off" } } Condition {
{ SetLED { LED="mic" Action="attach" CtlId="Mic ACP LED Capture Switch" } } Type String
{ SetLED { LED="mic" Action="detach" CtlId="Capture Switch" } } String1 "${var:MicType}"
] String2 "acp"
}
True {
Include.led.File "/common/ctl/led.conf"
Macro [
{ CtlNew { Arg="name='Mic ACP LED Capture Switch' type=bool,count=1 off" } }
{ SetLED { LED="mic" Action="attach" CtlId="Mic ACP LED Capture Switch" } }
{ SetLED { LED="mic" Action="detach" CtlId="Capture Switch" } }
]
}
}
} }
} }
} }

View file

@ -17,10 +17,11 @@ If.analog {
If.acp { If.acp {
Condition { Condition {
Type String Type String
Empty "${var:AcpCardId}" String1 "${var:MicType}"
String2 "acp"
} }
True.Include.analog.File "/HDA/HiFi-analog.conf" False.Include.analog.File "/HDA/HiFi-analog.conf"
False.Include { True.Include {
acp.File "/HDA/HiFi-acp.conf" acp.File "/HDA/HiFi-acp.conf"
analog.File "/HDA/HiFi-analog.conf" analog.File "/HDA/HiFi-analog.conf"
} }