From 65aae1a79e0cf26987f48daa188508fc75cc7bef Mon Sep 17 00:00:00 2001 From: Shuming Fan Date: Mon, 15 Nov 2021 11:43:12 +0800 Subject: [PATCH] ucm2: Add UCM support for Dell Desktop The Dell Desktop uses two USB audio codecs as front and rear panel. The front UAC has two outputs of speaker/headphone and one input of headset mic. The rear UAC has one output of line-out. BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/120 Signed-off-by: Shuming Fan Signed-off-by: Jaroslav Kysela --- .../USB-Audio/Dell-Desktop-Front-Headset.conf | 21 +++++++++++++ .../USB-Audio/Dell-Desktop-Front-Speaker.conf | 10 +++++++ ucm2/USB-Audio/Dell-Desktop-Front.conf | 11 +++++++ ucm2/USB-Audio/Dell-Desktop-Rear-Line.conf | 10 +++++++ ucm2/USB-Audio/Dell-Desktop-Rear.conf | 6 ++++ ucm2/USB-Audio/USB-Audio.conf | 30 +++++++++++++++++++ 6 files changed, 88 insertions(+) create mode 100644 ucm2/USB-Audio/Dell-Desktop-Front-Headset.conf create mode 100644 ucm2/USB-Audio/Dell-Desktop-Front-Speaker.conf create mode 100644 ucm2/USB-Audio/Dell-Desktop-Front.conf create mode 100644 ucm2/USB-Audio/Dell-Desktop-Rear-Line.conf create mode 100644 ucm2/USB-Audio/Dell-Desktop-Rear.conf create mode 100644 ucm2/USB-Audio/USB-Audio.conf diff --git a/ucm2/USB-Audio/Dell-Desktop-Front-Headset.conf b/ucm2/USB-Audio/Dell-Desktop-Front-Headset.conf new file mode 100644 index 0000000..ae77396 --- /dev/null +++ b/ucm2/USB-Audio/Dell-Desktop-Front-Headset.conf @@ -0,0 +1,21 @@ +SectionDevice."Headphones" { + Comment "Headset/Headphones" + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},1" + JackControl "Headphone - Output Jack" + PlaybackMixerElem "Headphone" + } +} + +SectionDevice."Microphone" { + Comment "Microphone" + + Value { + CapturePriority 200 + CapturePCM "hw:${CardId}" + JackControl "Mic - Input Jack" + CaptureMixerElem "Mic" + } +} diff --git a/ucm2/USB-Audio/Dell-Desktop-Front-Speaker.conf b/ucm2/USB-Audio/Dell-Desktop-Front-Speaker.conf new file mode 100644 index 0000000..89faf39 --- /dev/null +++ b/ucm2/USB-Audio/Dell-Desktop-Front-Speaker.conf @@ -0,0 +1,10 @@ +SectionDevice."Speaker" { + Comment "Built-in Speaker" + + Value { + PlaybackPriority 100 + PlaybackPCM "hw:${CardId}" + JackControl "Speaker - Output Jack" + PlaybackMixerElem "Speaker" + } +} diff --git a/ucm2/USB-Audio/Dell-Desktop-Front.conf b/ucm2/USB-Audio/Dell-Desktop-Front.conf new file mode 100644 index 0000000..4c6f9f9 --- /dev/null +++ b/ucm2/USB-Audio/Dell-Desktop-Front.conf @@ -0,0 +1,11 @@ +Syntax 2 +Comment "USB-audio on the front of Dell Desktop" +SectionUseCase."Speaker" { + Comment "Internal Speaker" + File "Dell-Desktop-Front-Speaker.conf" +} + +SectionUseCase."Headset" { + Comment "Front Headset" + File "Dell-Desktop-Front-Headset.conf" +} diff --git a/ucm2/USB-Audio/Dell-Desktop-Rear-Line.conf b/ucm2/USB-Audio/Dell-Desktop-Rear-Line.conf new file mode 100644 index 0000000..f3edfd9 --- /dev/null +++ b/ucm2/USB-Audio/Dell-Desktop-Rear-Line.conf @@ -0,0 +1,10 @@ +SectionDevice."Line" { + Comment "Line Out" + + Value { + PlaybackPriority 100 + PlaybackPCM "hw:${CardId}" + JackControl "Line - Output Jack" + PlaybackMixerElem "PCM" + } +} diff --git a/ucm2/USB-Audio/Dell-Desktop-Rear.conf b/ucm2/USB-Audio/Dell-Desktop-Rear.conf new file mode 100644 index 0000000..3c1f87b --- /dev/null +++ b/ucm2/USB-Audio/Dell-Desktop-Rear.conf @@ -0,0 +1,6 @@ +Syntax 2 +Comment "USB-audio on the rear of Dell Desktop" +SectionUseCase."Line" { + Comment "Line Out" + File "Dell-Desktop-Rear-Line.conf" +} diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf new file mode 100644 index 0000000..a3b1cf3 --- /dev/null +++ b/ucm2/USB-Audio/USB-Audio.conf @@ -0,0 +1,30 @@ +Syntax 3 + +Define.ProfileName "" + +If.dell-desktop-front { + Condition { + Type String + Haystack "${CardComponents}" + Needle "USB0bda:4c54" + } + True.Define.ProfileName "Dell-Desktop-Front" +} + +If.dell-desktop-rear { + Condition { + Type String + Haystack "${CardComponents}" + Needle "USB0bda:4c55" + } + True.Define.ProfileName "Dell-Desktop-Rear" +} + +If.inc { + Condition { + Type String + Empty "${var:ProfileName}" + } + True.Error "UCM is not supported for this USB device (${CardLongName} @ ${CardComponents})" + False.Include.prof.File "${var:ProfileName}.conf" +} -- 2.47.1