From 53d473d55ff1359dd29eee705ba4465fe21aec96 Mon Sep 17 00:00:00 2001 From: Gabriel de Perthuis Date: Wed, 22 Jun 2022 17:55:12 +0200 Subject: [PATCH 1/2] Allow direct cards that only work in one direction Allow DirectCaptureChannels or DirectPlaybackChannels to be left undefined. --- ucm2/common/direct-verb.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ucm2/common/direct-verb.conf b/ucm2/common/direct-verb.conf index 55204a28..d069fc22 100644 --- a/ucm2/common/direct-verb.conf +++ b/ucm2/common/direct-verb.conf @@ -4,7 +4,7 @@ SectionDevice."Direct" { If.p { Condition { Type String - Empty "${var:DirectPlaybackChannels}" + Empty "${var:-DirectPlaybackChannels}" } False { PlaybackPriority 1000 @@ -15,7 +15,7 @@ SectionDevice."Direct" { If.c { Condition { Type String - Empty "${var:DirectCaptureChannels}" + Empty "${var:-DirectCaptureChannels}" } False { CapturePriority 1000 From 9d37282d1f5f3cfa4d8ade863e37f5669ea5683c Mon Sep 17 00:00:00 2001 From: Gabriel de Perthuis Date: Wed, 22 Jun 2022 18:00:18 +0200 Subject: [PATCH 2/2] Add support for the Traktor Kontrol Z1 This is a small DJ mixer with a main output and a monitor output. The outputs appear as a single subdevice, we use the SplitPCM macros to present separate outputs. https://www.native-instruments.com/en/products/traktor/dj-controllers/traktor-kontrol-z1/specifications/ --- .../Traktor-Kontrol-Z1-Mixer.conf | 52 +++++++++++++++++++ .../NativeInstruments/Traktor-Kontrol-Z1.conf | 11 ++++ ucm2/USB-Audio/USB-Audio.conf | 9 ++++ 3 files changed, 72 insertions(+) create mode 100644 ucm2/USB-Audio/NativeInstruments/Traktor-Kontrol-Z1-Mixer.conf create mode 100644 ucm2/USB-Audio/NativeInstruments/Traktor-Kontrol-Z1.conf diff --git a/ucm2/USB-Audio/NativeInstruments/Traktor-Kontrol-Z1-Mixer.conf b/ucm2/USB-Audio/NativeInstruments/Traktor-Kontrol-Z1-Mixer.conf new file mode 100644 index 00000000..2199b5df --- /dev/null +++ b/ucm2/USB-Audio/NativeInstruments/Traktor-Kontrol-Z1-Mixer.conf @@ -0,0 +1,52 @@ +Include.pcm_split.File "/common/pcm/split.conf" + +Macro [ + { + SplitPCM { + Name "z1_stereo_out" + Direction Playback + Channels 2 + HWChannels 4 + HWChannelPos0 FL + HWChannelPos1 FR + HWChannelPos2 FL + HWChannelPos3 FR + } + } +] + +SectionDevice."Line" { + Comment "Line Out" + + Value { + PlaybackPriority 200 + } + Macro.pcm_split.SplitPCMDevice { + Name "z1_stereo_out" + Direction Playback + HWChannels 4 + Channels 2 + Channel0 0 + Channel1 1 + ChannelPos0 FL + ChannelPos1 FR + } +} + +SectionDevice."Headphone" { + Comment "Headphone Out" + Value { + PlaybackPriority 100 + } + Macro.pcm_split.SplitPCMDevice { + Name "z1_stereo_out" + Direction Playback + HWChannels 4 + Channels 2 + Channel0 2 + Channel1 3 + ChannelPos0 FL + ChannelPos1 FR + } +} + diff --git a/ucm2/USB-Audio/NativeInstruments/Traktor-Kontrol-Z1.conf b/ucm2/USB-Audio/NativeInstruments/Traktor-Kontrol-Z1.conf new file mode 100644 index 00000000..e88b4eaf --- /dev/null +++ b/ucm2/USB-Audio/NativeInstruments/Traktor-Kontrol-Z1.conf @@ -0,0 +1,11 @@ +Comment "Traktor Kontrol Z1" + +SectionUseCase."Mixer" { + Comment "Default" + File "/USB-Audio/NativeInstruments/Traktor-Kontrol-Z1-Mixer.conf" +} + +Define.DirectPlaybackChannels 2 + +Include.dhw.File "/common/direct.conf" + diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf index 689982ee..e74069b7 100644 --- a/ucm2/USB-Audio/USB-Audio.conf +++ b/ucm2/USB-Audio/USB-Audio.conf @@ -157,6 +157,15 @@ If.lenovo-p620-main { True.Define.ProfileName "Lenovo/ThinkStation-P620-Main" } +If.kontrolz1 { + Condition { + Type String + Haystack "${CardComponents}" + Needle "USB17cc:1210" + } + True.Define.ProfileName "NativeInstruments/Traktor-Kontrol-Z1" +} + If.minifuse2 { Condition { Type String