]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
HDA-Intel: add support for AMD acp microphone devices
authorJaroslav Kysela <perex@perex.cz>
Wed, 24 Jun 2020 11:39:07 +0000 (13:39 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 25 Jun 2020 13:30:28 +0000 (15:30 +0200)
- move the generic HDA code from sof-hda-dsp to HDA-Intel
- add generic codecs/hda/hdmi.conf

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
12 files changed:
ucm2/HDA-Intel/HDA-Capture-value.conf [moved from ucm2/sof-hda-dsp/HDA-Capture-value.conf with 100% similarity]
ucm2/HDA-Intel/HDA-Intel.conf [new file with mode: 0644]
ucm2/HDA-Intel/Hdmi.conf [new file with mode: 0644]
ucm2/HDA-Intel/HiFi-acp.conf [new file with mode: 0644]
ucm2/HDA-Intel/HiFi-analog.conf [new file with mode: 0644]
ucm2/HDA-Intel/HiFi.conf [new file with mode: 0644]
ucm2/HDA-Intel/init.conf [new file with mode: 0644]
ucm2/codecs/hda/hdmi.conf [new file with mode: 0644]
ucm2/module/lib/linked.conf [new file with mode: 0644]
ucm2/module/snd_acp3x_rn.conf [new symlink]
ucm2/sof-hda-dsp/Hdmi.conf
ucm2/sof-hda-dsp/HiFi.conf

diff --git a/ucm2/HDA-Intel/HDA-Intel.conf b/ucm2/HDA-Intel/HDA-Intel.conf
new file mode 100644 (file)
index 0000000..109eea6
--- /dev/null
@@ -0,0 +1,28 @@
+Syntax 3
+
+Define.Use ""  # a non-empty string to use UCM configuration for HDA devices
+
+Define.AcpCardId "$${CardIdByName:acp}"
+
+If.acp {
+       Condition {
+               Type String
+               Empty "${var:AcpCardId}"
+       }
+       False.Define.Use y
+}
+
+If.use {
+       Condition {
+               Type String
+               Empty "${var:Use}"
+       }
+       False {
+               SectionUseCase."HiFi" {
+                       File "HiFi.conf"
+                       Comment "Play HiFi quality Music"
+               }
+
+               Include.init.File "/HDA-Intel/init.conf"
+       }
+}
diff --git a/ucm2/HDA-Intel/Hdmi.conf b/ucm2/HDA-Intel/Hdmi.conf
new file mode 100644 (file)
index 0000000..8b1843b
--- /dev/null
@@ -0,0 +1,37 @@
+# Use case Configuration for sof-hda-dsp
+
+If.hdmi1 {
+       Condition { Type String Empty "" }
+       True {
+               Define {
+                       HdmiNum 1
+                       HdmiPCM 3
+                       HdmiPrio 500
+               }
+               Include.hdmi1.File "/codecs/hda/hdmi.conf"
+       }
+}
+
+If.hdmi2 {
+       Condition { Type String Empty "" }
+       True {
+               Define {
+                       HdmiNum 2
+                       HdmiPCM 7
+                       HdmiPrio 600
+               }
+               Include.hdmi2.File "/codecs/hda/hdmi.conf"
+       }
+}
+
+If.hdmi3 {
+       Condition { Type String Empty "" }
+       True {
+               Define {
+                       HdmiNum 3
+                       HdmiPCM 8
+                       HdmiPrio 700
+               }
+               Include.hdmi3.File "/codecs/hda/hdmi.conf"
+       }
+}
diff --git a/ucm2/HDA-Intel/HiFi-acp.conf b/ucm2/HDA-Intel/HiFi-acp.conf
new file mode 100644 (file)
index 0000000..123ae15
--- /dev/null
@@ -0,0 +1,8 @@
+SectionDevice."Mic1" {
+       Comment "Digital Microphone"
+
+       Value {
+               CapturePriority 100
+               CapturePCM "hw:${var:AcpCardId}"
+       }
+}
diff --git a/ucm2/HDA-Intel/HiFi-analog.conf b/ucm2/HDA-Intel/HiFi-analog.conf
new file mode 100644 (file)
index 0000000..1143a67
--- /dev/null
@@ -0,0 +1,133 @@
+# Generic HDA devices for analog I/O
+
+SectionDevice."Headphones" {
+       Comment "Headphones"
+
+       If.headphone_switch {
+               Condition {
+                       Type ControlExists
+                       Control "name='Headphone Playback Switch'"
+               }
+               True {
+                       EnableSequence [
+                               cset "name='Headphone Playback Switch' on"
+                       ]
+                       DisableSequence [
+                               cset "name='Headphone Playback Switch' off"
+                       ]
+               }
+       }
+
+       Value {
+               PlaybackPriority 200
+               PlaybackPCM "hw:${CardId}"
+               PlaybackMixerElem "Headphone"
+               PlaybackMasterElem "Master"
+               PlaybackVolume "Headphone Playback Volume"
+               PlaybackSwitch "Headphone Playback Switch"
+               If.jack {
+                       Condition {
+                               Type ControlExists
+                               Control "iface=CARD,name='Headphone Mic Jack'"
+                       }
+                       True {
+                               JackControl "Headphone Mic Jack"
+                       }
+                       False {
+                               JackControl "Headphone Jack"
+                       }
+               }
+       }
+}
+
+SectionDevice."Speaker" {
+       Comment "Speaker"
+
+       If.seq {
+               Condition {
+                       Type ControlExists
+                       Control "name='Bass Speaker Playback Switch'"
+               }
+               True {
+                       EnableSequence [
+                               cset "name='Speaker Playback Switch' on"
+                               cset "name='Bass Speaker Playback Switch' on"
+                       ]
+
+                       DisableSequence [
+                               cset "name='Speaker Playback Switch' off"
+                               cset "name='Bass Speaker Playback Switch' off"
+                       ]
+               }
+               False {
+                       EnableSequence [
+                               cset "name='Speaker Playback Switch' on"
+                       ]
+
+                       DisableSequence [
+                               cset "name='Speaker Playback Switch' off"
+                       ]
+               }
+       }
+
+       Value {
+               PlaybackPriority 100
+               PlaybackPCM "hw:${CardId}"
+               PlaybackMixerElem "Speaker"
+               PlaybackMasterElem "Master"
+               PlaybackVolume "Speaker Playback Volume"
+               PlaybackSwitch "Speaker Playback Switch"
+       }
+}
+
+If.monomic {
+       Condition {
+               Type ControlExists
+               Control "name='Input Source'"
+               ControlEnum "Headphone Mic"
+       }
+       True {
+               SectionDevice."Mic2" {
+                       Comment "Headphones Stereo Microphone"
+
+                       ConflictingDevice [
+                               "Headset"
+                       ]
+
+                       EnableSequence [
+                               cset "name='Input Source' 'Headphone Mic'"
+                       ]
+
+                       Value {
+                               CapturePriority 200
+                               Include.value.File "/HDA-Intel/HDA-Capture-value.conf"
+                               JackControl "Headphone Mic Jack"
+                       }
+               }
+
+               SectionDevice."Headset" {
+                       Comment "Headset Mono Microphone"
+
+                       EnableSequence [
+                               cset "name='Input Source' 'Headset Mic'"
+                       ]
+
+                       Value {
+                               CapturePriority 300
+                               Include.value.File "/HDA-Intel/HDA-Capture-value.conf"
+                               JackControl "Headphone Mic Jack"
+                       }
+               }
+       }
+       False {
+               SectionDevice."Mic2" {
+                       Comment "Headphones Stereo Microphone"
+
+                       Value {
+                               CapturePriority 200
+                               Include.value.File "/HDA-Intel/HDA-Capture-value.conf"
+                               JackControl "Mic Jack"
+                       }
+               }
+       }
+}
diff --git a/ucm2/HDA-Intel/HiFi.conf b/ucm2/HDA-Intel/HiFi.conf
new file mode 100644 (file)
index 0000000..2d18c9e
--- /dev/null
@@ -0,0 +1,32 @@
+# Use case Configuration for sof-hda-dsp
+
+SectionVerb {
+       Value.TQ "HiFi"
+}
+
+If.analog {
+       Condition {
+               Type ControlExists
+               Control "name='Master Playback Switch'"
+       }
+       True.Include.analog.File "/HDA-Intel/HiFi-analog.conf"
+}
+
+If.hdmi {
+       Condition { Type String Empty "" }
+       True.Include.hdmi.File "/HDA-Intel/Hdmi.conf"
+}
+
+If.acp {
+       Condition {
+               Type String
+               Empty "${var:AcpCardId}"
+       }
+       True {
+               RenameDevice."Mic1" "Mic"
+       }
+       False.Include.acp {
+               Before.SectionDevice "Mic1"
+               File "/HDA-Intel/HiFi-acp.conf"
+       }
+}
diff --git a/ucm2/HDA-Intel/init.conf b/ucm2/HDA-Intel/init.conf
new file mode 100644 (file)
index 0000000..1a351a9
--- /dev/null
@@ -0,0 +1,39 @@
+If.amute {
+       Condition {
+               Type ControlExists
+               Control "name='Auto-Mute Mode'"
+       }
+       True.BootSequence [
+               cset "name='Auto-Mute Mode' off"
+       ]
+}
+
+If.master {
+       Condition {
+               Type ControlExists
+               Control "name='Master Playback Volume'"
+       }
+       True.BootSequence [
+               cset "name='Master Playback Volume' 60%"
+       ]
+}
+
+If.speaker {
+       Condition {
+               Type ControlExists
+               Control "name='Speaker Playback Volume'"
+       }
+       True.BootSequence [
+               cset "name='Speaker Playback Volume' 60%"
+       ]
+}
+
+If.headphone {
+       Condition {
+               Type ControlExists
+               Control "name='Headphone Playback Volume'"
+       }
+       True.BootSequence [
+               cset "name='Headphone Playback Volume' 60%"
+       ]
+}
diff --git a/ucm2/codecs/hda/hdmi.conf b/ucm2/codecs/hda/hdmi.conf
new file mode 100644 (file)
index 0000000..c22f615
--- /dev/null
@@ -0,0 +1,25 @@
+If.hdmi {
+       Condition {
+               Type ControlExists
+               Control "iface=CARD,name='HDMI/DP,pcm=${var:HdmiPCM} Jack'"
+       }
+       True {
+               SectionDevice."HDMI${var:HdmiNum}" {
+                       Comment "HDMI${var:HdmiNum}/${var:HdmiNum} Output"
+
+                       EnableSequence [
+                               cset "name='IEC958 Playback Switch' on"
+                       ]
+
+                       DisableSequence [
+                               cset "name='IEC958 Playback Switch' off"
+                       ]
+
+                       Value {
+                               PlaybackPriority "${var:HdmiPrio}"
+                               PlaybackPCM "hw:${CardId},${var:HdmiPCM}"
+                               JackControl "HDMI/DP,pcm=${var:HdmiPCM} Jack"
+                       }
+               }
+       }
+}
diff --git a/ucm2/module/lib/linked.conf b/ucm2/module/lib/linked.conf
new file mode 100644 (file)
index 0000000..d7656a8
--- /dev/null
@@ -0,0 +1,3 @@
+ValueDefaults {
+       Linked 1
+}
diff --git a/ucm2/module/snd_acp3x_rn.conf b/ucm2/module/snd_acp3x_rn.conf
new file mode 120000 (symlink)
index 0000000..b56794a
--- /dev/null
@@ -0,0 +1 @@
+lib/linked.conf
\ No newline at end of file
index 6f2c4aa99db2d8d8f34185eda66925d8bdf51ed9..480e2d6f4203f9f7059163ec9c0fe2e59c6d9042 100644 (file)
@@ -1,79 +1,37 @@
 # Use case Configuration for sof-hda-dsp
 
 If.hdmi1 {
-       Condition {
-               Type ControlExists
-               Control "iface=CARD,name='HDMI/DP,pcm=3 Jack'"
-       }
+       Condition { Type String Empty "" }
        True {
-               SectionDevice."HDMI1" {
-                       Comment "HDMI1/DP1 Output"
-
-                       EnableSequence [
-                               cset "name='IEC958 Playback Switch' on"
-                       ]
-
-                       DisableSequence [
-                               cset "name='IEC958 Playback Switch' off"
-                       ]
-
-                       Value {
-                               PlaybackPriority 500
-                               PlaybackPCM "hw:${CardId},3"
-                               JackControl "HDMI/DP,pcm=3 Jack"
-                       }
+               Define {
+                       HdmiNum 1
+                       HdmiPCM 3
+                       HdmiPrio 500
                }
+               Include.hdmi1.File "/codec/hda/hdmi.conf"
        }
 }
 
 If.hdmi2 {
-       Condition {
-               Type ControlExists
-               Control "iface=CARD,name='HDMI/DP,pcm=4 Jack'"
-       }
+       Condition { Type String Empty "" }
        True {
-               SectionDevice."HDMI2" {
-                       Comment "HDMI2/DP2 Output"
-
-                       EnableSequence [
-                               cset "name='IEC958 Playback Switch',index=1 on"
-                       ]
-
-                       DisableSequence [
-                               cset "name='IEC958 Playback Switch',index=1 off"
-                       ]
-
-                       Value {
-                               PlaybackPriority 600
-                               PlaybackPCM "hw:${CardId},4"
-                               JackControl "HDMI/DP,pcm=4 Jack"
-                       }
+               Define {
+                       HdmiNum 2
+                       HdmiPCM 4
+                       HdmiPrio 600
                }
+               Include.hdmi2.File "/codec/hda/hdmi.conf"
        }
 }
 
 If.hdmi3 {
-       Condition {
-               Type ControlExists
-               Control "iface=CARD,name='HDMI/DP,pcm=5 Jack'"
-       }
+       Condition { Type String Empty "" }
        True {
-               SectionDevice."HDMI3" {
-                       Comment "HDMI3/DP3 Output"
-
-                       EnableSequence [
-                               cset "name='IEC958 Playback Switch',index=2 on"
-                       ]
-
-                       DisableSequence [
-                               cset "name='IEC958 Playback Switch',index=2 off"
-                       ]
-
-                       Value {
-                               PlaybackPriority 700
-                               PlaybackPCM "hw:${CardId},5"
-                               JackControl "HDMI/DP,pcm=5 Jack"
-                       }
+               Define {
+                       HdmiNum 3
+                       HdmiPCM 5
+                       HdmiPrio 700
                }
+               Include.hdmi3.File "/codec/hda/hdmi.conf"
        }
 }
index 62358e26edb5c5f87f233ef68f48cc2dc8bcf35e..0f221b79ce217c468df3137668be85da39427012 100644 (file)
@@ -4,138 +4,9 @@ SectionVerb {
        Value.TQ "HiFi"
 }
 
-SectionDevice."Headphones" {
-       Comment "Headphones"
+<HDA-Intel/HiFi-analog.conf>
 
-       If.headphone_switch {
-               Condition {
-                       Type ControlExists
-                       Control "name='Headphone Playback Switch'"
-               }
-               True {
-                       EnableSequence [
-                               cset "name='Headphone Playback Switch' on"
-                       ]
-                       DisableSequence [
-                               cset "name='Headphone Playback Switch' off"
-                       ]
-               }
-       }
-
-       Value {
-               PlaybackPriority 200
-               PlaybackPCM "hw:${CardId}"
-               PlaybackMixerElem "Headphone"
-               PlaybackMasterElem "Master"
-               PlaybackVolume "Headphone Playback Volume"
-               PlaybackSwitch "Headphone Playback Switch"
-               If.jack {
-                       Condition {
-                               Type ControlExists
-                               Control "iface=CARD,name='Headphone Mic Jack'"
-                       }
-                       True {
-                               JackControl "Headphone Mic Jack"
-                       }
-                       False {
-                               JackControl "Headphone Jack"
-                       }
-               }
-       }
-}
-
-SectionDevice."Speaker" {
-       Comment "Speaker"
-
-       If.seq {
-               Condition {
-                       Type ControlExists
-                       Control "name='Bass Speaker Playback Switch'"
-               }
-               True {
-                       EnableSequence [
-                               cset "name='Speaker Playback Switch' on"
-                               cset "name='Bass Speaker Playback Switch' on"
-                       ]
-
-                       DisableSequence [
-                               cset "name='Speaker Playback Switch' off"
-                               cset "name='Bass Speaker Playback Switch' off"
-                       ]
-               }
-               False {
-                       EnableSequence [
-                               cset "name='Speaker Playback Switch' on"
-                       ]
-
-                       DisableSequence [
-                               cset "name='Speaker Playback Switch' off"
-                       ]
-               }
-       }
-
-       Value {
-               PlaybackPriority 100
-               PlaybackPCM "hw:${CardId}"
-               PlaybackMixerElem "Speaker"
-               PlaybackMasterElem "Master"
-               PlaybackVolume "Speaker Playback Volume"
-               PlaybackSwitch "Speaker Playback Switch"
-       }
-}
-
-If.monomic {
-       Condition {
-               Type ControlExists
-               Control "name='Input Source'"
-               ControlEnum "Headphone Mic"
-       }
-       After.SectionDevice "Mic1"
-       True {
-               SectionDevice."Mic2" {
-                       Comment "Headphones Stereo Microphone"
-
-                       ConflictingDevice [
-                               "Headset"
-                       ]
-
-                       EnableSequence [
-                               cset "name='Input Source' 'Headphone Mic'"
-                       ]
-
-                       Value {
-                               CapturePriority 200
-                               Include.value.File "HDA-Capture-value.conf"
-                               JackControl "Headphone Mic Jack"
-                       }
-               }
-
-               SectionDevice."Headset" {
-                       Comment "Headset Mono Microphone"
-
-                       EnableSequence [
-                               cset "name='Input Source' Headset Mic"
-                       ]
-
-                       Value {
-                               CapturePriority 300
-                               Include.value.File "HDA-Capture-value.conf"
-                               JackControl "Headphone Mic Jack"
-                       }
-               }
-       }
-       False {
-               SectionDevice."Mic2" {
-                       Comment "Headphones Stereo Microphone"
-
-                       Value {
-                               CapturePriority 200
-                               Include.value.File "HDA-Capture-value.conf"
-                               JackControl "Mic Jack"
-                       }
-               }
-       }
-}
+If.monomic.After.SectionDevice "Mic1"
 
 SectionDevice."Mic1" {
        Comment "Digital Microphone"
@@ -172,4 +43,4 @@ SectionDevice."Mic1" {
        }
 }
 
-<sof-hda-dsp/Hdmi.conf>
+<HDA-Intel/Hdmi.conf>