diff --git a/README.md b/README.md index 2af6fbe8..6c9feec7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # ALSA UCM configuration for Chrome devices Overlay of upstream alsa-ucm-conf + +`ucm2` contains UCM configurations to overlay upstream +`overrides` contains UCM configurations that are modified from and replace upstream diff --git a/overrides/acp3xalc5682m98/HiFi.conf b/overrides/acp3xalc5682m98/HiFi.conf new file mode 100644 index 00000000..c671373c --- /dev/null +++ b/overrides/acp3xalc5682m98/HiFi.conf @@ -0,0 +1,144 @@ +If.jelboz { + Condition { + Type RegexMatch + Regex "^(Jelboz|Jelboz360|Shuboz)$" + String "${sys:devices/virtual/dmi/id/product_name}" + } + True.Define.volume 3 + False.Define.volume 2 +} + +SectionVerb { + EnableSequence [ + cset "name='Headphone Jack Switch' off" + cset "name='HPOL Playback Switch' off" + cset "name='HPOR Playback Switch' off" + cset "name='Stereo1 DAC MIXL DAC L1 Switch' 0" + cset "name='Stereo1 DAC MIXR DAC R1 Switch' 0" + cset "name='Stereo1 ADC L Mux' 0" + cset "name='STO1 ADC Capture Switch' on" + cset "name='RECMIX1L CBJ Switch' 1" + cset "name='IF1 01 ADC Swap Mux' 2" + cset "name='CBJ Boost Volume' ${var:volume}" + cset "name='Stereo1 ADC L1 Mux' 1" + cset "name='Stereo1 ADC R1 Mux' 1" + cset "name='Stereo1 ADC MIXL ADC2 Switch' 0" + cset "name='Stereo1 ADC MIXR ADC2 Switch' 0" + cset "name='Stereo1 ADC MIXL ADC1 Switch' 1" + cset "name='Stereo1 ADC MIXR ADC1 Switch' 1" + ] +} + +SectionDevice."Speaker" { + Comment "Speaker" + Value { + PlaybackPriority 100 + PlaybackPCM "hw:${CardId},1" + } + EnableSequence [ + cset "name='Spk Switch' on" + ] + DisableSequence [ + cset "name='Spk Switch' off" + ] +} + +SectionDevice."Headphones" { + Comment "Headphones" + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},0" + PlaybackMixerElem "DAC1" + JackControl "Headset Jack" + } + EnableSequence [ + cset "name='Headphone Jack Switch' on" + cset "name='HPOL Playback Switch' 1" + cset "name='HPOR Playback Switch' 1" + ] + DisableSequence [ + cset "name='Headphone Jack Switch' off" + cset "name='HPOL Playback Switch' 0" + cset "name='HPOR Playback Switch' 0" + ] +} + +If.1mic { + Condition { + Type String + Empty "${var:1mic}" + } + True { + SectionDevice."Mic1" { + Comment "Front Microphone" + ConflictingDevice [ + "Mic2" + ] + Value { + CapturePriority 100 + CapturePCM "hw:${CardId},2" + } + EnableSequence [ + cset "name='Dmic Mux' Front Mic" + ] + } + + SectionDevice."Mic2" { + Comment "Rear Microphone" + ConflictingDevice [ + "Mic1" + ] + Value { + CapturePriority 100 + CapturePCM "hw:${CardId},2" + } + EnableSequence [ + cset "name='Dmic Mux' Rear Mic" + ] + } + + SectionDevice."Mic3" { + Comment "Microphone" + Value { + CapturePriority 200 + CapturePCM "hw:${CardId},0" + CaptureMixerElem "Headset Mic" + JackControl "Headset Jack" + } + EnableSequence [ + cset "name='Headset Mic Switch' on" + ] + DisableSequence [ + cset "name='Headset Mic Switch' off" + ] + } + } + False { + SectionDevice."Mic1" { + Comment "Internal Microphone" + Value { + CapturePriority 100 + CapturePCM "hw:${CardId},2" + } + EnableSequence [ + cset "name='Dmic Mux' Front Mic" + ] + } + + SectionDevice."Mic2" { + Comment "Microphone" + Value { + CapturePriority 200 + CapturePCM "hw:${CardId},0" + CaptureMixerElem "Headset Mic" + JackControl "Headset Jack" + } + EnableSequence [ + cset "name='Headset Mic Switch' on" + ] + DisableSequence [ + cset "name='Headset Mic Switch' off" + ] + } + } +} diff --git a/overrides/acp3xalc5682m98/acp3xalc5682m98.conf b/overrides/acp3xalc5682m98/acp3xalc5682m98.conf new file mode 100644 index 00000000..e1f1c9e2 --- /dev/null +++ b/overrides/acp3xalc5682m98/acp3xalc5682m98.conf @@ -0,0 +1,72 @@ +# Based on: +# https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/ad560b208139b80e97a7c2d39c7bfea1dcc29da9/overlay-zork/chromeos-base/chromeos-bsp-zork/files/ +# https://chromium.googlesource.com/chromiumos/project/+/f1387fd5f4effe236dd2a8e6e2b8e665eb2a6cfb/zork/ + +Syntax 4 + +Define { Found="" 1mic="" } + +If.zork { + Condition { + Type String + String1 "Google_Zork" + String2 "${sys:devices/virtual/dmi/id/product_family}" + } + True { + If.1mic { + Condition { + Type RegexMatch + Regex "^(Berknip|Dirinboz|Gumboz|Jelboz|Trembyle|Woomax)$" + String "${sys:devices/virtual/dmi/id/product_name}" + } + True.Define { Found=y 1mic=y } + } + + If.2mic { + Condition { + Type RegexMatch + Regex "^(Dalboz|Ezkinil|Jelboz360|Morphius)$" + String "${sys:devices/virtual/dmi/id/product_name}" + } + True.Define.Found y + } + + If.shuboz { + Condition { + Type String + String1 "Shuboz" + String2 "${sys:devices/virtual/dmi/id/product_name}" + } + True { + If.shuboz_jelboz { + Condition { + Type RegexMatch + Regex "^sku(1518731265|1518731266|1518731267|1518731268|1518731269|1518731270|1518731271|1518731272|1518731273|1518731274|1518731275|1518731276|1518731277|1518731278|2147483647)$" + String "${sys:devices/virtual/dmi/id/product_sku}" + } + True.Define { Found=y 1mic=y } + } + + If.shuboz_jelboz360 { + Condition { + Type RegexMatch + Regex "^sku(1518862337|1518862338|1518862339|1518862340)$" + String "${sys:devices/virtual/dmi/id/product_sku}" + } + True.Define.Found y + } + } + } + } +} + +If.found { + Condition { + Type String + Empty "${var:Found}" + } + False.SectionUseCase."HiFi" { + File "/AMD/acp3xalc5682m98/HiFi.conf" + Comment "Default" + } +} diff --git a/overrides/acpd7219m98357/HiFi.conf b/overrides/acpd7219m98357/HiFi.conf new file mode 100644 index 00000000..8b2985d7 --- /dev/null +++ b/overrides/acpd7219m98357/HiFi.conf @@ -0,0 +1,53 @@ +SectionDevice."Speaker" { + Comment "Speaker" + + Value { + PlaybackPriority 100 + PlaybackPCM "hw:${CardId},2" + } +} + +SectionDevice."Headphones" { + Comment "Headphones" + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},0" + PlaybackMixerElem "Headphone" + JackControl "Headphone Jack" + } + EnableSequence [ + cset "name='Headphone Switch' on" + ] + DisableSequence [ + cset "name='Headphone Switch' off" + ] +} + +SectionDevice."Mic" { + Comment "Internal Microphone" + + Value { + CapturePriority 100 + CapturePCM "hw:${CardId},4" + } +} + +SectionDevice."Headset" { + Comment "Headset Microphone" + + Value { + CapturePriority 200 + CapturePCM "hw:${CardId},1" + CaptureMixerElem "Headset Mic" + JackControl "Headset Mic Jack" + } + EnableSequence [ + cset "name='Headset Mic Switch' on" + cset "name='Mic Switch' on" + ] + DisableSequence [ + cset "name='Headset Mic Switch' off" + cset "name='Mic Switch' off" + ] +} diff --git a/ucm2/conf.d/sof-glkda7219ma/sof-glkda7219ma.conf b/overrides/acpd7219m98357/acpd7219m98357.conf similarity index 100% rename from ucm2/conf.d/sof-glkda7219ma/sof-glkda7219ma.conf rename to overrides/acpd7219m98357/acpd7219m98357.conf diff --git a/ucm2/conf.d/sof-glkda7219ma/HiFi.conf b/overrides/sof-glkda7219ma/HiFi.conf similarity index 100% rename from ucm2/conf.d/sof-glkda7219ma/HiFi.conf rename to overrides/sof-glkda7219ma/HiFi.conf diff --git a/overrides/sof-glkda7219ma/sof-glkda7219ma.conf b/overrides/sof-glkda7219ma/sof-glkda7219ma.conf new file mode 100644 index 00000000..14126dd6 --- /dev/null +++ b/overrides/sof-glkda7219ma/sof-glkda7219ma.conf @@ -0,0 +1,8 @@ +Syntax 6 + +SectionUseCase."HiFi" { + File "HiFi.conf" + Comment "Default" +} + +Include.codec-init.File "/codecs/da7219/init.conf" diff --git a/ucm2/conf.d/avs_ssm4567-adi/HiFi.conf b/ucm2/conf.d/avs_ssm4567/HiFi.conf similarity index 100% rename from ucm2/conf.d/avs_ssm4567-adi/HiFi.conf rename to ucm2/conf.d/avs_ssm4567/HiFi.conf diff --git a/ucm2/conf.d/avs_ssm4567-adi/avs_ssm4567-adi.conf b/ucm2/conf.d/avs_ssm4567/avs_ssm4567-adi.conf similarity index 100% rename from ucm2/conf.d/avs_ssm4567-adi/avs_ssm4567-adi.conf rename to ucm2/conf.d/avs_ssm4567/avs_ssm4567-adi.conf diff --git a/ucm2/conf.d/sof-rt5682/codecs.conf b/ucm2/conf.d/sof-rt5682/codecs.conf deleted file mode 100644 index 43b83354..00000000 --- a/ucm2/conf.d/sof-rt5682/codecs.conf +++ /dev/null @@ -1,95 +0,0 @@ -# codec probing - -# headset codecs - -If.rt5682 { - Condition { - Type String - String1 "$${sys:bus/i2c/devices/i2c-10EC5682:00/modalias}" - String2 "acpi:10EC5682:" - } - True.Define.rt5682 y -} - -If.rt5682s { - Condition { - Type String - String1 "$${sys:bus/i2c/devices/i2c-RTL5682:00/modalias}" - String2 "acpi:RTL5682:" - } - True.Define.rt5682s y -} - -# speaker amps - -If.max98357a { - Condition { - Type String - String1 "$${sys:bus/platform/devices/MX98357A:00/modalias}" - String2 "acpi:MX98357A:" - } - True.Define.max98357a y -} - -If.max98360a { - Condition { - Type String - String1 "$${sys:bus/platform/devices/MX98360A:00/modalias}" - String2 "acpi:MX98360A:" - } - True.Define.max98357a y -} - -If.max98373 { - Condition { - Type String - String1 "$${sys:bus/i2c/devices/i2c-MX98373:00/modalias}" - String2 "acpi:MX98373:" - } - True.Define.max98373 y -} - -If.max98390 { - Condition { - Type String - String1 "$${sys:bus/i2c/devices/i2c-MX98390:00/modalias}" - String2 "acpi:MX98390:" - } - True.Define.max98390 y -} - -If.rt1011 { - Condition { - Type String - String1 "$${sys:bus/i2c/devices/i2c-10EC1011:00/modalias}" - String2 "acpi:10EC1011:" - } - True.Define.rt1011 y -} - -If.rt1015 { - Condition { - Type String - String1 "$${sys:bus/i2c/devices/i2c-10EC1015:00/modalias}" - String2 "acpi:10EC1015:" - } - True.Define.rt1015 y -} - -If.rt1015p { - Condition { - Type String - String1 "$${sys:bus/platform/devices/RTL1015:00/modalias}" - String2 "acpi:RTL1015:" - } - True.Define.rt1015p y -} - -If.rt1019p { - Condition { - Type String - String1 "$${sys:bus/platform/devices/RTL1019:00/modalias}" - String2 "acpi:RTL1019:" - } - True.Define.rt1019p y -}