]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
UMC204HD: Add PCM control autodetection
authorJaroslav Kysela <perex@perex.cz>
Sat, 25 Jun 2022 06:24:56 +0000 (08:24 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sat, 25 Jun 2022 06:26:23 +0000 (08:26 +0200)
The USB driver has two variants for the PCM control
names:

  UMC204HD 192k Output Playback Switch / Volume
    and
  PCM Playback Switch / Volume

BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/177
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf

index 1fa10c66e236accc0bf9c8adf10b4512ee172e25..ae0f477bf79a9e81c9c0f9a6bcf817e50a85a922 100644 (file)
@@ -25,13 +25,23 @@ Macro [
        }
 ]
 
+Define.PCMCTLName "PCM Playback"
+
+If.pcm_controls {
+       Condition {
+               Type ControlExists
+               Control "name='UMC204HD 192k Output Playback Switch'"
+       }
+       True.Define.PCMCTLName "UMC204HD 192k Output Playback"
+}
+
 Include.ctl_remap.File "/common/ctl/remap.conf"
 
 Macro [
        {
                CtlRemapStereoVolSw {
                        Dst "Line A Playback"
-                       Src "UMC204HD 192k Output Playback"
+                       Src "${var:PCMCTLName}"
                        Index0 0
                        Index1 1
                }
@@ -39,7 +49,7 @@ Macro [
        {
                CtlRemapStereoVolSw {
                        Dst "Line B Playback"
-                       Src "UMC204HD 192k Output Playback"
+                       Src "${var:PCMCTLName}"
                        Index0 2
                        Index1 3
                }