alsa-ucm-conf-google-kukui: improvements for mt8183 ucm (MR 4733)

Krane doesn't have a headphone jack, which caused audio server issues
for me. Add a check to only enable the headphone and headset mic device
on non-Krane boards. Also improve the formatting and remove
ChromeOS-specifc options.

[ci:skip-build]: already built successfully in CI
This commit is contained in:
WeirdTreeThing 2024-01-17 16:31:26 -05:00 committed by Pablo Correa Gómez
parent def7d29774
commit 1f86677848
No known key found for this signature in database
GPG key ID: 7A342565FF635F79
5 changed files with 171 additions and 180 deletions

View file

@ -1,7 +1,8 @@
# Maintainer: Jenneron <jenneron@protonmail.com> # Maintainer: WeirdTreeThing <bradyn127@protonmail.com>
# Co-Maintainer: Jenneron <jenneron@protonmail.com>
pkgname=alsa-ucm-conf-google-kukui pkgname=alsa-ucm-conf-google-kukui
pkgver=1 pkgver=2
pkgrel=3 pkgrel=0
pkgdesc="ALSA Use Case Manager configuration for Google Kukui Chromebooks" pkgdesc="ALSA Use Case Manager configuration for Google Kukui Chromebooks"
url="https://alsa-project.org" url="https://alsa-project.org"
arch="aarch64" arch="aarch64"
@ -33,8 +34,8 @@ package() {
} }
sha512sums=" sha512sums="
d998860ca82ec9277a7b660dbdc644fc8ec84d5f3703dc72eac44a6b70b61ea9f733eeae94d21d9d2cadf25f95e951ce3c804593b4f0a4c715770b4b422d4ca7 mt8183_da7219_HiFi.conf 9755c2eaf4bc28a9f3734b6778550ebd77bbee8f6aa353642bc5a35d68e009a17b05d9b09f1c62fe592eb16a2d342e3d2abcda98f2c53142bd4905e4a883a88b mt8183_da7219_HiFi.conf
c8ce246275beaa3e89eb4e06bed825935122c9f6a9fff9f8e3188dec47f37db92d908148cd7551785de5282c13386134bd6daf8ed033de122218b698d67bab33 mt8183_da7219_rt1015p.conf 13ffff0471c29d4e624ba7089d8df811f6578bebc4a9da2e8e82e247430fd41dbc95204fdf1891cfb76f1d90303fcdb8501ecf47b8ca40c7429066bf2ff1379b mt8183_da7219_rt1015p.conf
749180019ca12ec342604fc6924aa60c5f4ff2892ce22d2199b78d707947a8b91e71fa7a71643f3475bf2dba6e94c36e4fc57cb98f7a96519c83106b08ebc5c3 mt8183_mt6358_HiFi.conf 3656cb0cc76994aab39bd0d0cfe283339bce0689448612f74a0d09a30b19516950132456945096a13bd5700d0e7f868c413e268ced810046ec70252ca8b07603 mt8183_mt6358_HiFi.conf
c8ce246275beaa3e89eb4e06bed825935122c9f6a9fff9f8e3188dec47f37db92d908148cd7551785de5282c13386134bd6daf8ed033de122218b698d67bab33 mt8183_mt6358_ts3a227_max98357.conf 171e9e3376e5bd56e133a5b19309f60f6326f052922064e6f95c53b4345ea12cc205adde7305a7bd840722a29b7fb393c71d2b39e60952b0979ecc2e5ec03efa mt8183_mt6358_ts3a227_max98357.conf
" "

View file

@ -1,81 +1,90 @@
SectionVerb {
EnableSequence [
cdev "hw:mt8183da7219rt1"
cset "name='Headphone Volume' 0"
# cset "name='UL3_CH1 ADDA_UL_CH1' 0"
# cset "name='UL3_CH2 ADDA_UL_CH2' 0"
cset "name='I2S3_CH1 DL1_CH1' 1"
cset "name='I2S3_CH2 DL1_CH2' 1"
cset "name='MTKAIF_DMIC' 1"
cset "name='Mt6358 Mic Type Mux' 2"
cset "name='UL3_CH1 ADDA_UL_CH1' 1"
cset "name='UL3_CH2 ADDA_UL_CH2' 1"
]
DisableSequence [
]
}
SectionDevice."Headphone" {
Value {
PlaybackPCM "hw:mt8183da7219rt1,0"
JackDev "mt8183_da7219_rt1015p Headset Jack"
JackSwitch "2"
}
ConflictingDevice [
"Speaker"
]
EnableSequence [
cdev "hw:mt8183da7219rt1"
cset "name='I2S3_CH1 DL1_CH1' 1"
cset "name='I2S3_CH2 DL1_CH2' 1"
]
DisableSequence [
cdev "hw:mt8183da7219rt1"
cset "name='I2S3_CH1 DL1_CH1' 0"
cset "name='I2S3_CH2 DL1_CH2' 0"
]
}
SectionDevice."Speaker" { SectionDevice."Speaker" {
Comment "Speaker"
Value { Value {
PlaybackPCM "hw:mt8183da7219rt1,0" PlaybackPCM "hw:${CardId},0"
DspName "speaker_eq" }
EnableSequence [
cset "name='I2S3_CH1 DL1_CH1' 1"
cset "name='I2S3_CH2 DL1_CH2' 1"
cset "name='Speakers Switch' 1"
]
DisableSequence [
cset "name='I2S3_CH1 DL1_CH1' 0"
cset "name='I2S3_CH2 DL1_CH2' 0"
cset "name='Speakers Switch' 0"
]
} }
ConflictingDevice [ SectionDevice."Headphones" {
"Headphone" Comment "Headphones"
]
Value {
PlaybackPCM "hw:${CardId},0"
}
EnableSequence [ EnableSequence [
cdev "hw:mt8183da7219rt1" cset "name='Playback Digital Switch' 1"
cset "name='Headphone Switch' 1"
cset "name='ST Mixer Out FilterL Out FilterL Switch' 1"
cset "name='Mixer Out FilterL DACL Switch' 1"
cset "name='ST Mixer Out FilterR Out FilterR Switch' 1"
cset "name='Mixer Out FilterR DACR Switch' 1"
cset "name='Out DACL Mux' DAIL"
cset "name='Out DACR Mux' DAIR"
cset "name='I2S3_CH1 DL1_CH1' 1" cset "name='I2S3_CH1 DL1_CH1' 1"
cset "name='I2S3_CH2 DL1_CH2' 1" cset "name='I2S3_CH2 DL1_CH2' 1"
] ]
DisableSequence [ DisableSequence [
cdev "hw:mt8183da7219rt1" cset "name='Playback Digital Switch' 0"
cset "name='Headphone Switch' 0"
cset "name='ST Mixer Out FilterL Out FilterL Switch' 0"
cset "name='Mixer Out FilterL DACL Switch' 0"
cset "name='ST Mixer Out FilterR Out FilterR Switch' 0"
cset "name='Mixer Out FilterR DACR Switch' 0"
cset "name='I2S3_CH1 DL1_CH1' 0" cset "name='I2S3_CH1 DL1_CH1' 0"
cset "name='I2S3_CH2 DL1_CH2' 0" cset "name='I2S3_CH2 DL1_CH2' 0"
] ]
} }
SectionDevice."Internal Mic" { SectionDevice."Mic" {
Comment "Internal Microphone"
Value { Value {
CapturePCM "hw:mt8183da7219rt1,5" CapturePCM "hw:${CardId},5"
CaptureChannelMap "0 1 -1 -1 -1 -1 -1 -1 -1 -1 -1"
IntrinsicSensitivity "-600"
} }
EnableSequence [ EnableSequence [
cdev "hw:mt8183da7219rt1"
cset "name='MTKAIF_DMIC' 1" cset "name='MTKAIF_DMIC' 1"
cset "name='Mt6358 Mic Type Mux' 2" cset "name='Mt6358 Mic Type Mux' 2"
cset "name='UL3_CH1 ADDA_UL_CH1' 1" cset "name='UL3_CH1 ADDA_UL_CH1' 1"
cset "name='UL3_CH2 ADDA_UL_CH2' 1" cset "name='UL3_CH2 ADDA_UL_CH2' 1"
] ]
DisableSequence [ DisableSequence [
cdev "hw:mt8183da7219rt1"
cset "name='MTKAIF_DMIC' 0" cset "name='MTKAIF_DMIC' 0"
cset "name='Mt6358 Mic Type Mux' 0" cset "name='Mt6358 Mic Type Mux' 0"
cset "name='UL3_CH1 ADDA_UL_CH1' 0" cset "name='UL3_CH1 ADDA_UL_CH1' 0"
cset "name='UL3_CH2 ADDA_UL_CH2' 0" cset "name='UL3_CH2 ADDA_UL_CH2' 0"
] ]
} }
SectionDevice."Headset" {
Comment "Headset Microphone"
Value {
CapturePCM "hw:${CardId},5"
}
EnableSequence [
cset "name='Capture Digital Switch' 1"
cset "name='Mixin Switch' 1"
cset "name='Mic Switch' 1"
cset "name='Mixer In Mic Switch' 1"
cset "name='Out DAIL Mux' ADC"
cset "name='UL3_CH1 I2S2_CH1' 1"
]
DisableSequence [
cset "name='Capture Digital Switch' 0"
cset "name='Mixin Switch' 0"
cset "name='Mic Switch' 0"
cset "name='Mixer In Mic Switch' 0"
cset "name='UL3_CH1 I2S2_CH1' 0"
]
}

View file

@ -1,8 +1,24 @@
Syntax 2 Syntax 6
Comment "Kukui internal card"
SectionUseCase."HiFi" { SectionUseCase."HiFi" {
File "HiFi.conf" File "HiFi.conf"
Comment "Default" Comment "Default"
} }
BootSequence [
# Speaker
cset "name='I2S3_CH1 DL1_CH1' 1"
cset "name='I2S3_CH2 DL1_CH2' 1"
cset "name='Speakers Switch' 1"
# Internal Mic
cset "name='MTKAIF_DMIC' 1"
cset "name='Mt6358 Mic Type Mux' 2"
cset "name='UL3_CH1 ADDA_UL_CH1' 1"
cset "name='UL3_CH2 ADDA_UL_CH2' 1"
# Headset
cset "name='Headphone Volume' 56"
cset "name='Capture Digital Volume' 113"
cset "name='Mic Volume' 3"
]

View file

@ -1,144 +1,86 @@
SectionVerb {
EnableSequence [
cdev "hw:mt8183mt6358ts3"
cset "name='Headphone Volume' 0"
cset "name='ADDA_DL_CH1 DL1_CH1' 0"
cset "name='ADDA_DL_CH2 DL1_CH2' 0"
cset "name='HPL Mux' 0"
cset "name='HPR Mux' 0"
cset "name='I2S3_CH1 DL1_CH1' 1"
cset "name='I2S3_CH2 DL1_CH2' 1"
cset "name='MTKAIF_DMIC' 1"
cset "name='Mic Type Mux' 2"
cset "name='UL3_CH1 ADDA_UL_CH1' 1"
cset "name='UL3_CH2 ADDA_UL_CH2' 1"
# from headset mic - does not work -see below
# cset "name='PGA L Mux' 0"
# cset "name='ADC L Mux' 0"
# cset "name='PGA Volume' 0"
]
DisableSequence [
]
}
SectionDevice."Headphones" {
Comment "Headphones"
Value {
PlaybackPCM "hw:mt8183mt6358ts3,0"
JackControl "mt8183_mt6358_ts3a227_max98357 Headset Jack"
}
ConflictingDevice [
"Speaker"
]
EnableSequence [
cdev "hw:mt8183mt6358ts3"
cset "name='ADDA_DL_CH1 DL1_CH1' 1"
cset "name='ADDA_DL_CH2 DL1_CH2' 1"
cset "name='HPL Mux' 2"
cset "name='HPR Mux' 2"
]
DisableSequence [
cdev "hw:mt8183mt6358ts3"
cset "name='ADDA_DL_CH1 DL1_CH1' 0"
cset "name='ADDA_DL_CH2 DL1_CH2' 0"
cset "name='HPL Mux' 0"
cset "name='HPR Mux' 0"
]
}
SectionDevice."Speaker" { SectionDevice."Speaker" {
Comment "Speaker" Comment "Speaker"
Value { Value {
PlaybackPCM "hw:mt8183mt6358ts3,0" PlaybackPCM "hw:${CardId},0"
DspName "speaker_eq"
} }
ConflictingDevice [
"Headphones"
]
EnableSequence [ EnableSequence [
cdev "hw:mt8183mt6358ts3"
cset "name='I2S3_CH1 DL1_CH1' 1" cset "name='I2S3_CH1 DL1_CH1' 1"
cset "name='I2S3_CH2 DL1_CH2' 1" cset "name='I2S3_CH2 DL1_CH2' 1"
] ]
DisableSequence [ DisableSequence [
cdev "hw:mt8183mt6358ts3"
cset "name='I2S3_CH1 DL1_CH1' 0" cset "name='I2S3_CH1 DL1_CH1' 0"
cset "name='I2S3_CH2 DL1_CH2' 0" cset "name='I2S3_CH2 DL1_CH2' 0"
] ]
} }
# headset mic does not work for some reason - if enabled there is no signal SectionDevice."Mic" {
# from it and after switching back to internal mic even that does not give Comment "Internal Microphone"
# any signal anymore
#SectionDevice."HeadsetMic" {
# Comment "Headset Microphone"
#
# Value {
# CapturePCM "hw:mt8183mt6358ts3,5"
# # i guess this one is chromeos specific and not used otherwise
# CaptureChannelMap "0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1"
# JackControl "mt8183_mt6358_ts3a227_max98357 Headset Jack"
# }
#
# ConflictingDevice [
# "InternalMic"
# ]
#
# EnableSequence [
# cdev "hw:mt8183mt6358ts3"
# cset "name='PGA L Mux' 2"
# cset "name='ADC L Mux' 2"
# cset "name='Mic Type Mux' 1"
# cset "name='PGA Volume' 4"
# cset "name='UL3_CH1 ADDA_UL_CH1' 1"
# ]
#
# DisableSequence [
# cdev "hw:mt8183mt6358ts3"
# cset "name='PGA L Mux' 0"
# cset "name='ADC L Mux' 0"
# cset "name='Mic Type Mux' 0"
# cset "name='PGA Volume' 0"
# cset "name='UL3_CH1 ADDA_UL_CH1' 0"
# ]
#}
SectionDevice."InternalMic" {
Comment "Intrernal Microphone"
Value { Value {
CapturePCM "hw:mt8183mt6358ts3,5" CapturePCM "hw:${CardId},5"
# i guess those two are chromeos specific and not used otherwise
CaptureChannelMap "0 1 -1 -1 -1 -1 -1 -1 -1 -1 -1"
IntrinsicSensitivity "-2600"
} }
# from headset mic - does not work -see above
# ConflictingDevice [
# "HeadsetMic"
# ]
EnableSequence [ EnableSequence [
cdev "hw:mt8183mt6358ts3"
cset "name='MTKAIF_DMIC' 1" cset "name='MTKAIF_DMIC' 1"
cset "name='Mic Type Mux' 2" cset "name='Mic Type Mux' 2"
cset "name='UL3_CH1 ADDA_UL_CH1' 1" cset "name='UL3_CH1 ADDA_UL_CH1' 1"
cset "name='UL3_CH2 ADDA_UL_CH2' 1" cset "name='UL3_CH2 ADDA_UL_CH2' 1"
] ]
DisableSequence [ DisableSequence [
cdev "hw:mt8183mt6358ts3"
cset "name='MTKAIF_DMIC' 0" cset "name='MTKAIF_DMIC' 0"
cset "name='UL3_CH1 ADDA_UL_CH1' 0" cset "name='UL3_CH1 ADDA_UL_CH1' 0"
cset "name='UL3_CH2 ADDA_UL_CH2' 0" cset "name='UL3_CH2 ADDA_UL_CH2' 0"
] ]
} }
If.krane {
Condition {
Type String
Haystack "${sys:firmware/devicetree/base/compatible}"
Needle "google,krane"
}
False {
SectionDevice."Headphones" {
Comment "Headphones"
Value {
PlaybackPCM "hw:${CardId},0"
}
EnableSequence [
cset "name='ADDA_DL_CH1 DL1_CH1' 1"
cset "name='ADDA_DL_CH2 DL1_CH2' 1"
cset "name='HPL Mux' 2"
cset "name='HPR Mux' 2"
]
DisableSequence [
cset "name='ADDA_DL_CH1 DL1_CH1' 0"
cset "name='ADDA_DL_CH2 DL1_CH2' 0"
cset "name='HPL Mux' 0"
cset "name='HPR Mux' 0"
]
}
SectionDevice."Headset" {
Comment "Headset Microphone"
Value {
CapturePCM "hw:${CardId},5"
}
EnableSequence [
cset "name='PGA L Mux' 2"
cset "name='ADC L Mux' 2"
cset "name='Mic Type Mux' 1"
cset "name='PGA Volume' 4"
cset "name='UL3_CH1 ADDA_UL_CH1' 1"
]
DisableSequence [
cset "name='PGA L Mux' 0"
cset "name='ADC L Mux' 0"
cset "name='Mic Type Mux' 0"
cset "name='PGA Volume' 0"
cset "name='UL3_CH1 ADDA_UL_CH1' 0"
]
}
}
}

View file

@ -1,8 +1,31 @@
Syntax 2 Syntax 6
Comment "Kukui internal card"
SectionUseCase."HiFi" { SectionUseCase."HiFi" {
File "HiFi.conf" File "HiFi.conf"
Comment "Default" Comment "Default"
} }
BootSequence [
# Speakers
cset "name='I2S3_CH1 DL1_CH1' 1"
cset "name='I2S3_CH2 DL1_CH2' 1"
# Headphones
cset "name='Headphone Volume' 17"
cset "name='ADDA_DL_CH1 DL1_CH1' 0"
cset "name='ADDA_DL_CH2 DL1_CH2' 0"
cset "name='HPL Mux' 0"
cset "name='HPR Mux' 0"
# Internal Mic
cset "name='MTKAIF_DMIC' 1"
cset "name='Mic Type Mux' 2"
cset "name='UL3_CH1 ADDA_UL_CH1' 1"
cset "name='UL3_CH2 ADDA_UL_CH2' 1"
# Headset Mic
cset "name='PGA L Mux' 0"
cset "name='ADC L Mux' 0"
cset "name='PGA Volume' 0"
cset "name='UL3_CH1 ADDA_UL_CH1' 0"
]