alsa-ucm-conf/ucm2/sof-soundwire/rt722.conf
Jaroslav Kysela cd342774cd sof-soundwire: cleanups for codecs with multiple functions
The load mechanism assumed only one multi-codec in the system, but
we saw in #774 multiple instances of those codecs (rt1320 and rt713).

Make the load mechanism straight:

- introduce file variables
- remove shadow variables
- probe multi-codecs separately and modify the file variables
- test for duplicate file inclusion (in both sof-soundwire / HiFi configs)
- merge dmic configs for rt712,rt713 to one file

This change also improves filters for speaker/headset/mic init includes.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/775
Link: https://github.com/alsa-project/alsa-ucm-conf/issues/774
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2026-06-12 13:38:30 +02:00

113 lines
2 KiB
Text

# Use case Configuration for sof-soundwire card
If.codecmic {
Condition {
Type RegexMatch
Regex "(rt722(-sdca)?)"
String "${var:MicCodec1}"
}
True {
SectionDevice."Mic" {
Comment "SoundWire microphones"
EnableSequence [
cset "name='rt722 FU1E Capture Switch' 1"
]
DisableSequence [
cset "name='rt722 FU1E Capture Switch' 0"
]
Value {
CapturePriority 100
CapturePCM "hw:${CardId},4"
CaptureSwitch "rt722 FU1E Capture Switch"
CaptureVolume "rt722 FU1E Capture Volume"
CaptureMixerElem "rt722 FU1E"
}
}
}
}
If.codecspk {
Condition {
Type RegexMatch
Regex "(rt722(-sdca)?)"
String "${var:SpeakerCodec1}"
}
True {
SectionDevice."Speaker" {
Comment "Speaker"
EnableSequence [
cset "name='Speaker Switch' on"
]
DisableSequence [
cset "name='Speaker Switch' off"
]
Value {
PlaybackPriority 100
PlaybackPCM "hw:${CardId},2"
PlaybackMixerElem "rt722 FU06"
PlaybackSwitch "rt722 FU06 Playback Switch"
PlaybackVolume "rt722 FU06 Playback Volume"
}
}
}
}
SectionDevice."Headphones" {
Comment "Headphones"
EnableSequence [
cset "name='Headphone Switch' on"
]
DisableSequence [
cset "name='Headphone Switch' off"
]
Value {
PlaybackPriority 200
PlaybackPCM "hw:${CardId}"
JackControl "Headphone Jack"
}
}
SectionDevice."Headset" {
Comment "Headset Microphone"
EnableSequence [
cset "name='rt722 FU0F Capture Switch' 1"
]
DisableSequence [
cset "name='rt722 FU0F Capture Switch' 0"
]
If.hsmicsw {
Condition {
Type ControlExists
Control "name='Headset Mic Switch'"
}
True {
EnableSequence [
cset "name='Headset Mic Switch' on"
]
DisableSequence [
cset "name='Headset Mic Switch' off"
]
}
}
Value {
CapturePriority 200
CapturePCM "hw:${CardId},1"
JackControl "Headset Mic Jack"
CaptureSwitch "rt722 FU0F Capture Switch"
CaptureVolume "rt722 FU0F Capture Volume"
CaptureMixerElem "rt722 FU0F"
}
}