From c710aa0eb2fe184072b312a8afa5c4e301e93a65 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 16 Jan 2022 14:27:08 +0100 Subject: [PATCH] USB-Audio: Add profile for MSI MPG X570S Carbon Max Wifi. This patch depends on Linux 5.17. This board features an Realtek ALC4080 chip. The various inputs and outputs are distributed over multiple hardware devices: * Input - hw:$card,0 loop back from speaker (called "Analog In") - hw:$card,1 line in at back panel - hw:$card,2 microphone from front AND back panel * Output - hw:$card,0 speaker output at back panel (up to 7.1) - hw:$card,1 headerphone output at front panel - hw:$card,2 could not figure this one out - hw:$card,3 guessed S/PDIF output (sadly no way to test) By default Mic and Line in are disabled. This confuses applications, thus I made the profile enable them by default. Without an UCM profile PulseAudio is not able to create output on the front panel nor record any microphone input. Signed-off-by: Johannes Schickel Signed-off-by: Jaroslav Kysela --- ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf | 57 ++++++++++++++++++++++++ ucm2/USB-Audio/Realtek/ALC4080.conf | 5 +++ ucm2/USB-Audio/USB-Audio.conf | 11 +++++ 3 files changed, 73 insertions(+) create mode 100644 ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf create mode 100644 ucm2/USB-Audio/Realtek/ALC4080.conf diff --git a/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf b/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf new file mode 100644 index 0000000..9bbaf63 --- /dev/null +++ b/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf @@ -0,0 +1,57 @@ +SectionDevice."Speaker" { + Comment "Speakers" + Value { + PlaybackChannels 8 + PlaybackPriority 200 + PlaybackPCM "hw:${CardId}" + JackControl "Speaker - Output Jack" + PlaybackMixerElem "Speaker" + } +} + +SectionDevice."Headphones" { + Comment "Front Headphones" + Value { + PlaybackPriority 300 + PlaybackPCM "hw:${CardId},1" + JackControl "Headphone - Output Jack" + PlaybackMixerElem "Front Headphone" + } +} + +SectionDevice."SPDIF" { + Comment "S/PDIF Out" + Value { + PlaybackPriority 100 + PlaybackPCM "hw:${CardId},3" + PlaybackMixerElem "IEC958" + } +} + +SectionDevice."Line" { + EnableSequence [ + cset "name='Line Capture Switch' on" + ] + + Comment "Line In" + Value { + CapturePriority 100 + CapturePCM "hw:${CardId},1" + JackControl "Line - Input Jack" + CaptureMixerElem "Line" + } +} + +SectionDevice."Mic" { + EnableSequence [ + cset "name='Mic Capture Switch' on" + ] + + Comment "Microphone" + Value { + CapturePriority 200 + CapturePCM "hw:${CardId},2" + JackControl "Mic - Input Jack" + CaptureMixerElem "Mic" + } +} diff --git a/ucm2/USB-Audio/Realtek/ALC4080.conf b/ucm2/USB-Audio/Realtek/ALC4080.conf new file mode 100644 index 0000000..a42dd68 --- /dev/null +++ b/ucm2/USB-Audio/Realtek/ALC4080.conf @@ -0,0 +1,5 @@ +Comment "USB-audio on Realtek ALC4080" +SectionUseCase."HiFi" { + File "/USB-Audio/Realtek/ALC4080-HiFi.conf" + Comment "Default Alsa Profile" +} diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf index c40187f..75780fc 100644 --- a/ucm2/USB-Audio/USB-Audio.conf +++ b/ucm2/USB-Audio/USB-Audio.conf @@ -29,6 +29,17 @@ If.realtek-alc1220-vb { True.Define.ProfileName "Realtek/ALC1220-VB-Desktop" } +If.realtek-alc4080 { + + Condition { + Type RegexMatch + String "${CardComponents}" + # 0db0:419c MSI MPG X570S Carbon Max Wifi + Regex "USB(0db0:419c)" + } + True.Define.ProfileName "Realtek/ALC4080" +} + If.gigabyte-aorus-main { Condition { Type String -- 2.47.1