How to route audio ouput from Ardour to x18?

Hi
I just got an X18 and have installed X-AIR-EDIT and set it up with Ardour 8.11.
The X18 is set as the audio input and output device
I can record on all the channels no problem.
When I play back the recorded tracks, I can see the signal on the Master, which is routed to the Monitor and from there to main out 1&2
But I cant hear any audio from the x18 main outs or headphones when I play back recorded audio tracks.

Does anyone have experience they can share to show me what to do?
Many thanks

I don’t have an X18, but I have a MIDAS MR18, which is the MIDAS version of the Behringer XR18. I’m assuming the routing in the X18 and XR18 is similar.

In X-Air-Edit Go into Setup->Monitor and set Monitor Source to LR, then the Monitor bus will be fed by the XR18 master out.

Then go into In/out->Main Out and select “Monitor” in the “Phones” row.

Then go into In/Out->USB Returns and to which mixer channel the USB input 1/2 from the computer is going and make sure that that channel is unmuted and routed to the main bus.

BTW, do you have set the X18 USB audio interface config (Setup->Audio/MIDI) to 2/2 or 18/18 channels mode?

I believe they are identical, and the only difference is the preamps. I do have an XR18.

I’m going to supplement your answer with some screenshots.

This is an important question. I will assume, for this discussion (until we know otherwise) it’s set to 18/18.

This, is the tricky bit, IMO, because all of the rest of the settings are, pretty much, defaults. And I think this bit takes some explaining,which I will attempt to do.

There’s 7 main busses on the XR18 which are, nominally, called “Main LR”, which is the main stereo bus, and “Bus 1” to “Bus 6” which are mono busses you can use for routing, foldback, etc.

image

You can rename Bus 1-6 and you can also group them into stereo pairs to give you stereo busses. I mention this because I’ve done this on my system, which you will see in the screen shots.

For each of these individual busses (or stereo buses if you have linked them) you have control over the mix and muting of every channel. You see this mix by selecting the bus channel. For instance, if I select my MAIN LR channel, I get this:

You can see from this that all of my faders for channels 1-14 are fully down, so I will get no audio from them to MAIN LR, regardless of whether this is from the PC over USB, or from a device plugged into the channel.

If I select Bus 5 which I have stereo linked with Bus 6 and renamed “SPKR L” and “SPKR R”, I get the mix view for that bus:

So, the trick is to make sure you have channels 1 and 2 unmuted and the levels up when you have MAIN LR selected.

HOWEVER: There’s a gotcha here. The XR18 is a complex beastie with lots of routing (and I may have got this explanation wrong, so please take with a small pinch of salt).

There are 18 channels on the XR18: 18 input and 18 output. But each channel is EITHER a USB input OR a physical input. Physical input 1 and USB channel 1 ARE THE SAME THING. You cannot plug a mic or an instrument into input 1 and use that and then use it to receive audio from the computer at the same time. So if you are using physical inputs 1 & 2, you cannot then use USB channels 1/2 to receive audio from the computer (this isn’t quite true, but bear with me).

The selection for whether the channel is a physical input or a USB-from-the-computer input is on the channel strip:

So, if you are using channels 1 & 2 as physical inputs you should use different channels for audio from the PC.

Now, I said this isn’t quite true, and this is where I’m a little hazy on exactly how it works because once I wrangled it into a setup that works for me, I don’t mess with it…

You CAN (I think) remap the USB channels to different internal channels, and this is what the matrix you see on the In/Out pop-up is about:

So, you could remap USB input 1 and 2 to (say) channels 11 & 12 like this:

And carry on using USB channels 1&2, but set channels 11& 12 to USB and use those faders to control the input level.

A better choice would actually be to map them to “Aux L/R” which, effectively, are channels 17 and 18, as these are hard linked as a stereo pair inside the XR18, which appear on the Aux fader:

Sorry this is a bit long but, as I said, the XR18 is a complex beast, and trying to get the routing right on it can be tricky.

Cheers,

Keith

By the way, you might find the way I handle the XR18 on Linux to be useful.

Rather than use channels 1 & 2, I normally leave my USB routing matrix on the default 1:1 mapping and use channels 17/18 mapped to the aux channel (which is default) for general PC audio playback.

Note the XR18 is crazy flexible with this but, personally, I have no need for any more than a single stereo playback from the PC to my speakers. I have messed with this and it is possible to have multiple apps, such as soft-synths, mapped to different USB channels for playback, and then use the XR18 mixer (with X-Edit) to mix them to the speakers.

Fun and cool. But I, personally, don’t have a use for it.

The way I achieve this is using a Pipewire configuration. This configuration creates a stereo capture (which I actually rarely use) a stereo playback (which I always use) and a specific mono capture for the mic I use for conferencing, etc. These then show up as separate audio devices:
image

I put the XR18 main device into “Pro Audio” mode, so I can individually wire channels if I want.

The config I used for this is in the file .config/pipewire/pipewire-pulse.conf.d/behringer-xr-18.conf and looks like this:

# PulseAudio config file for PipeWire version "1.0.0" #
#
context.modules = [
    # Creates a virtual sink for X-Air XR18 playback on channels 17/18
    {   name = libpipewire-module-loopback
        args = {
            node.name = "XR18_stereo"
            node.description = "XR18 Mixer Stereo playback"
            capture.props = {
                media.class = "Audio/Sink"
                audio.position = [ FL FR ]
            }
            playback.props = {
                node.name = "playback.XR18_stereo"
                audio.position = [ AUX16 AUX17 ]
                node.target = "alsa_output.usb-BEHRINGER_X18_XR18_7A7B6B81-00.pro-output-0"
                stream.dont-remix = true
                node.passive = true
            }
        }
    }
   
    # Creates a virtual source for X-Air XR18 capture on channel 8
    {   name = libpipewire-module-loopback
        args = {
            node.name = "capture.XR18_mic"
            node.description = "XR18 Mixer Mic capture"
            capture.props = {
                audio.position = [ AUX7 ]
                node.target = "alsa_input.usb-BEHRINGER_X18_XR18_7A7B6B81-00.pro-input-0"
                stream.dont-remix = true
                node.passive = true
            }
            playback.props = {
                node.name = "capture.XR18_mic"
                media.class = "Audio/Source"
                audio.position = [ MONO ]
            }
        }
    }

 
    # Creates a virtual source for X-Air XR18 capture on channels 17/18
    {   name = libpipewire-module-loopback
        args = {
            node.name = "capture.XR18_stereo"
            node.description = "XR18 Mixer Stereo capture"
            capture.props = {
                audio.position = [ AUX16 AUX17 ]
                node.target = "alsa_input.usb-BEHRINGER_X18_XR18_7A7B6B81-00.pro-input-0"
                stream.dont-remix = true
                node.passive = true
            }
            playback.props = {
                node.name = "capture.XR18_stereo"
                media.class = "Audio/Source"
                audio.position = [ FL FR ]
            }
        }
    }
]

The node.target values are the IDs for the XR18 device. They may be different for you, but you can work them out using the following command:

pw-dump|grep usb-BEHRINGER_X18

I can then set the default audio output device to the stereo pair and, when I’m using Google Meet, Teams, or Zoom, I set the mic device to the “Mic Capture” which, in my case, is plugged into channel 8 on the XR18.

Cheers,

Keith

Wow! Thank you both for this thorough tutorial. I will work through these instructions later today and let you know the outcome.

Hi
Thanks for all your help so far
I’ve now got ardour’s main out connected to usb 17/18 aux on the X18.
I can control the main out level from Ardour with X18 aux fader.
I have done some test recording.
I’m recording is at 48K with a 1024 buffer size
The recording is fine, (I checked the quality using the computers built in sound) but the playback is choppy. The rate of chopping is controlled by the buffer size, I cant get rid of it with either the smallest or the biggest buffer.
Can you suggest what I might do to find and remedy this?

That sounds like nothing you’ll fix with Ardour or the X18 settings.

Which OS?

Make sure you don’t have any sync applications running, and that the computer, if a laptop, is in “performance” rather than “power save” mode.

When you say “choppy”, do you mean occasional breakups or is it regular? Have you tried other applications playing back through the XR18?

Cheers,

Keith

Thanks Keith
My computer is a Thinkstation workstation. I am using Debian testing with the settings tuned for audio as was explained in the recent topic about using Debian 12. I had to switch to debian testing due to seemingly insurmountable problems with my old Quadro P400 graphics card in debian 12 with both the free and non free drivers.

I am in performance mode. Ardour is set to use ALSA, which I have always previously found best.
Only Ardour and X-AIr-EDIT apps are in use.
I’m wondering if this could be something to do with Pipewire, which is one of the system options. Ive never been a fan of Jack and always found ALSA easier and less trouble. Could it be that the X18 is using pipewire or pulse audio? Do you know how to establish whether this is the case this and is it relevant?

If Ardour is set to use ALSA then it won’t be using Pipewire.

I’m wondering if it’s a graphics driver issue given your previous problems.

Not sure what other help I can provide on this.

Cheers,

Keith

Many thanks Keith
Ive just tested the X18 on my laptop running debian 12 (no pipewire) and it works fine (no choppy audio).
I’m not sure how to proceed.
@x42 would you have any ideas about how to investigate this problem?

Ive done further experimentation.

  1. If i wirelessly control the X18 from my laptop and record on the Thinkstation, the playback choppiness remains.
  2. Using the ARDOUR_ALSA_EXT=“hw:2” method, I have connected both my lexicon alpha (2in2out) and the X18 on the Thinkstation (running Debian testing).
    If I choose the X18 as input and alpha as the output device, there is no choppiness on playback.
    Unfortunately, the latency is too great to make this a viable solution for multitrack recording.
    I think this does show that the problem is not related to the graphics issue I mentioned earlier.
    However I am now at a loss on how to proceed and would be grateful for any ideas
    Many thanks

What are you doing exactly? Generally latency should only be an issue for most people if playing Virtual Instruments with an external MIDI device (In terms of latency between pressing a key and hearing a note played back from Ardour). Otherwise it can be compensated for, in most cases automatically by Ardour, but if not you can manually dial in a latency value for Ardour to compensate for.

   Seablade

Thank you Seablade
I’m recording audio through microphones. No midi at this point.
To recap:

  1. Using the X18 alone with Ardour, I record one mono track of audio, lasting less than one minute. I can hear the audio directly from the main out of the X18 which is connected to my monitors and its fine.
  2. If I now play that take back using ardour main out into the X18 aux, onto X18 main out. the playback is choppy. There is a tiny glitch between each buffer full of playback. I tested this by changing the buffer size and this results in longer or shorter audio between each glitch. The take file itself plays back ok on the computer built in audio, outside ardour.
  3. This issue is present on a workstation running debian testing but not a laptop running debian stable. They are both set up the same.
  4. I tried using the Lexicon alpha as a playback device, while recording an overdub captured from the X18, to see if the problem occurred when not using the X18 for playback. The playback is not choppy, but has a big lag, so not usable for multitracking. (If I use the X!8 to play back the first take whilst recording the overdub, the playback of the first take is choppy).
  5. I need to find a solution so that I can use the X18 for the whole recording and mixing process on the workstation running debian testing as the laptop is underpowered for mixing with plugins. I had to change to debian testing to get stable graphics on an Nvidia Quadro P400 card.

I Hope this is a clear explanation. To me, it seems the problem is due to something in Debian testing audio

Have you configured your OS for reliable low-latency audio? There are a number of recommendations across forums on how to do this, but in my experience, the most critical steps are setting up realtime scheduling, adding “threadirqs” to your kernel boot parameters, installing the rtirq script, and configuring the script to prioritize your USB soundcard. If you haven’t done this, I recommend doing so and seeing if that helps with the choppy audio. Below is a link to a thread on Linuxmusicians where I provide some more details on this.

https://linuxmusicians.com/viewtopic.php?p=170647#p170647

Instead of the classic rtirq script that is available in Debian’s repositories, you could also consider the one linked below, which will raise the priority of your USB soundcard when it is plugged in and restore normal settings when unplugged, if configured correctly.

Have you checked the sample rate setting on the X18 itself, within Xair edit?

Cheers,

Keith

Thank you Gunther
I set up the computer to the instructions in the recent Debian 12 for audio topic.
It should be fast enough.

Thanks Keith it looks right to me, 48K
image
What i cant get is why it works on debian 12 and not on 13/testing, when the Lexicon alpha is ok on 13.

Have you tried the Alpha alone using recording and playback simultaneously, at similar latency settings to the X18? When using two devices one of the devices will be resampled through a software sample rate converter to synchronize the clocks, so recording with the X18 and playing back with the Lexicon is not exactly the same configuration. As well as the obvious difference of 16 fewer channels on the Lexicon device.

How many periods? Does Ardour still default to 3 for USB devices? If not then try 3 periods, some USB devices do not work well with only 2.

1 Like

I don’t know, but other things to try:

  • Try adjusting the number of periods in the ALSA settings. Some systems seem to prefer 2 periods and others 3 periods.

  • Try different USB ports.

  • It might be worth trying a Debian 12 live distro on the non-working system to see if it gives different results from the installed Debian 13.

Cheers,

Keith

Thankyou both
I have used the alpha for many years without problems at the same rate and buffer size as the X18.
I just tried setting periods to 3 but it made no difference.
Trying with different usb and then live system is a good idea. I will do that and see if its any better on the workstation