__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
Syntax 6
SectionUseCase."HiFi" {
File "/sof-soundwire/HiFi.conf"
Comment "Play HiFi quality Music"
}
Include.led.File "/common/ctl/led.conf"
Include.card-init.File "/lib/card-init.conf"
Include.ctl-remap.File "/lib/ctl-remap.conf"
Define {
SpeakerCodec1 ""
SpeakerChannels1 "2"
SpeakerAmps1 "0"
HeadsetCodec1 ""
MicCodec1 ""
Mics1 "0"
MultiCodec1 ""
MultiCodecRegex "rt712|rt713|rt721|rt722|rt1320"
SpeakerCodecFile ""
MicCodecFile ""
HeadsetCodecFile ""
}
DefineRegex {
SpeakerCodec {
Regex " spk:([a-z0-9]+((-sdca)|(-spk)|(-bridge))?(\\+[a-z0-9]+((-spk)?))?)"
String "${CardComponents}"
}
SpeakerChannels {
Regex " cfg-spk:([0-9]+)"
String "${CardComponents}"
}
SpeakerAmps {
Regex " cfg-amp:([0-9]+)"
String "${CardComponents}"
}
HeadsetCodec {
Regex " hs:([a-z0-9]+(-sdca)?)"
String "${CardComponents}"
}
MicCodec {
Regex " mic:([a-z0-9]+(-dmic)?+(-sdca)?)"
String "${CardComponents}"
}
Mics {
Regex " cfg-mics:([1-9][0-9]*)"
String "${CardComponents}"
}
MultiCodec {
Regex "(${var:MultiCodecRegex})"
String "${var:SpeakerCodec1} ${var:HeadsetCodec1} ${var:MicCodec1}"
}
}
# set default file variables after regex evaluation
If.codec_default {
Condition {
Type String
Empty "non-empty-string-so-this-is-always-false"
}
False.Define {
SpeakerCodecFile "${var:SpeakerCodec1}"
MicCodecFile "${var:MicCodec1}"
HeadsetCodecFile "${var:HeadsetCodec1}"
}
}
# check to keep compatibility with older kernels that have two separate spk: tags
If.old_multi_spk {
Condition {
Type RegexMatch
Regex "(spk:cs42l43-spk .*spk:cs35l56( |$))|(spk:cs35l56 .*spk:cs42l43-spk( |$))"
String "${CardComponents}"
}
True.Define.SpeakerCodec1 "cs42l43-spk+cs35l56"
}
DefineMacro.MultiCodecInit.If.a {
Condition {
Type String
# guard with "=" to not match the codec name in the middle
Haystack "=${var:SpeakerCodec1}=${var:HeadsetCodec1}=${var:MicCodec1}"
Needle "=${var:__CodecId}"
}
True {
If.spk {
Condition {
Type RegexMatch
# guard with "=" to avoid empty string matching
Regex "=(${var:__CodecId}(-sdca)?)="
String "=${var:SpeakerCodec1}="
}
True.Define.SpeakerCodecFile "${var:__CodecId}"
}
If.headset {
Condition {
Type RegexMatch
# guard with "=" to avoid empty string matching
Regex "=(${var:__CodecId}(-sdca)?)="
String "=${var:HeadsetCodec1}="
}
True.Define.HeadsetCodecFile "${var:__CodecId}"
}
If.mic {
Condition {
Type RegexMatch
# guard with "=" to avoid empty string matching
Regex "=(${var:__CodecId}(-sdca|-dmic)?)="
String "=${var:MicCodec1}="
}
True.Define.MicCodecFile "${var:__CodecId}"
}
}
}
# probe codecs with multiple functions, modify file variables
If.multi_init {
Condition {
Type String
Empty "${var:MultiCodec1}"
}
False {
Macro.rt712.MultiCodecInit "CodecId=rt712"
Macro.rt713.MultiCodecInit "CodecId=rt713"
Macro.rt721.MultiCodecInit "CodecId=rt721"
Macro.rt722.MultiCodecInit "CodecId=rt722"
Macro.rt1320.MultiCodecInit "CodecId=rt1320"
}
}
If.spk {
Condition {
Type String
Empty "${var:SpeakerCodecFile}"
}
False.If.filter {
Condition {
Type RegexMatch
Regex "(${var:MultiCodecRegex}|rt1318|cs42l43-spk(\\+cs35l56)?|cs35l56((-bridge)|(\\+cs42l43-spk))?)"
String "${var:SpeakerCodecFile}"
}
True.Include.a.File "/codecs/${var:SpeakerCodecFile}/init.conf"
}
}
If.mic {
Condition {
Type String
Empty "${var:MicCodecFile}"
}
False.If.dup {
Condition {
Type String
String1 "${var:MicCodecFile}"
String2 "${var:SpeakerCodecFile}"
}
False.If.filter {
Condition {
Type RegexMatch
Regex "(${var:MultiCodecRegex}|(acp|cs42l43|cs42l45|cs47l47)-dmic|rt715(-sdca)?)"
String "${var:MicCodecFile}"
}
True.Include.a.File "/codecs/${var:MicCodecFile}/init.conf"
}
}
}
If.headset {
Condition {
Type String
Empty "${var:HeadsetCodecFile}"
}
False.If.dup {
Condition {
Type String
# guard with "=" to avoid empty string matching
Needle "=${var:HeadsetCodecFile}="
Haystack "=${var:SpeakerCodecFile}=${var:MicCodecFile}="
}
False.If.filter {
Condition {
Type RegexMatch
Regex "(${var:MultiCodecRegex}|cs42l43|cs42l45|cs47l47|rt5682|rt700|rt711)"
String "${var:HeadsetCodecFile}"
}
True.Include.a.File "/codecs/${var:HeadsetCodecFile}/init.conf"
}
}
}
If.mic_init_rt715 {
Condition {
Type String
Needle "rt715"
Haystack "${var:MicCodec1}"
}
True.Macro [{ SetLED { LED="mic" Action="detach" CtlId="PGA5.0 5 Master Capture Switch" } }]
}
If.pga_init_pga2 {
Condition {
Type ControlExists
Control "name='PGA2.0 2 Master Capture Switch'"
}
True.BootSequence [
cset "name='PGA2.0 2 Master Capture Switch' 1"
]
}
If.pga_init_pga5 {
Condition {
Type ControlExists
Control "name='PGA5.0 5 Master Capture Switch'"
}
True.BootSequence [
cset "name='PGA5.0 5 Master Capture Switch' 1"
]
}
If.mics-array {
Condition {
Type String
Empty "${var:Mics1}"
}
False.FixedBootSequence [
# dmic array info
exec "-nhlt-dmic-info -o ${var:LibDir}/dmics-nhlt.json"
]
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| amd-soundwire.conf | File | 4.99 KB | 0644 |
|