Skip to content

Instantly share code, notes, and snippets.

@HNJAMeindersma
Created March 22, 2020 14:38
Show Gist options
  • Save HNJAMeindersma/5e0fe715c0c5173852574cdb28eac6b8 to your computer and use it in GitHub Desktop.
Save HNJAMeindersma/5e0fe715c0c5173852574cdb28eac6b8 to your computer and use it in GitHub Desktop.
[Behringer X32 / Midas M32] Split a multi-channel X-USB into virtual outputs with PulseAudio on Linux/Ubuntu

X32/M32 with X-USB on Linux/Ubuntu

This guide is written for all owners of a Behringer X32 or Midas M32 with a X-USB 32x32 channel expansion card. It is directed towards splitting the X-USB channels up in virtual outputs on Ubuntu 18.04 with PulseAudio. The guide may also work for other versions or distro's of Linux with PulseAudio.

It is assumed that the X-USB is installed and connected to a computer. And automatically recognized as a multi-channel soundcard by the operating system. Also note that on Ubuntu 18.04, PulseAudio runs on top of ALSA. ALSA picks up the soundcard and PulseAudio then uses the full soundcard through ALSA to create virtual channels.

Table of contents

  1. Find X-USB device name
  2. Create virtual outputs in PulseAudio
  3. Restart PulseAudio
  4. Control application channel

The following sources were used to create this guide:


Step 1: find X-USB device name

First you need to get the device name of your X-USB soundcard. Open a terminal window and run pacmd list-sinks. The device name should look something like this: alsa_output.usb-BEHRINGER_X-USB_xxyyxxyy-00.multichannel-output.

Step 2: create virtual outputs in PulseAudio

Now open the configuration file of PulseAudio, usually located at /etc/pulse/default.pa, as the root user. At the bottom of the configuration file add and adjust one of the examples below.

Stereo channels: this example uses the first four channels of the multi-channel soundcard to create two virtual stereo output pairs:

load-module module-remap-sink sink_name=XUSB12 sink_properties="device.description='X-USB channel 1+2'" remix=no master=alsa_output.usb-BEHRINGER_X-USB_xxyyxxyy-00.multichannel-output channels=2 master_channel_map=front-left,front-right channel_map=front-left,front-right

load-module module-remap-sink sink_name=XUSB34 sink_properties="device.description='X-USB channel 3+4'" remix=no master=alsa_output.usb-BEHRINGER_X-USB_xxyyxxyy-00.multichannel-output channels=2 master_channel_map=rear-left,rear-right channel_map=front-left,front-right

Mono channels: this example uses the first two channels of the multi-channel soundcard to create two virtual mono outputs:

load-module module-remap-sink sink_name=XUSB1 sink_properties="device.description='X-USB channel 1'" remix=no master=alsa_output.usb-BEHRINGER_X-USB_xxyyxxyy-00.multichannel-output channels=1 master_channel_map=front-left channel_map=front-left

load-module module-remap-sink sink_name=XUSB2 sink_properties="device.description='X-USB channel 2'" remix=no master=alsa_output.usb-BEHRINGER_X-USB_xxyyxxyy-00.multichannel-output channels=1 master_channel_map=front-right channel_map=front-left

Configuration parameters
  • Create a unique name for the virtual output under sink_name=XUSBxyz
  • Create a friendly name for the virtual output undersink_properties="device.description='X-USB channel xyz'"
  • Add the device name under master=alsa_output.usb-BEHRINGER_X-USB_xxyyxxyy-00.multichannel-output
  • Specify amount of channels to create under channels=2
  • Address the channel names of the multi-channel soundcard under master_channel_map=xyz,xyz
  • Address the channel names to represent on the virtual output under channel_map=front-left,front-right
Addressing

Note that you must address (master_channel_map) the names of the channels of the multi-channel soundcard you want to used. As well as the names of channels you want them to represent them on the virtual output (channel_map). For the virtual output you almost always want to start with the first channel every time. Use these names corresponding to the channel numbers:

# Name # Name # Name # Name
Channel 1 front-left Channel 9 aux0 Channel 17 aux8 Channel 25 aux16
Channel 2 front-right Channel 10 aux1 Channel 18 aux9 Channel 26 aux17
Channel 3 rear-left Channel 11 aux2 Channel 19 aux10 Channel 27 aux18
Channel 4 rear-right Channel 12 aux3 Channel 20 aux11 Channel 28 aux19
Channel 5 front-center Channel 13 aux4 Channel 21 aux12 Channel 29 aux20
Channel 6 lfe Channel 14 aux5 Channel 22 aux13 Channel 30 aux21
Channel 7 side-left Channel 15 aux6 Channel 23 aux14 Channel 31 aux22
Channel 8 side-right Channel 16 aux7 Channel 24 aux15 Channel 32 aux23

Save the file when done adding the lines for the virtual outputs.

Step 3: restart PulseAudio

To restart PulseAudio without having to restart the computer run the following commands:

pulseaudio -k

pulseaudio -D

Step 4: control application channel

Use PulseAudio Volume Control to easily control which application sends audio to which output. In the playback tab of the control panel you can select the virtual output per application.

Control application channel

Install PulseAudio Volume Control with the following command:

sudo apt-get install pavucontrol

@EliasB-NU
Copy link

Thanks for this guide, works perfectly fine on my Arch machine!!!

@HNJAMeindersma
Copy link
Author

Thanks for this guide, works perfectly fine on my Arch machine!!!

You're welcome! I'm planning on writing some kind of system service/watchdog that restarts PulseAudio automatically on (dis)connecting a X32/M32 USB card.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment