OSDN Git Service

USB-Audio: Dell-WD15-Dock: make input and output volume adjustable
authorHui Wang <hui.wang@canonical.com>
Mon, 17 Aug 2020 04:37:44 +0000 (12:37 +0800)
committerJaroslav Kysela <perex@perex.cz>
Tue, 18 Aug 2020 15:34:31 +0000 (17:34 +0200)
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 <hui.wang@canonical.com>
BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/47
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/USB-Audio/Dell-WD15-Dock-HiFi.conf

index 2f625e4..04355a7 100644 (file)
@@ -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"
+                       }
+               }
        }
 }