JACK & Creative X-Fi

Something that’s really cool about GNU/Linux is that almost any part of the operating system can be switched out with an alternative. Most users who have not used the OS for very long usually do not want that or don’t know about that.

When I first used Ubuntu as my sole operating system I also had no idea that most of what you look at on a day to day basis is just a couple of packages that can be switched out for dozens of alternatives. So I eventually found out what window managers, compositors, display managers and desktop environments are.

I eventually also had to deal with the issue of audio. Nowadays there’s not much to say about it. If you don’t care you use Pulseaudio, if you’re picky you only use ALSA and if you’re into audio production you use JACK. I recently switched to the later, because I have a dedicated sound card that I wanted to put to some good use.

The last time I looked at JACK I immediately stopped because it seemed way too much effort to get to work compared to the simplicity of Pulseaudio, which basically works on its own. This time I went with Cadence which makes configuring JACK a lot easier. It’s available in the AUR and gets you up and running with JACK fairly easily.

Cadence running on Arch

The first thing you need to to when trying to use JACK and the Creative X-Fi card (in my case it’s the Xtreme Music) is to properly configure the device. This is what the “Driver” tab of the JACK Settings dialog looks like for me in Cadence:

With all that setup, you can now use JACK as your main audio interface. If you want you can enable the Pulseaudio bridge, which will make sure that all applications that only support Pulse, will properly be bridged to JACK.

Now that JACK is running you can enjoy the advantages of Catia, which is a Patchbay shipped with Cadence or if you want experiment with Claudia, which is a frontend for LADISH, but I haven’t used that.

With the Patchbay I can now decide which audio goes where, for example when using OBS Studio I only use JACK input clients, which allow me to route Music played by MPD to be directly routed to OBS, so I can play music on stream without having to record my desktop audio. The music also goes directly to my system audio, which is my headphones. A setup like this would be a lot more cumbersome on Windows, as it would require something like VoiceMeeter.

If you want MPD to output to JACK you’ll need to create a new audio output in your mpd config:

audio_output { 
 type "jack" 
 name "jack" 
 mixer_type "software" 
 client_name "mpd" 
 server_name "default" 
 source_ports "out_1,out_2" 
 autostart "yes" 
}

This will make MPD open a new JACK client named “mpd” with two output ports. Sadly not all programs support JACK, which means that they’ll still run over either ALSA or Pulse. If they use ALSA, they’ll show up as individual clients in the Patchbay, but if they use Pulse you can’t really configure them in the patchbay, if you still want that kind of control you will have to create multiple Pulseaudio bridges, one for each Pulse application that you want to manage:

pactl load-module module-jack-source client_name=discord_mic connect=no

This command will create a new microphone source called “discord_mic”, which allows me to selected it as a microphone in discord, which means that I have a separate device just for VoIP. You could do the same for sound with

pactl load-module module-jack-sink client_name=pulse_sink_2 connect=yes

this would allow you to route all sound that gets output to “pulse_sink_2” only to your headphones, so that for example recording software will not pick it up, because it will only record your default pulse sink.

All of this obviously doesn’t come for free, the more complex the audio setup becomes the more latency you’ll get. For most people that isn’t really a problem because they don’t need real time audio processing, but if you have a face cam or use a DAW even a smalledelay will get annoying really fast.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s