diff mbox series

[v2] ucm2: hdadsp: add basic ucm config

Message ID 20200313110018.5145-1-mateusz.gorski@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [v2] ucm2: hdadsp: add basic ucm config | expand

Commit Message

Gorski, Mateusz March 13, 2020, 11 a.m. UTC
Basic UCM configuration for Intel Skylake SST HDA DSP generic machine
driver enabling codec playback and capture on both HDA codec and DMIC 
ports.

Signed-off-by: Mateusz Gorski <mateusz.gorski@linux.intel.com>
---

Changes in v2:
- addressed Jaroslav hints about v1 patch
- added HiFi and Hdmi use cases
- adjusted to ucm2 syntax

 ucm2/hdadsp/Hdmi1.conf  | 24 +++++++++++
 ucm2/hdadsp/Hdmi2.conf  | 24 +++++++++++
 ucm2/hdadsp/HiFi.conf   | 88 +++++++++++++++++++++++++++++++++++++++++
 ucm2/hdadsp/hdadsp.conf | 21 ++++++++++
 4 files changed, 157 insertions(+)
 create mode 100644 ucm2/hdadsp/Hdmi1.conf
 create mode 100644 ucm2/hdadsp/Hdmi2.conf
 create mode 100644 ucm2/hdadsp/HiFi.conf
 create mode 100644 ucm2/hdadsp/hdadsp.conf

Comments

Jaroslav Kysela March 13, 2020, 11:24 a.m. UTC | #1
Dne 13. 03. 20 v 12:00 Mateusz Gorski napsal(a):
> Basic UCM configuration for Intel Skylake SST HDA DSP generic machine
> driver enabling codec playback and capture on both HDA codec and DMIC
> ports.
> 
> Signed-off-by: Mateusz Gorski <mateusz.gorski@linux.intel.com>
> ---

...

> +SectionDevice."Headphones" {
> +	Comment "Headphones"
> +
> +	ConflictingDevice [
> +		"Speaker"
> +	]
> +
> +	EnableSequence [
> +		cset "name='Headphone Playback Switch' 1,1"
> +		cset "name='Speaker Playback Switch' 0,0"
> +	]
> +
> +	Value [
> +		PlaybackPriority 200
> +		PlaybackPCM "hw:${CardId},7"
> +		JackControl "Front Headphone Jack"
> +		JackHWMute "Speaker"
> +	]
> +}

If there is a volume control, it should be defined via PlaybackMixerElem (like 
PlaybackMixerElem "Headphone").

> +ValueDefaults {
> +        PlaybackChannels "2"
> +        CaptureChannels "2"
> +}

This ValueDefaults {} section with this contents should be removed. The stereo 
is the default settings.

						Jaroslav
Gorski, Mateusz March 17, 2020, 11:46 a.m. UTC | #2
>> Basic UCM configuration for Intel Skylake SST HDA DSP generic machine
>> driver enabling codec playback and capture on both HDA codec and DMIC
>> ports.
>>
>> Signed-off-by: Mateusz Gorski <mateusz.gorski@linux.intel.com>
>> ---
>
> ...
>
>> +SectionDevice."Headphones" {
>> +    Comment "Headphones"
>> +
>> +    ConflictingDevice [
>> +        "Speaker"
>> +    ]
>> +
>> +    EnableSequence [
>> +        cset "name='Headphone Playback Switch' 1,1"
>> +        cset "name='Speaker Playback Switch' 0,0"
>> +    ]
>> +
>> +    Value [
>> +        PlaybackPriority 200
>> +        PlaybackPCM "hw:${CardId},7"
>> +        JackControl "Front Headphone Jack"
>> +        JackHWMute "Speaker"
>> +    ]
>> +}
>
> If there is a volume control, it should be defined via 
> PlaybackMixerElem (like PlaybackMixerElem "Headphone").


Thanks, added in v3.


>
>> +ValueDefaults {
>> +        PlaybackChannels "2"
>> +        CaptureChannels "2"
>> +}
>
> This ValueDefaults {} section with this contents should be removed. 
> The stereo is the default settings.
>
>                         Jaroslav
>

Thanks, removed in v3.
diff mbox series

Patch

diff --git a/ucm2/hdadsp/Hdmi1.conf b/ucm2/hdadsp/Hdmi1.conf
new file mode 100644
index 0000000..d402dab
--- /dev/null
+++ b/ucm2/hdadsp/Hdmi1.conf
@@ -0,0 +1,24 @@ 
+# Usecase for device HDMI1/Display Port stereo playback on Intel cAVS platforms
+# For Audio in HDA mode
+
+SectionDevice."HDMI1" {
+        Comment "HDMI/Display Port 1 Stereo"
+
+        Value {
+                PlaybackPriority 300
+                PlaybackPCM "hw:${CardId},10"
+                If.1 {
+                        Condition {
+                                Type ControlExists
+                                Control "iface=CARD,name='HDMI/DP,pcm=17 Jack'"
+                        }
+                        True {
+                                JackControl "HDMI/DP,pcm=17 Jack"
+                        }
+                        False {
+                                JackControl "HDMI/DP, pcm=17 Jack"
+                        }
+                }
+        }
+}
+
diff --git a/ucm2/hdadsp/Hdmi2.conf b/ucm2/hdadsp/Hdmi2.conf
new file mode 100644
index 0000000..153bbe1
--- /dev/null
+++ b/ucm2/hdadsp/Hdmi2.conf
@@ -0,0 +1,24 @@ 
+# Usecase for device HDMI2/Display Port stereo playback on Intel cAVS platforms
+# For Audio in HDA mode
+
+SectionDevice."HDMI2" {
+        Comment "HDMI/Display Port 2 Stereo"
+
+        Value {
+                PlaybackPriority 400
+                PlaybackPCM "hw:${CardId},11"
+                If.1 {
+                        Condition {
+                                Type ControlExists
+                                Control "iface=CARD,name='HDMI/DP,pcm=18 Jack'"
+                        }
+                        True {
+                                JackControl "HDMI/DP,pcm=18 Jack"
+                        }
+                        False {
+                                JackControl "HDMI/DP, pcm=18 Jack"
+                        }
+                }
+        }
+}
+
diff --git a/ucm2/hdadsp/HiFi.conf b/ucm2/hdadsp/HiFi.conf
new file mode 100644
index 0000000..fe025de
--- /dev/null
+++ b/ucm2/hdadsp/HiFi.conf
@@ -0,0 +1,88 @@ 
+# Usecase for stereo playback Speaker and Headset, Recording on DMIC and Headset MIC.
+# For Audio in HDA mode on Intel cAVS platforms
+
+SectionVerb {
+
+	EnableSequence [
+		cset "name='mch_cap_out mo mch_cap_in mi Switch' 1"
+	]
+
+	Value {
+		TQ "HiFi"
+	}
+}
+
+SectionDevice."Headphones" {
+	Comment "Headphones"
+
+	ConflictingDevice [
+		"Speaker"
+	]
+
+	EnableSequence [
+		cset "name='Headphone Playback Switch' 1,1"
+		cset "name='Speaker Playback Switch' 0,0"
+	]
+
+	Value [
+		PlaybackPriority 200
+		PlaybackPCM "hw:${CardId},7"
+		JackControl "Front Headphone Jack"
+		JackHWMute "Speaker"
+	]
+}
+
+SectionDevice."Speaker" {
+	Comment "Speaker"
+
+	ConflictingDevice [
+		"Headphones"
+	]
+
+	EnableSequence [
+		cset "name='Headphone Playback Switch' 0,0"
+		cset "name='Speaker Playback Switch' 1,1"
+	]
+
+	Value {
+		PlaybackPriority 100
+		PlaybackPCM "hw:${CardId},7"
+	}
+}
+
+SectionDevice."Headset" {
+	Comment "Headset Microphone"
+
+	ConflictingDevice [
+		"Mic"
+	]
+
+	EnableSequence [
+		cset "name='media0_out mo codec0_in mi Switch' 1"
+	]
+
+	Value {
+		CapturePriority 200
+		CapturePCM "hw:${CardId},7"
+	}
+}
+
+SectionDevice."Mic" {
+	Comment "Digital Microphone"
+
+	ConflictingDevice [
+		"Headset"
+	]
+
+	EnableSequence [
+		cset "name='mch_cap_out mo mch_cap_in mi Switch' 1"
+	]
+
+	Value {
+		CapturePriority 100
+		CapturePCM "hw:${CardId},13"
+	}
+}
+
+<hdadsp/Hdmi1.conf>
+<hdadsp/Hdmi2.conf>
diff --git a/ucm2/hdadsp/hdadsp.conf b/ucm2/hdadsp/hdadsp.conf
new file mode 100644
index 0000000..a90299f
--- /dev/null
+++ b/ucm2/hdadsp/hdadsp.conf
@@ -0,0 +1,21 @@ 
+# UCM for Intel CAVS platforms
+# For Audio in HDA and DMIC mode
+
+Syntax 2
+
+SectionUseCase."HiFi" {
+        File "HiFi.conf"
+        Comment "Play HiFi quality Music"
+}
+
+ValueDefaults {
+        PlaybackChannels "2"
+        CaptureChannels "2"
+}
+
+SectionDefaults [
+	cset "name='Master Playback Switch' 1"
+        cset "name='codec0_out mo media0_in mi Switch' 1"
+        cset "name='media0_out mo codec0_in mi Switch' 1"
+	cset "name='mch_cap_out mo mch_cap_in mi Switch' 1"
+]