From 3a796b6297362497770aab4021e12bf6ccc0ab3d Mon Sep 17 00:00:00 2001 From: brndd Date: Sun, 12 Dec 2021 09:19:06 +0200 Subject: [PATCH 1/8] Add profile for Behringer UMC204HD --- ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf | 120 ++++++++++++++++++++ ucm2/USB-Audio/Behringer/UMC204HD.conf | 5 + ucm2/USB-Audio/USB-Audio.conf | 9 ++ 3 files changed, 134 insertions(+) create mode 100644 ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf create mode 100644 ucm2/USB-Audio/Behringer/UMC204HD.conf diff --git a/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf b/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf new file mode 100644 index 00000000..c224280a --- /dev/null +++ b/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf @@ -0,0 +1,120 @@ +LibraryConfig.pcm.Config { + pcm.umc204hd_stereo_out { + @args [ CARD CHN0 CHN1 ] + @args { + CARD.type string + CHN0.type integer + CHN1.type integer + } + type dshare + ipc_key 572442 + ipc_perm 0600 + slave { + pcm { + type hw + card $CARD + device 0 + } + channels 4 + } + bindings.0 $CHN0 + bindings.1 $CHN1 + } + + pcm.umc204hd_mono_in { + @args [ CARD CHN0 CHN1 ] + @args { + CARD.type string + CHN0.type integer + CHN1.type integer + } + type dsnoop + ipc_key 572542 + ipc_perm 0600 + slave { + pcm { + type hw + card $CARD + device 0 + } + channels 2 + } + bindings.0 $CHN0 + bindings.1 $CHN1 + } + + pcm.umc204hd_line1 { + @args [ CARD ] + @args.CARD.type string + type empty + slave.pcm { + @func concat + strings [ "umc204hd_stereo_out:" $CARD ",0,1" ] + } + } + + pcm.umc204hd_line2 { + @args [ CARD ] + @args.CARD.type string + type empty + slave.pcm { + @func concat + strings [ "umc204hd_stereo_out:" $CARD ",2,3" ] + } + } + + pcm.umc204hd_mic1 { + @args [ CARD ] + @args.CARD.type string + type empty + slave.pcm { + @func concat + strings [ "umc204hd_mono_in:" $CARD ",0,0" ] + } + } + + pcm.umc204hd_mic2 { + @args [ CARD ] + @args.CARD.type string + type empty + slave.pcm { + @func concat + strings [ "umc204hd_mono_in:" $CARD ",1,1" ] + } + } +} + +SectionDevice."Line1" { + Comment "Line A" + Value { + PlaybackPriority 100 + PlaybackPCM "umc204hd_line1:${CardId}" + } +} + +SectionDevice."Line2" { + Comment "Line B" + + Value { + PlaybackPriority 200 + PlaybackPCM "umc204hd_line2:${CardId}" + } +} + +SectionDevice."Mic1" { + Comment "Input 1" + + Value { + CapturePriority 100 + CapturePCM "umc204hd_mic1:${CardId}" + } +} + +SectionDevice."Mic2" { + Comment "Input 2" + + Value { + CapturePriority 200 + CapturePCM "umc204hd_mic2:${CardId}" + } +} diff --git a/ucm2/USB-Audio/Behringer/UMC204HD.conf b/ucm2/USB-Audio/Behringer/UMC204HD.conf new file mode 100644 index 00000000..7eefb599 --- /dev/null +++ b/ucm2/USB-Audio/Behringer/UMC204HD.conf @@ -0,0 +1,5 @@ +Comment "Behringer UMC204HD" +SectionUseCase."HiFi" { + Comment "Default Alsa Profile" + File "Behringer/UMC204HD-HiFi.conf" +} diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf index d9d740ec..a3cb9ce6 100644 --- a/ucm2/USB-Audio/USB-Audio.conf +++ b/ucm2/USB-Audio/USB-Audio.conf @@ -91,6 +91,15 @@ If.lenovo-p620-main { True.Define.ProfileName "Lenovo/ThinkStation-P620-Main" } +If.behringer-umc204hd { + Condition { + Type String + Haystack "${CardComponents}" + Needle "USB1397:0508" + } + True.Define.ProfileName "Behringer/UMC204HD" +} + If.inc { Condition { Type String From 6529192d21f09effdc4d0129e1fd67a6ce8f4ff5 Mon Sep 17 00:00:00 2001 From: brndd Date: Sun, 12 Dec 2021 21:22:29 +0200 Subject: [PATCH 2/8] Fix path --- ucm2/USB-Audio/Behringer/UMC204HD.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucm2/USB-Audio/Behringer/UMC204HD.conf b/ucm2/USB-Audio/Behringer/UMC204HD.conf index 7eefb599..5fe14663 100644 --- a/ucm2/USB-Audio/Behringer/UMC204HD.conf +++ b/ucm2/USB-Audio/Behringer/UMC204HD.conf @@ -1,5 +1,5 @@ Comment "Behringer UMC204HD" SectionUseCase."HiFi" { Comment "Default Alsa Profile" - File "Behringer/UMC204HD-HiFi.conf" + File "/USB-Audio/Behringer/UMC204HD-HiFi.conf" } From ce88a949a83db85c40e928ba003210956c6c30ab Mon Sep 17 00:00:00 2001 From: brndd Date: Wed, 15 Dec 2021 13:13:00 +0200 Subject: [PATCH 3/8] Attempt to add volume controls. --- ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf | 60 +++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf b/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf index c224280a..7bb91668 100644 --- a/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf +++ b/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf @@ -82,6 +82,58 @@ LibraryConfig.pcm.Config { strings [ "umc204hd_mono_in:" $CARD ",1,1" ] } } + + ctl.umc204hd_out { + @args [ CARD ] + @args.CARD.type string + type remap + child { + type hw + card $CARD + } + map { + "name='Line A Playback Volume'"."name='UMC204HD 192k Output Volume'" { + vindex.0 0 + vindex.1 1 + }, + "name='Line A Playback Switch'"."name='UMC204HD 192k Output Switch'" { + vindex.0 0 + vindex.1 1 + }, + "name='Line B Playback Volume'"."name='UMC204HD 192k Output Volume'" { + vindex.0 2 + vindex.1 3 + }, + "name='Line B Playback Switch'"."name='UMC204HD 192k Output Switch'" { + vindex.0 2 + vindex.1 3 + } + } + } + + ctl.umc204hd_in { + @args [ CARD ] + @args.CARD.type string + type remap + child { + type hw + card $CARD + } + map { + "name='Input 1 Recording Volume'"."name='Mic Volume'" { + vindex.0 0 + }, + "name='Input 1 Recording Switch'"."name='Mic Switch'" { + vindex.0 0 + }, + "name='Input 2 Recording Volume'"."name='Mic Volume'" { + vindex.0 1 + }, + "name='Input 2 Recording Switch'"."Name='Mic Switch'" { + vindex.0 1 + } + } + } } SectionDevice."Line1" { @@ -89,6 +141,8 @@ SectionDevice."Line1" { Value { PlaybackPriority 100 PlaybackPCM "umc204hd_line1:${CardId}" + PlaybackCTL "umc204hd_out:${CardId}" + PlaybackMixerElem "UMC204HD 192k Output" } } @@ -98,6 +152,8 @@ SectionDevice."Line2" { Value { PlaybackPriority 200 PlaybackPCM "umc204hd_line2:${CardId}" + PlaybackCTL "umc204hd_out:${CardId}" + PlaybackMixerElem "UMC204HD 192k Output" } } @@ -107,6 +163,8 @@ SectionDevice."Mic1" { Value { CapturePriority 100 CapturePCM "umc204hd_mic1:${CardId}" + CaptureCTL "umc204hd_in:${CardId}" + CaptureMixerElem "Mic" } } @@ -116,5 +174,7 @@ SectionDevice."Mic2" { Value { CapturePriority 200 CapturePCM "umc204hd_mic2:${CardId}" + CaptureCTL "umc204hd_in:${CardId}" + CaptureMixerElem "Mic" } } From 0ba3f919c13290659582c03c4238848f698c1c6f Mon Sep 17 00:00:00 2001 From: brndd Date: Wed, 15 Dec 2021 14:06:39 +0200 Subject: [PATCH 4/8] Make capture mono. --- ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf b/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf index 7bb91668..2419df4e 100644 --- a/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf +++ b/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf @@ -22,11 +22,10 @@ LibraryConfig.pcm.Config { } pcm.umc204hd_mono_in { - @args [ CARD CHN0 CHN1 ] + @args [ CARD CHN0 ] @args { CARD.type string CHN0.type integer - CHN1.type integer } type dsnoop ipc_key 572542 @@ -40,7 +39,6 @@ LibraryConfig.pcm.Config { channels 2 } bindings.0 $CHN0 - bindings.1 $CHN1 } pcm.umc204hd_line1 { @@ -69,7 +67,7 @@ LibraryConfig.pcm.Config { type empty slave.pcm { @func concat - strings [ "umc204hd_mono_in:" $CARD ",0,0" ] + strings [ "umc204hd_mono_in:" $CARD ",0" ] } } @@ -79,7 +77,7 @@ LibraryConfig.pcm.Config { type empty slave.pcm { @func concat - strings [ "umc204hd_mono_in:" $CARD ",1,1" ] + strings [ "umc204hd_mono_in:" $CARD ",1" ] } } @@ -140,6 +138,7 @@ SectionDevice."Line1" { Comment "Line A" Value { PlaybackPriority 100 + PlaybackChannels 2 PlaybackPCM "umc204hd_line1:${CardId}" PlaybackCTL "umc204hd_out:${CardId}" PlaybackMixerElem "UMC204HD 192k Output" @@ -151,6 +150,7 @@ SectionDevice."Line2" { Value { PlaybackPriority 200 + PlaybackChannels 2 PlaybackPCM "umc204hd_line2:${CardId}" PlaybackCTL "umc204hd_out:${CardId}" PlaybackMixerElem "UMC204HD 192k Output" @@ -162,6 +162,7 @@ SectionDevice."Mic1" { Value { CapturePriority 100 + CaptureChannels 1 CapturePCM "umc204hd_mic1:${CardId}" CaptureCTL "umc204hd_in:${CardId}" CaptureMixerElem "Mic" @@ -173,6 +174,7 @@ SectionDevice."Mic2" { Value { CapturePriority 200 + CaptureChannels 1 CapturePCM "umc204hd_mic2:${CardId}" CaptureCTL "umc204hd_in:${CardId}" CaptureMixerElem "Mic" From 25236910103a898860aecbac3bc48351cb22f532 Mon Sep 17 00:00:00 2001 From: brndd Date: Thu, 16 Dec 2021 00:40:52 +0200 Subject: [PATCH 5/8] Change profile name to 'Default' --- ucm2/USB-Audio/Behringer/UMC204HD.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucm2/USB-Audio/Behringer/UMC204HD.conf b/ucm2/USB-Audio/Behringer/UMC204HD.conf index 5fe14663..57219354 100644 --- a/ucm2/USB-Audio/Behringer/UMC204HD.conf +++ b/ucm2/USB-Audio/Behringer/UMC204HD.conf @@ -1,5 +1,5 @@ Comment "Behringer UMC204HD" SectionUseCase."HiFi" { - Comment "Default Alsa Profile" + Comment "Default" File "/USB-Audio/Behringer/UMC204HD-HiFi.conf" } From 01599bd8a8803569bb53670982df4d722937ed63 Mon Sep 17 00:00:00 2001 From: brndd Date: Thu, 16 Dec 2021 00:56:37 +0200 Subject: [PATCH 6/8] Change playback priority; higher value is higher priority. --- ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf b/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf index 2419df4e..9a3a5b19 100644 --- a/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf +++ b/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf @@ -137,7 +137,7 @@ LibraryConfig.pcm.Config { SectionDevice."Line1" { Comment "Line A" Value { - PlaybackPriority 100 + PlaybackPriority 200 PlaybackChannels 2 PlaybackPCM "umc204hd_line1:${CardId}" PlaybackCTL "umc204hd_out:${CardId}" @@ -149,7 +149,7 @@ SectionDevice."Line2" { Comment "Line B" Value { - PlaybackPriority 200 + PlaybackPriority 100 PlaybackChannels 2 PlaybackPCM "umc204hd_line2:${CardId}" PlaybackCTL "umc204hd_out:${CardId}" @@ -161,7 +161,7 @@ SectionDevice."Mic1" { Comment "Input 1" Value { - CapturePriority 100 + CapturePriority 200 CaptureChannels 1 CapturePCM "umc204hd_mic1:${CardId}" CaptureCTL "umc204hd_in:${CardId}" @@ -173,7 +173,7 @@ SectionDevice."Mic2" { Comment "Input 2" Value { - CapturePriority 200 + CapturePriority 100 CaptureChannels 1 CapturePCM "umc204hd_mic2:${CardId}" CaptureCTL "umc204hd_in:${CardId}" From 5f042e5649f427aaf4e6384e3fdad96fda19ea2a Mon Sep 17 00:00:00 2001 From: brndd Date: Thu, 16 Dec 2021 02:01:02 +0200 Subject: [PATCH 7/8] Remove unnecessary ipc_perm definition, as we just defined the default. --- ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf | 2 -- 1 file changed, 2 deletions(-) diff --git a/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf b/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf index 9a3a5b19..bf175f5e 100644 --- a/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf +++ b/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf @@ -8,7 +8,6 @@ LibraryConfig.pcm.Config { } type dshare ipc_key 572442 - ipc_perm 0600 slave { pcm { type hw @@ -29,7 +28,6 @@ LibraryConfig.pcm.Config { } type dsnoop ipc_key 572542 - ipc_perm 0600 slave { pcm { type hw From 858d51f24b2774afcedb03076593ecde67ccdb86 Mon Sep 17 00:00:00 2001 From: brndd Date: Tue, 3 May 2022 20:11:03 +0300 Subject: [PATCH 8/8] Configure controls (again) --- ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf | 44 +++++++-------------- 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf b/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf index bf175f5e..d44c3a0a 100644 --- a/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf +++ b/ucm2/USB-Audio/Behringer/UMC204HD-HiFi.conf @@ -79,7 +79,7 @@ LibraryConfig.pcm.Config { } } - ctl.umc204hd_out { + ctl.umc204hd { @args [ CARD ] @args.CARD.type string type remap @@ -88,44 +88,32 @@ LibraryConfig.pcm.Config { card $CARD } map { - "name='Line A Playback Volume'"."name='UMC204HD 192k Output Volume'" { + 'name="Line A Playback Volume"'.'name="UMC204HD 192k Output Playback Volume"' { vindex.0 0 vindex.1 1 }, - "name='Line A Playback Switch'"."name='UMC204HD 192k Output Switch'" { + 'name="Line A Playback Switch"'.'name="UMC204HD 192k Output Playback Switch"' { vindex.0 0 vindex.1 1 }, - "name='Line B Playback Volume'"."name='UMC204HD 192k Output Volume'" { + 'name="Line B Playback Volume"'.'name="UMC204HD 192k Output Playback Volume"' { vindex.0 2 vindex.1 3 }, - "name='Line B Playback Switch'"."name='UMC204HD 192k Output Switch'" { + 'name="Line B Playback Switch"'.'name="UMC204HD 192k Output Playback Switch"' { vindex.0 2 vindex.1 3 - } - } - } - - ctl.umc204hd_in { - @args [ CARD ] - @args.CARD.type string - type remap - child { - type hw - card $CARD - } - map { - "name='Input 1 Recording Volume'"."name='Mic Volume'" { + }, + 'name="Input 1 Capture Volume"'.'name="Mic Capture Volume"' { vindex.0 0 }, - "name='Input 1 Recording Switch'"."name='Mic Switch'" { + 'name="Input 1 Capture Switch"'.'name="Mic Capture Switch"' { vindex.0 0 }, - "name='Input 2 Recording Volume'"."name='Mic Volume'" { + 'name="Input 2 Capture Volume"'.'name="Mic Capture Volume"' { vindex.0 1 }, - "name='Input 2 Recording Switch'"."Name='Mic Switch'" { + 'name="Input 2 Capture Switch"'.'Name="Mic Capture Switch"' { vindex.0 1 } } @@ -138,8 +126,7 @@ SectionDevice."Line1" { PlaybackPriority 200 PlaybackChannels 2 PlaybackPCM "umc204hd_line1:${CardId}" - PlaybackCTL "umc204hd_out:${CardId}" - PlaybackMixerElem "UMC204HD 192k Output" + PlaybackCTL "umc204hd:${CardId}" } } @@ -150,8 +137,7 @@ SectionDevice."Line2" { PlaybackPriority 100 PlaybackChannels 2 PlaybackPCM "umc204hd_line2:${CardId}" - PlaybackCTL "umc204hd_out:${CardId}" - PlaybackMixerElem "UMC204HD 192k Output" + PlaybackCTL "umc204hd:${CardId}" } } @@ -162,8 +148,7 @@ SectionDevice."Mic1" { CapturePriority 200 CaptureChannels 1 CapturePCM "umc204hd_mic1:${CardId}" - CaptureCTL "umc204hd_in:${CardId}" - CaptureMixerElem "Mic" + CaptureCTL "umc204hd:${CardId}" } } @@ -174,7 +159,6 @@ SectionDevice."Mic2" { CapturePriority 100 CaptureChannels 1 CapturePCM "umc204hd_mic2:${CardId}" - CaptureCTL "umc204hd_in:${CardId}" - CaptureMixerElem "Mic" + CaptureCTL "umc204hd:${CardId}" } }