RME Digiface USB and PipeWire

My work laptop provided by SURF, a Dell Pro 14 Premium, runs a custom Dell Ubuntu 24.04 ISO since otherwise half of the peripherals don’t work. Ubuntu 24.04 comes with PipeWire so I was curious if the Digiface would work with such a setup. Well, it does, albeit with some quirks.

First of all PipeWire also doesn’t get the outputs right. With the help of WirePlumber I could map channels 33 and 34 of the phones output to Front Left and Front Right. But then the next issue popped up: weird garbled, phasing, ringing audio. When using ALSA directly with Ardour this happened too so it’s not a PipeWire issue. Tried tweaking things first and also tried a recent Liquorix kernel. To no avail. Then I started trying out different buffer sizes using pw-metadata and noticed the phasing, ringing sound would go away when changing the buffer size. And I also noticed that the garbled sound would come back if I used a buffer size higher than 64. So with the use of WirePlumber I also set that now. Another owner reported that setting a higher sample rate also alleviates the issue. I still like to figure out though why I can’t use higher buffer sizes. I think it’s related to the USB topology of this laptop as I don’t have this issue on my own laptops.

The WirePlumber configuration file to remap the phones outputs can be found here: https://codeberg.org/autostatic/gists/src/branch/main/99-rme-digiface-usb.lua. Ubuntu 24.04 uses WirePlumber < 0.5.0 so it’s still in Lua format. You can place this file in ~/.config/wireplumber/main.lua.d/. And it starts with 99- for a reason, the interwebs suggest a lower number but then it gets overwritten by global configuration files.

Below the WirePlumber configuration file that I use on the Dell Pro 14 Premium with an extra property to work around the garbled audio issue.

rule = {
  matches = {
    {
      { "node.name", "matches", "alsa_output.usb-RME_Digiface_USB__23800125__7C01A52EA9692C8-00.*" },
    },
  },
  apply_properties = {
    ["audio.position"] = "AUX0,AUX1,AUX2,AUX3,AUX4,AUX5,AUX6,AUX7,AUX8,AUX9,AUX10,AUX11,AUX12,AUX13,AUX14,AUX15,AUX16,AUX17,AUX18,AUX19,AUX20,AUX21,AUX22,AUX23,AUX24,AUX25,AUX26,AUX27,AUX28,AUX29,AUX30,AUX31,FL,FR",
    ["api.alsa.period-size"] = 64,
  },
}

table.insert(alsa_monitor.rules,rule)
RME Digiface USB and PipeWire

RME Digiface USB on Linux

With the release of the 6.12 kernel the RME Digiface USB is supported under Linux. Since this is a very portable device with lots of IO (32 in and 34 out) it got on my radar as a possible candidate for making recordings at my rehearsal space. It took a while before I stumbled upon a second hand unit but in the end I managed to find one nearby. Hooked it up to my notebook with an up-to-date Liquorix kernel and it worked out of the box.

A lot of thanks go out to Asahi Lina for adding support for the RME Digiface USB to the 6.12 kernel. She even added the possibility to control the output format and clock source and to monitor sample rates, input formats, input sync statuses and the current sync source.

Screenshot of AlsaMixer showing all the controls available for the RME Digiface USB
Screenshot of AlsaMixer showing all the controls available for the RME Digiface USB

Have yet to test the Digiface USB with more than one ADAT device but with one device (a Behringer ADA8200) everything seems to work really well. Did some round-trip latency tests and with a buffer size of 16 samples and putting TotalMix in DAW mode (which had to be done on a different OS unfortunately but saved another 0.2 ms) I got it down to approximately 4.2 ms. Systemic latency with a buffer size of 16 samples and a sample rate of 48 KHz is 2 ms so somewhere a bit more than 2 ms of additional latency gets added. I think about 1.4 ms gets added by that converters if I did my maths right. According to the specs of the converters they add 22 samples (10 in and 12 out at 48 KHz). That leaves about 0.8 ms unaccounted for. Probably the USB bus buffer or something in the driver stack. Well, no real deal-breaker for me.

This image has an empty alt attribute; its file name is image-2.png
Ardour round-trip latency measurement with a buffer size of 32 and a 48KHz sample rate
Ardour round-trip latency measurement with a buffer size of 32 and a 48KHz sample rate

Because I’m still on Debian 12 I couldn’t fully use the device with PulseAudio though. PulseAudio only supports devices with up to 32 channels in or out and since the Digiface has 34 output channels PulseAudio refused to output any audio through it. As a fix I added the following to the ~/.asoundrc file in my home directory:

pcm.snd_rme_digiface_usb {
    type multi
    slaves.rme.pcm "snd_output"
    slaves.rme.channels 34
    bindings.0.slave rme
    bindings.0.channel 32
    bindings.1.slave rme
    bindings.1.channel 33
}

pcm.snd_output {
    type hw
    card USB23800125
}

To make PulseAudio pick up this extra snd_rme_digiface_usb device I added the following to ~/.config/pulse/default.pa:

# RME Digiface USB
load-module module-alsa-sink device=snd_rme_digiface_usb

And now I can select the Digiface as an output source and use the phones output in a desktop session.

Screenshot of pavucontrol with the RME Digiface USB right in the middle
Screenshot of pavucontrol with the RME Digiface USB right in the middle

Another big bonus is the custom pouch my daughter made for it. I can now toss it in my bike bag without having to worry about dings or scratches.

RME Digiface USB tucked in a custom cotton pouch
RME Digiface USB tucked in a custom cotton pouch
RME Digiface USB on top of its custom cotton pouch
RME Digiface USB on top of its custom cotton pouch

RME Digiface USB on Linux

New notebook – The last bits

Sorted out the last bits that didn’t work smoothly yet.

WiFi

WiFi connection was intermittent and slow. lspci had this to say about it:

01:00.0 Network controller: MEDIATEK Corp. MT7922 802.11ax PCI Express Wireless Network Adapter

There are numerous reports about this controller not working, almost all firmware related. The Liquorix kernel I’m running has the latest firmware so that was not the issue. Then I stumbled on a report related to power saving. Disabled that through NetworkManager by adding an extra configuration file in /etc/NetworkManager/conf.d with the following lines in it:

[connection]
wifi.powersave = 2

WiFi is now stable and fast.

Keyboard

Backlight

This can be controlled through sysfs or D-Bus but the system thinks there are only three settings: off (0), dimmed (1) or bright (2). But my keyboard thinks there are four settings, the fourth being what I would call “responsive bright”. This setting disables the backlight after a minute of inactivity and responds to key strokes by enabling backlight again to the bright setting. You can toggle this setting on the keyboard itself with Fn+Space but unfortunately the system does not know about this. I’ve worked around this by using a tiny daemon that listens for key strokes and enables the backlight and disabling it again when there’s no activity for a minute. There are several solutions for this, I settled for kbd_backlight_ctrl because it works and it’s just a few lines of C. Can’t set the brightness though but since it’s just a few lines of code I see this as an opportunity to improve my non-existent C skills.

Media keys

The keyboard has four dedicated media keys, play/pause, stop, previous and next. These work perfectly with a media player like VLC but Ardour does not recognize them. By creating supplementary udev hardware database entries I remapped the media keys so they’re now also functioning in Ardour which is quite neat. Only the stop key has no purpose yet as Ardour has no shortcut for what I want to map it to, stopping and going back to the start marker. Maybe I could create something myself through Ardour’s Lua scripting engine.

The hardware database entries look like this:

evdev:input:b0011v0001p0001*
 KEYBOARD_KEY_a2=space
 KEYBOARD_KEY_90=left
 KEYBOARD_KEY_99=right

These went into /etc/udev/hwdb.d/99-media-keys.hwdb. After running systemd-hwdb update && udevadm trigger as root Ardour now sees the play/pause button as space, previous as left and next as right. I used Remapping Keyboard Keys in Ubuntu with udev / evdev as a reference.

Audio devices

There are three audio devices on this machine:

$ lspci | grep -i audio
64:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt Radeon High Definition Audio Controller
64:00.5 Multimedia controller: Advanced Micro Devices, Inc. [AMD] ACP/ACP3X/ACP6x Audio Coprocessor (rev 63)
64:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h/19h HD Audio Controller
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Babyface2359686 [Babyface (23596862)], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 10: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 10: Generic [HD-Audio Generic], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 10: Generic [HD-Audio Generic], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 11: Generic_1 [HD-Audio Generic], device 0: ALC257 Analog [ALC257 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Babyface2359686 [Babyface (23596862)], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: acp63 [acp63], device 0: DMIC capture dmic-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 11: Generic_1 [HD-Audio Generic], device 0: ALC257 Analog [ALC257 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

So onboard audio, HDMI and a capture device acp63. As you can see I’ve managed to get onboard and HDMI out of the way by indexing them but unfortunately the kernel module for the capture device, snd-soc-ps-mach, does not seem to support indexing. I’d like to index it as card 12 because now that acp63 device claims 0 when my Babyface is not attached. Something for later investigation.

I’ll dedicate a separate post to doing real-time audio on this machine. I need to do some more stress testing but Ardour runs without complaining at 48kHz, 64 frames/period and 3 periods/buffer, so 4ms system latency. No weird things there.

New notebook – The last bits

New notebook – The day after

Everything seems to work, network, audio, external monitor, display brightness. And this is the first notebook I’ve ever come across to that has a touch pad with an actual real middle click! Love it! Keyboard is nice too, backlight works fine and it has a nice array of function keys that are almost all mapped now. Overall feel of this machine is really nice, aluminum housing and the chiclet keyboard feels stable and solid. Startup time is twice as fast as the BTO. Compared to my new notebook the old one feels strangely completely outdated.

Now what is in there? CPU is an AMD Ryzen 7 7840HS, an 8-core CPU with SMT. Disabled SMT though, Ardour seems to run slightly better on 8 real cores. 32GB of RAM which should be more than enough, my old notebook had 16GB and never had any issues with that. Storage is a 1TB SK hynix BC901 NVMe drive with more than decent throughput. Almost all USB ports sit on their own bus which is quite nice. The only bus that shares its IRQ with something else (the WiFi module) is bus 001. USB ports that use this bus are both the USB-C and USB Type-A connectors closest to the screen. So better not use those.

The only thing that is a bit flaky is the WiFi connection but came across more mentions about that. The connection sometimes randomly reconnects. Can live with it, when making music I often completely disable WiFi. Did have to use systemd automount instead of an fstab entry to mount my NAS as the WiFi connection apparently takes a bit too long to come up.

Didn’t have to tweak a lot so far. As I already mentioned I did disable SMT (Simultaneous Multi-Threading) and I’ve prioritized the IRQ of the USB bus my audio interface sits on. Not with rtirq or udev-rtirq (which doesn’t work properly on this machine, the wrong IRQ seems to get prioritized) but with a small script to fetch the IRQ number that seems to change on every boot and feeding the outcome to chrt. Installed a liquorix kernel on it and enabled threaded IRQ’s, disabled mitigations and USB autosuspend. Also allowed my user to set CPU DMA latency.

BTO vs Lenovo

It’s running Debian 12 with XFCE again. Simple, fast and looks good enough to me with the Greybird theme and elementary icons. And no more notebook that takes off into orbit, the new one is way more quiet.

On with making music!

Edit: the script I threw together could be useful for others too with USB audio interfaces connected to a machine that uses MSI (Message-Signaled Interrupts) enabled USB controllers. You can find the snd_dev_id of your interface with aplay -l.

#!/bin/bash

prio=90
prio_step=5
proc_path=/proc/asound
sys_pci_bus_path=/sys/class/pci_bus
snd_dev_ids=( Babyface2359686 UA25 )

for snd_dev_id in ${snd_dev_ids[@]}; do
  snd_dev_card_number=$(awk '/'$snd_dev_id'/ {print $1}' $proc_path/cards)

  if [ -n "$snd_dev_card_number" ]; then
    snd_dev_card=card$snd_dev_card_number
    snd_dev_pci_bus_ref=$(grep -Eo "usb-[^[:space:],-]+" $proc_path/$snd_dev_card/stream0 | sed "s/usb-\(.*\)/\1/")
    snd_dev_pci_bus_ref_short=$(awk -F ':' '{print $1":"$2}' <<<$snd_dev_pci_bus_ref)
    snd_dev_irq=$(cat $sys_pci_bus_path/$snd_dev_pci_bus_ref_short/device/$snd_dev_pci_bus_ref/irq)
    snd_dev_irq_pid=$(pgrep $snd_dev_irq-xhci)

    chrt -f -p $prio $snd_dev_irq_pid
    
    prio=$((prio-prio_step))
  fi

done
New notebook – The day after

Downscaling and upgrading

For years I’ve used Focusrite Firewire interfaces, first the Saffire Pro 10 IO and after that its successor, the Saffire Pro 40. Both great devices but recently I decided to make the switch to USB. The reason was twofold:

  • I was barely using more than 2 ins or outs simultaneously
  • Firewire is being phased out and my notebooks don’t have any Express Card slots either, only USB ports
  • The Pro 40 isn’t very portable

So when switching to USB I would need:

  • Same or better quality preamps and AD/DA convertors
  • At least 2 ins and outs
  • Portability
  • Possibility to achieve similar latencies as with the Pro 40
  • Works well with Linux

This narrowed down the choice significantly. I could go for a Focusrite Scarlett but from what I found on the net there were some issues with these devices. I’ve also looked at some Presonus devices but actually I had already set my mind on a different device: the RME Babyface.


RME Babyface

So when I found a webshop that offered the Babyface at a reduced price (almost 15% off) I put my Focusrite up for sale and bought the Babyface. The Focusrite was sold within a week and the Babyface easily met my expectations:

  • When in CC (Class Compliant) mode it works out of the box
  • It’s highly portable, the Babyface is actually specifically made for this purpose as it comes with a nice pouch
  • It has 2 ins and outs and the great thing is that it’s possible to extend the IO via ADAT
  • The preamps and AD/DA converters are simply top notch, they’re so good that I’m considering switching cans and studio monitors as this device is merciless, it simply doesn’t work well with my current setup
  • When connected to an USB3 port (XHCI) the Babyface can run with nominal latencies of 0.5ms (this is with 8 samples), i.e. it beats the other two OS’s mentioned on the RME product page

I can live with not being able to control the device from within Linux, almost all settings can be done on the device itself. Upgrading the firmware can be done with a VM so that’s covered too. The only real drawbacks are that it’s an USB device so it’s a bit more picky with regard to your system setup and it consumes a bit more CPU compared to Firewire. But all in all this is a great sounding device that works well with Linux when in CC mode and it fits my specific user case very well.

Downscaling and upgrading

Nieuwe FFADO versie op komst

Er zit een nieuwe FFADO release aan te komen, FFADO 2.1.0.

De laatste puntjes worden op de i gezet en hopelijk wordt de nieuwe versie begin volgende week gereleased. Naast dat er een sloot aan nieuwe devices ondersteund worden in deze versie zijn er ook een hoop bugs gefixed en is er de nodige aandacht besteed aan ffado-mixer om deze goed werkende te krijgen met bijvoorbeeld de nieuwere Focusrites (de PRO 14, 24 en 40).

Voor mij persoonlijk verandert er niet veel, mijn Focusrite Saffire PRO 40 werkt feilloos onder Ubuntu 12.04. Maar in de toekomst zou ik wel graag een RME Fireface 400 aan willen schaffen en die wordt ondersteund met de aankomende FFADO release. Een bandmaat heeft een tijdlang twee Focusrite Saffire Pro 10’s gehad en deze recentelijk omgeruild met een RME Fireface 800 en volgens hem zijn de A/D D/A convertors gewoon stukken beter dan die van Focusrite.

Nieuwe FFADO versie op komst