From: Ryan Walklin Date: Sat, 21 Dec 2024 10:01:14 +0000 (+1300) Subject: sun4i-codec: add routing for headphones and internal speaker X-Git-Tag: v1.2.14~63 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=24008a2f93b39a33863c7e64ab2f7214d9970a1c;p=alsa-ucm-conf.git sun4i-codec: add routing for headphones and internal speaker The sun4i-codec kernel driver covers a large number of Allwinner SoCs. The H616 codec has a single line-out route, which is used in concert with a Toshiba mux chip to send audio to either an internal speaker or headphone jack on a number of Anbernic handheld gaming devices. Add a UCM configuration to allow enabling/disabling the speaker amp depending on whether headphones are in use or not. Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/491 Signed-off-by: Ryan Walklin Signed-off-by: Jaroslav Kysela --- diff --git a/ucm2/Allwinner/sun4i-h616/HiFi.conf b/ucm2/Allwinner/sun4i-h616/HiFi.conf new file mode 100644 index 0000000..2cb9a31 --- /dev/null +++ b/ucm2/Allwinner/sun4i-h616/HiFi.conf @@ -0,0 +1,35 @@ +SectionDevice."Speaker" { + Comment "Internal Speaker" + + EnableSequence [ + cset "name='Speaker Switch' on" + ] + + Value { + PlaybackMixerElem "Line Out" + PlaybackPCM "hw:${CardId},0" + } + + DisableSequence [ + cset "name='Speaker Switch' off" + ] + + ConflictingDevice [ + "Headphones" + ] +} + + +SectionDevice."Headphones" { + Comment "Headphones" + + Value { + PlaybackMixerElem "Line Out" + PlaybackPCM "hw:${CardId},0" + JackControl "Headphone Jack" + } + + ConflictingDevice [ + "Speaker" + ] +} diff --git a/ucm2/conf.d/sun4i-codec/h616-audio-codec.conf b/ucm2/conf.d/sun4i-codec/h616-audio-codec.conf new file mode 100644 index 0000000..240f41a --- /dev/null +++ b/ucm2/conf.d/sun4i-codec/h616-audio-codec.conf @@ -0,0 +1,8 @@ +# UCM for Allwinner H616 Codec + +Syntax 3 + +SectionUseCase."HiFi" { + File "/Allwinner/sun4i-h616/HiFi.conf" + Comment "Play HiFi quality Music" +}