From 15a3ab694c703530e0d9317116be5d28129986e0 Mon Sep 17 00:00:00 2001 From: Hui Wang Date: Mon, 17 Aug 2020 12:37:44 +0800 Subject: [PATCH] USB-Audio: Dell-WD15-Dock: make input and output volume adjustable Recently we found the input volume is too low for some specific headset-mic, even we adjust the input volume to max from PA, we still can't record the sound from that headset-mic. That is because we change the input or output volume from PA, but the mixer's volume is not changed, only PA's soft-volume is changed. Checking the amixer controls for the sound card in the WD19, it supports MixerElem, Volume and Switch, and checking the sound card in the WD15, it doesn't have Volume and Switch for Headphone and Line, So adding the volume and switch control in the ucm conditionally. Signed-off-by: Hui Wang BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/47 Signed-off-by: Jaroslav Kysela --- ucm2/USB-Audio/Dell-WD15-Dock-HiFi.conf | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/ucm2/USB-Audio/Dell-WD15-Dock-HiFi.conf b/ucm2/USB-Audio/Dell-WD15-Dock-HiFi.conf index 2f625e4..04355a7 100644 --- a/ucm2/USB-Audio/Dell-WD15-Dock-HiFi.conf +++ b/ucm2/USB-Audio/Dell-WD15-Dock-HiFi.conf @@ -4,6 +4,18 @@ SectionDevice."Headphones" { Value { PlaybackPriority 100 PlaybackPCM "hw:${CardId}" + + If.Headphone_ctl { + Condition { + Type ControlExists + Control "name='Headphone Playback Switch'" + } + True { + PlaybackMixerElem "Headphone" + PlaybackVolume "Headphone Playback Volume" + PlaybackSwitch "Headphone Playback Switch" + } + } } } @@ -13,6 +25,18 @@ SectionDevice."Line" { Value { PlaybackPriority 200 PlaybackPCM "hw:${CardId},1" + + If.Line_ctl { + Condition { + Type ControlExists + Control "name='Line Playback Switch'" + } + True { + PlaybackMixerElem "Line" + PlaybackVolume "Line Playback Volume" + PlaybackSwitch "Line Playback Switch" + } + } } } @@ -22,5 +46,17 @@ SectionDevice."Mic" { Value { CapturePriority 100 CapturePCM "hw:${CardId}" + + If.Mic_ctl { + Condition { + Type ControlExists + Control "name='Mic Capture Switch'" + } + True { + CaptureMixerElem "Mic" + CaptureVolume "Mic Capture Volume" + CaptureSwitch "Mic Capture Switch" + } + } } } -- 2.47.1