Skip to content

Commit e2123aa

Browse files
committed
USB-Audio: Improve support for Focusrite 4th Gen devices
There are 4 capture channels (additional ones for mixer monitor). Closes: #515 Closes: #516 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
1 parent a0d06a6 commit e2123aa

File tree

2 files changed

+96
-21
lines changed

2 files changed

+96
-21
lines changed

ucm2/USB-Audio/Focusrite/Scarlett-2i-HiFi.conf

Lines changed: 81 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,42 @@
11
Include.pcm_split.File "/common/pcm/split.conf"
22

3-
Macro [
4-
{
5-
SplitPCM {
6-
Name "scarlett2i_mono_in"
7-
Direction Capture
8-
Format S32_LE
9-
Channels 1
10-
HWChannels 2
11-
HWChannelPos0 MONO
12-
HWChannelPos1 MONO
13-
}
3+
If.cch4 {
4+
Condition {
5+
Type String
6+
String1 "${var:CaptureChannels}"
7+
String2 "4"
148
}
15-
]
9+
True.Macro [
10+
{
11+
SplitPCM {
12+
Name "scarlett2i_mono_in"
13+
Direction Capture
14+
Format S32_LE
15+
Channels 1
16+
HWChannels 4
17+
HWChannelPos0 MONO
18+
HWChannelPos1 MONO
19+
HWChannelPos2 MONO
20+
HWChannelPos3 MONO
21+
}
22+
}
23+
]
24+
False.Macro [
25+
{
26+
SplitPCM {
27+
Name "scarlett2i_mono_in"
28+
Direction Capture
29+
Format S32_LE
30+
Channels 1
31+
HWChannels 2
32+
HWChannelPos0 MONO
33+
HWChannelPos1 MONO
34+
}
35+
}
36+
]
37+
}
1638

17-
If.2i4 {
39+
If.pch4 {
1840
Condition {
1941
Type String
2042
String1 "${var:PlaybackChannels}"
@@ -65,7 +87,7 @@ SectionDevice."Line1" {
6587
}
6688
}
6789

68-
If.2i4 {
90+
If.line2 {
6991
Condition {
7092
Type String
7193
String1 "${var:PlaybackChannels}"
@@ -94,12 +116,12 @@ SectionDevice."Mic1" {
94116
Comment "${var:Capture1Name}"
95117

96118
Value {
97-
CapturePriority 200
119+
CapturePriority 400
98120
}
99121
Macro.pcm_split.SplitPCMDevice {
100122
Name "scarlett2i_mono_in"
101123
Direction Capture
102-
HWChannels 2
124+
HWChannels "${var:CaptureChannels}"
103125
Channels 1
104126
Channel0 0
105127
ChannelPos0 MONO
@@ -110,14 +132,55 @@ SectionDevice."Mic2" {
110132
Comment "${var:Capture2Name}"
111133

112134
Value {
113-
CapturePriority 100
135+
CapturePriority 300
114136
}
115137
Macro.pcm_split.SplitPCMDevice {
116138
Name "scarlett2i_mono_in"
117139
Direction Capture
118-
HWChannels 2
140+
HWChannels "${var:CaptureChannels}"
119141
Channels 1
120142
Channel0 1
121143
ChannelPos0 MONO
122144
}
123145
}
146+
147+
If.cap4 {
148+
Condition {
149+
Type String
150+
String1 "${var:CaptureChannels}"
151+
String2 "4"
152+
}
153+
True {
154+
SectionDevice."Line3" {
155+
Comment "${var:Capture3Name}"
156+
157+
Value {
158+
CapturePriority 200
159+
}
160+
Macro.pcm_split.SplitPCMDevice {
161+
Name "scarlett2i_mono_in"
162+
Direction Capture
163+
HWChannels "${var:CaptureChannels}"
164+
Channels 1
165+
Channel0 0
166+
ChannelPos0 MONO
167+
}
168+
}
169+
170+
SectionDevice."Line4" {
171+
Comment "${var:Capture4Name}"
172+
173+
Value {
174+
CapturePriority 100
175+
}
176+
Macro.pcm_split.SplitPCMDevice {
177+
Name "scarlett2i_mono_in"
178+
Direction Capture
179+
HWChannels "${var:CaptureChannels}"
180+
Channels 1
181+
Channel0 1
182+
ChannelPos0 MONO
183+
}
184+
}
185+
}
186+
}

ucm2/USB-Audio/Focusrite/Scarlett-2i.conf

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
Define {
22
PlaybackChannels 2
3-
DirectPlaybackChannels 2
4-
DirectCaptureChannels 2
3+
CaptureChannels 2
54
Model "2i2"
65
Playback1Name "Headphones / Line 1-2"
76
Playback2Name "Line 3-4"
@@ -61,7 +60,12 @@ If.gen4 {
6160
String "${CardComponents}"
6261
Regex "USB1235:821[89]"
6362
}
64-
True.Define.Generation "4th"
63+
True.Define {
64+
Generation "4th"
65+
CaptureChannels 4
66+
Capture3Name "Input 3 Monitor"
67+
Capture4Name "Input 4 Monitor"
68+
}
6569
}
6670

6771
Comment "Focusrite Scarlett ${var:Model} ${var:Generation} Gen"
@@ -71,4 +75,12 @@ SectionUseCase."HiFi" {
7175
File "/USB-Audio/Focusrite/Scarlett-2i-HiFi.conf"
7276
}
7377

78+
If.dhw {
79+
Condition { Type AlwaysTrue }
80+
True.Define {
81+
DirectPlaybackChannels "${var:PlaybackChannels}"
82+
DirectCaptureChannels "${var:CaptureChannels}"
83+
}
84+
}
85+
7486
Include.dhw.File "/common/direct.conf"

0 commit comments

Comments
 (0)