genio: add alsa-ucm-conf + ucm2 config for working audio in userspace
- from Collabora's Debian 13 impl
This commit is contained in:
parent
22f72c064b
commit
1b1e24e4d7
@ -281,3 +281,95 @@ function add_host_dependencies__genio_python3_deps_for_optee_build() {
|
||||
function write_uboot_platform() {
|
||||
: # noop; this means `armbian-install` can't be used to flash u-boot; users must use mtkflash or similar
|
||||
}
|
||||
|
||||
## Audio; needs alsa-ucm-conf package plus mediatek-specific UCM files
|
||||
function post_family_config__genio_userspace_audio() {
|
||||
add_packages_to_image "alsa-ucm-conf" # also needs mediatek-specific UCM files; see pre_customize_image__genio_1200_alsa_ucm_conf
|
||||
}
|
||||
|
||||
# From https://gitlab.collabora.com/mediatek/aiot/debian-image-recipes/-/tree/main/overlays/alsa-ucm-sof-mt8395-evk/ucm2 @ 24d7cca9272b594259c43f316e678ac348cdc0f2
|
||||
function pre_customize_image__genio_1200_alsa_ucm_conf() {
|
||||
display_alert "Add alsa-ucm-conf for Mediatek" "genio :: ${BOARD}" "info"
|
||||
|
||||
declare dest_dir_sof="${SDCARD}/usr/share/alsa/ucm2/MediaTek/sof-mt8395-evk"
|
||||
mkdir -p "${dest_dir_sof}"
|
||||
cat <<- 'MEDIATEK_HIFI' > "${dest_dir_sof}/HiFi.conf"
|
||||
If.HDMI {
|
||||
Condition {
|
||||
Type ControlExists
|
||||
Control "iface=CARD,name='HDMI Jack'"
|
||||
}
|
||||
True {
|
||||
SectionDevice."HDMI1" {
|
||||
Comment "HDMI output"
|
||||
EnableSequence [
|
||||
cset "name='HDMI_OUT_MUX' 1"
|
||||
]
|
||||
DisableSequence [
|
||||
cset "name='HDMI_OUT_MUX' 0"
|
||||
]
|
||||
Value {
|
||||
PlaybackPriority 200
|
||||
PlaybackPCM "hw:${CardId},5"
|
||||
JackControl "HDMI Jack"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SectionDevice."Headphones" {
|
||||
Comment "Earphone speaker"
|
||||
EnableSequence [
|
||||
cset "name='HP Mux' Audio Playback"
|
||||
]
|
||||
DisableSequence [
|
||||
cset "name='HP Mux' Open"
|
||||
]
|
||||
Value {
|
||||
PlaybackPriority 400
|
||||
PlaybackChannels 2
|
||||
PlaybackPCM "hw:${CardId},16"
|
||||
JackControl "Headphone Jack"
|
||||
}
|
||||
}
|
||||
MEDIATEK_HIFI
|
||||
|
||||
cat <<- 'MEDIATEK_MT8395_EVK' > "${dest_dir_sof}/sof-mt8395-evk.conf"
|
||||
Syntax 4
|
||||
SectionUseCase."HiFi" {
|
||||
File "/MediaTek/sof-mt8395-evk/HiFi.conf"
|
||||
Comment "Play high quality music"
|
||||
}
|
||||
BootSequence [
|
||||
cset "name='HP Mux' Audio Playback"
|
||||
cset "name='LOL Mux' Open"
|
||||
cset "name='MISO0_MUX' UL1_CH1"
|
||||
cset "name='MISO1_MUX' UL1_CH1"
|
||||
cset "name='ADC_L_Mux' Left Preamplifier"
|
||||
cset "name='ADC_R_Mux' Right Preamplifier"
|
||||
cset "name='ADC_3_Mux' Preamplifier"
|
||||
cset "name='ETDM_OUT3_Clock_Source' a1sys_a2sys"
|
||||
cset "name='PGA_L_Mux' AIN1"
|
||||
cset "name='PGA_R_Mux' AIN2"
|
||||
cset "name='PGA_3_Mux' AIN3"
|
||||
cset "name='HDMI_OUT_MUX' Connect"
|
||||
cset "name='DPTX_OUT_MUX' Disconnect"
|
||||
cset "name='Lineout Volume' 10"
|
||||
cset "name='Headset Volume' 2"
|
||||
cset "name='PGA1 Volume' 4"
|
||||
cset "name='PGA2 Volume' 4"
|
||||
cset "name='PGA3 Volume' 4"
|
||||
cset "name='O000 I000 Switch' on"
|
||||
cset "name='O001 I001 Switch' on"
|
||||
cset "name='O034 I168 Switch' on"
|
||||
cset "name='O035 I169 Switch' on"
|
||||
cset "name='O040 I002 Switch' on"
|
||||
cset "name='O041 I003 Switch' on"
|
||||
cset "name='O176 I070 Switch' on"
|
||||
cset "name='O177 I071 Switch' on"
|
||||
]
|
||||
MEDIATEK_MT8395_EVK
|
||||
|
||||
declare dest_dir_conf="${SDCARD}/usr/share/alsa/ucm2/conf.d/sof-mt8395-evk"
|
||||
mkdir -p "${dest_dir_conf}"
|
||||
run_host_command_logged ln -sfv "../../MediaTek/sof-mt8395-evk/sof-mt8395-evk.conf" "${dest_dir_conf}/sof-mt8395-evk.conf"
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user