]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
HDA: introduce HDA and NoACP open arguments
authorJaroslav Kysela <perex@perex.cz>
Wed, 1 Jul 2026 14:15:24 +0000 (16:15 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 1 Jul 2026 14:15:27 +0000 (16:15 +0200)
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>
ucm2/HDA/HDA.conf
ucm2/HDA/HiFi.conf

index 0069ef4c984d63b42247cf595476c83cdd468568..4b189d390965e1b95f2f8a045ca891dc708155a4 100644 (file)
@@ -1,7 +1,7 @@
 Syntax 8
 
-Define.Use ""  # a non-empty string to use UCM configuration for HDA devices
-Define.Done "" # a non-empty string to skip the end error
+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.AcpCardId "$${find-card:field=name,return=id,regex='^acp(|6[23x]|-pdm-mach)$'}"
 Define.MicType "hda"
@@ -24,9 +24,15 @@ If.acp {
                Type String
                Empty "${var:AcpCardId}"
        }
-       False {
-               Define.Use y
-               Define.MicType "acp"
+       False.If.noacp {
+               Condition {
+                       Type String
+                       Empty "${var:@NoACP}"
+               }
+               True {
+                       Define.Use y
+                       Define.MicType "acp"
+               }
        }
 }
 
@@ -49,14 +55,24 @@ If.use {
                                Control "name='Master Playback Switch'"
                        }
                        True {
-                               Include.led.File "/common/ctl/led.conf"
                                Include.init.File "/HDA/init.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" } }
-                               ]
+                               If.acp {
+                                       Condition {
+                                               Type String
+                                               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" } }
+                                               ]
+                                       }
+                               }
                        }
                }
        }
index 9e567f6975852d70562407ede5918ca33b2d74b4..61937db744721ae8ddae5490b8b859ebc1054317 100644 (file)
@@ -17,10 +17,11 @@ If.analog {
                If.acp {
                        Condition {
                                Type String
-                               Empty "${var:AcpCardId}"
+                               String1 "${var:MicType}"
+                               String2 "acp"
                        }
-                       True.Include.analog.File "/HDA/HiFi-analog.conf"
-                       False.Include {
+                       False.Include.analog.File "/HDA/HiFi-analog.conf"
+                       True.Include {
                                acp.File "/HDA/HiFi-acp.conf"
                                analog.File "/HDA/HiFi-analog.conf"
                        }