HomeAudio › Connecting multiple sound devices with JACK and ALSA

Connecting multiple sound devices with JACK and ALSA

The problem: JACK connects to one (generally the default) sound device, but you may have a second (third, fourth, etc) device that you want to record from or playback on.

Example situation (Actually, my situation):
Device #1: The NVidia sound card built in to the PC/Laptop.
Device #2: Guitar amplifier connected via USB
Device #3: USB headset/microphone.

Software I use:
(Note that this is all free software for Linux, versions may exist for other operating systems)

  • QJackCtl – essentially to start/stop JACK
  • Patchage – Used for making the connections between devices
  • alsa_in/alsa_out – Used to add the extra sound devices for JACK. If you installed JACK, you should have these command line programs
  • Ardour – for recording the tracks
  • aplay and arecord – part of the alsa-utils package

First Steps

Before starting anything, connect the devices, and use aplay and arecord to list what our devices are:
To list the playback devices:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: CONEXANT Analog [CONEXANT Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: LX3000 [Microsoft LifeChat LX-3000], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

And the capture devices:

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: CONEXANT Analog [CONEXANT Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: LX3000 [Microsoft LifeChat LX-3000], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Amplifier [Mustang Amplifier], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Now, to translate this into standard ALSA lingo, the NVidia built-in device is card0, so we will refer to it as HW0, The M$ LX-3000 headset is card 1, thus referred to as HW1, and the Fender Mustang Amp is HW2.

Okay, so now running QJackCtl and clicking “Start” should get JACK running on HW0, the built-in sound device (Assuming it’s still at default settings). If you now start Patchage, you should see something like the following:
patchage_ss1
Now for the fun part; let’s get the input from the amplifier connected. Open up a terminal and run “alsa_in -j Amplifier -d HW:2″ and you should see something like:

$ alsa_in -j Amplifier -d hw:2
selected sample format: 16bit
delay = 4094
delay = 1019

Don’t worry if you get a couple of those “delay” messages when it first starts up.
Now, let’s get the mic on the headset connected:

$ alsa_in -j Mic -d hw:1
WARNING: chennel count does not match (requested 2 got 1)
selected sample format: 16bit
delay = 3255

Note the message about channel count – that’s just because it defaults to 2, if you don’t like seeing the message you can add a “-c 1″ to the command.

Now the last thing, the headset speakers:

$ alsa_out -j Headphones -d hw:1 -r 44100
selected sample format: 16bit

Note that I added a “-r 44100″ – in my situation everything else defaults to 44100, but the headset defaults to 48000 and sounds like crap.

Now, let’s check on what it looks like in Patchage now:

patchage_ss2

Now we’re getting somewhere!

So now, I’ll fire up Ardour and add a couple tracks – 1 stereo track for the guitar and one mono track for the vocals. (I normally also use Hydrogen for a drum track as well, but I’ll skip that in the interest of keeping this shorter) Once that’s done, we’ll make the connections in Patchage by right-clicking on items that are connected automatically that we don’t want and selecting “Disconnect All”, then dragging the mouse from one device to another to “wire them up”.

Once it’s done, you should see something like the below:
patchage_ss3

I know the connections in Patchage might look a bit confusing, but play around with it a bit and you’ll find it’s pretty intuitive.

And now, you’re ready to Rock!

This post was written by

– who has written 16 posts on DotSlash.ca.
Plain old nerd.

Email  • Google + • Facebook

Share Button

2 Comments.[ Leave a comment ]

  1. Hi there colleagues, how is the whole thing, and what you wish for to say on the topic of this article, in my
    view its actually remarkable for me.

  2. This paragraph will help the internet users for setting up new
    blog or even a weblog from start to end.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>