Skip to content

Commit

Permalink
USB-Audio: add GoXLR configuration
Browse files Browse the repository at this point in the history
This hardware has multichannel output and input, but it's expected
to work in separate stereo groups.

Use dsnoop/dshare alsa-lib plugins to split the multichannel stream to
stereo devices.

Fixes: #121
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
  • Loading branch information
perexg committed Nov 22, 2021
1 parent b34b66c commit 97beee6
Show file tree
Hide file tree
Showing 3 changed files with 214 additions and 1 deletion.
199 changes: 199 additions & 0 deletions ucm2/USB-Audio/GoXLR/GoXLR-HiFi.conf
@@ -0,0 +1,199 @@
LibraryConfig.pcm.Config {

pcm.goxlr_stereo_out {
@args [ CARD CHN0 CHN1 ]
@args {
CARD.type string
CHN0.type integer
CHN1.type integer
}
type dshare
ipc_key 5678493
ipc_perm 0600
slave {
pcm {
type hw
card $CARD
device 0
}
channels 10
}
bindings.0 $CHN0
bindings.1 $CHN1
}

pcm.goxlr_stereo_in {
@args [ CARD CHN0 CHN1 ]
@args {
CARD.type string
CHN0.type integer
CHN1.type integer
}
type dsnoop
ipc_key 5678593
ipc_perm 0600
slave {
pcm {
type hw
card $CARD
device 0
}
channels 23
}
bindings.0 $CHN0
bindings.1 $CHN1
}

pcm.goxlr_system {
@args [ CARD ]
@args.CARD.type string
type empty
slave.pcm {
@func concat
strings [ "goxlr_stereo_out:" $CARD ",0,1" ]
}
}

pcm.goxlr_game {
@args [ CARD ]
@args.CARD.type string
type empty
slave.pcm {
@func concat
strings [ "goxlr_stereo_out:" $CARD ",2,3" ]
}
}

pcm.goxlr_chat {
@args [ CARD ]
@args.CARD.type string
type empty
slave.pcm {
@func concat
strings [ "goxlr_stereo_out:" $CARD ",4,5" ]
}
}

pcm.goxlr_music {
@args [ CARD ]
@args.CARD.type string
type empty
slave.pcm {
@func concat
strings [ "goxlr_stereo_out:" $CARD ",6,7" ]
}
}

pcm.goxlr_sample {
@args [ CARD ]
@args.CARD.type string
type empty
slave.pcm {
@func concat
strings [ "goxlr_stereo_out:" $CARD ",8,9" ]
}
}

pcm.goxlr_mix {
@args [ CARD ]
@args.CARD.type string
type empty
slave.pcm {
@func concat
strings [ "goxlr_stereo_in:" $CARD ",0,1" ]
}
}

pcm.goxlr_chatmic {
@args [ CARD ]
@args.CARD.type string
type empty
slave.pcm {
@func concat
strings [ "goxlr_stereo_in:" $CARD ",2,3" ]
}
}

pcm.goxlr_sample_input {
@args [ CARD ]
@args.CARD.type string
type empty
slave.pcm {
@func concat
strings [ "goxlr_stereo_in:" $CARD ",16,17" ]
}
}

}

SectionDevice."Speaker" {
Comment "System"

Value {
PlaybackPriority 100
PlaybackPCM "goxlr_system:${CardId}"
}
}

SectionDevice."Line1" {
Comment "Game"

Value {
PlaybackPriority 300
PlaybackPCM "goxlr_game:${CardId}"
}
}

SectionDevice."Line2" {
Comment "Music"

Value {
PlaybackPriority 400
PlaybackPCM "goxlr_music:${CardId}"
}
}

SectionDevice."Headphones" {
Comment "Chat"

Value {
PlaybackPriority 200
PlaybackPCM "goxlr_chat:${CardId}"
}
}

SectionDevice."Line3" {
Comment "Sample"

Value {
PlaybackPriority 500
PlaybackPCM "goxlr_sample:${CardId}"
}
}

SectionDevice."Line4" {
Comment "Broadcast Stream Mix"

Value {
CapturePriority 200
CapturePCM "goxlr_mix:${CardId}"
}
}

SectionDevice."Headset" {
Comment "Chat Mic"

Value {
CapturePriority 100
CapturePCM "goxlr_chatmic:${CardId}"
}
}

SectionDevice."Line5" {
Comment "Sample"

Value {
CapturePriority 300
CapturePCM "goxlr_sample_input:${CardId}"
}
}
5 changes: 5 additions & 0 deletions ucm2/USB-Audio/GoXLR/GoXLR.conf
@@ -0,0 +1,5 @@
Comment "GoXLR USB-Audio"
SectionUseCase."HiFi" {
Comment "Default Alsa Profile"
File "GoXLR/GoXLR-HiFi.conf"
}
11 changes: 10 additions & 1 deletion ucm2/USB-Audio/USB-Audio.conf
@@ -1,4 +1,4 @@
Syntax 3
Syntax 4

Define.ProfileName ""

Expand Down Expand Up @@ -29,6 +29,15 @@ If.dell-desktop-rear {
True.Define.ProfileName "Dell/Desktop-Rear"
}

If.goxlr {
Condition {
Type RegexMatch
String "${CardComponents}"
Regex "USB1220:8fe[04]"
}
True.Define.ProfileName "GoXLR/GoXLR"
}

If.inc {
Condition {
Type String
Expand Down

0 comments on commit 97beee6

Please sign in to comment.