From: Jaroslav Kysela Date: Thu, 4 Nov 2021 09:40:02 +0000 (+0100) Subject: HDA-Intel: fixes for Headphone+LO variant (Realtek ALC233) X-Git-Tag: v1.2.6~36 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=66bd36d5d538190897372d29bfddcb34fdd9e3a6;p=alsa-ucm-conf.git HDA-Intel: fixes for Headphone+LO variant (Realtek ALC233) This commit implements the support for shared Headphone and Line Out and adds support for the Front Mic. Controls for Headphone and Lineout: Simple mixer control 'Headphone',0 # Switch only Simple mixer control 'Headphone+LO',0 # Volume only Simple mixer control 'Line Out',0 # Switch only Jack 'Front Headphone Jack' Jack 'Line Out Jack' Control for Mic: Simple mixer control 'Mic',0 Simple mixer control 'Mic Boost',0 Jack 'Mic Jack' Control for Front Mic: Simple mixer control 'Front Mic',0 Simple mixer control 'Front Mic Boost',0 Jack 'Front Mic Jack' Fixes: https://github.com/alsa-project/alsa-ucm-conf/issues/114 Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/116 Signed-off-by: Jaroslav Kysela --- diff --git a/ucm2/HDA-Intel/HiFi-analog.conf b/ucm2/HDA-Intel/HiFi-analog.conf index dd0da02..809fcde 100644 --- a/ucm2/HDA-Intel/HiFi-analog.conf +++ b/ucm2/HDA-Intel/HiFi-analog.conf @@ -1,5 +1,59 @@ # Generic HDA devices for analog I/O +Define.DeviceFrontMic "" +Define.hpvol "Headphone" +Define.hpjack "Headphone Jack" +Define.lovol "Line Out" + +If.fmic { + Condition { + Type ControlExists + Control "name='Front Mic Playback Switch'" + } + True { + If.mic2 { + Condition { + Type String + String1 "${var:DeviceMic}" + String2 "Mic2" + } + True.Define { + DeviceFrontMic "Mic3" + } + False.Define { + DeviceMic "Mic1" + DeviceFrontMic "Mic2" + } + } + } +} + +If.hplo { + Condition { + Type ControlExists + Control "name='Headphone+LO Playback Volume'" + } + True.Define { + hpvol "Headphone+LO" + lovol "Headphone+LO" + } +} + +If.hpjack { + Condition { + Type ControlExists + Control "iface=CARD,name='Headphone Mic Jack'" + } + True.Define.hpjack "Headphone Mic Jack" + False.If.front { + Condition { + Type ControlExists + Control "iface=CARD,name='Front Headphone Jack'" + } + True.Define.hpjack "Front Headphone Jack" + } +} + SectionDevice."Headphones" { Comment "Headphones" @@ -21,22 +75,11 @@ SectionDevice."Headphones" { Value { PlaybackPriority 200 PlaybackPCM "hw:${CardId}" - PlaybackMixerElem "Headphone" + PlaybackMixerElem "${var:hpvol}" PlaybackMasterElem "Master" - PlaybackVolume "Headphone Playback Volume" + PlaybackVolume "${var:hpvol} Playback Volume" PlaybackSwitch "Headphone Playback Switch" - If.jack { - Condition { - Type ControlExists - Control "iface=CARD,name='Headphone Mic Jack'" - } - True { - JackControl "Headphone Mic Jack" - } - False { - JackControl "Headphone Jack" - } - } + JackControl "${var:hpjack}" } } @@ -134,3 +177,62 @@ If.monomic { } } } + +If.frontmic { + Condition { + Type String + Empty "${var:DeviceFrontMic}" + } + False.SectionDevice."${var:DeviceFrontMic}" { + Comment "Front Stereo Microphone" + + ConflictingDevice [ + "${var:DeviceMic}" + ] + + Value { + CapturePriority 400 + Include.value.File "/HDA-Intel/HDA-Capture-value.conf" + CaptureMasterElem "Front Mic Boost" + JackControl "Front Mic Jack" + } + } +} + +If.lineout { + Condition { + Type ControlExists + Control "name='Line Out Playback Switch'" + } + True.SectionDevice."Line" { + Comment "Line Output" + + If.conflict { + Condition { + Type String + String1 "${var:lovol}" + String2 "Headphone+LO" + } + True.ConflictingDevice [ + "Headphones" + ] + } + + EnableSequence [ + cset "name='Line Out Playback Switch' on" + ] + DisableSequence [ + cset "name='Line Out Playback Switch' off" + ] + + Value { + PlaybackPriority 300 + PlaybackPCM "hw:${CardId}" + PlaybackMixerElem "${var:lovol}" + PlaybackMasterElem "Master" + PlaybackVolume "${var:lovol} Playback Volume" + PlaybackSwitch "Line Out Playback Switch" + JackControl "Line Out Jack" + } + } +}