Roon on Proxmox Container w/ Passthrough

I recently undertook a project to convert my existing Windows workstation over to Proxmox VE. The idea was that I would run Proxmox on the bare metal and convert my Windows deployment into a VM, passing through the devices using VFIO so it would appear to be standard workstation. I would then convert my Intel RAID10 Array over to ZFS and offload applications like Roon and Plex to run as LXC containers.

For the most part, everything worked. But I ran into latency issues with my Topping D10 Balanced DAC that I just couldn’t resolve. Even with passing through a dedicated USB controller… I would still get infrequent “pops and clicks”. I realized that I hardly ever use this DAC outside of Roon, so I figured out how to get it passed through to the LXC container. Thought I would share the details here for others.

First off, we need to get some information regarding the DAC on the Proxmox host:

root@pve:~# ls -la /dev/snd/by-id/
total 0
drwxr-xr-x 2 root root  60 May 27 21:17 .
drwxr-xr-x 4 root root 160 May 27 21:17 ..
lrwxrwxrwx 1 root root  12 May 27 21:17 usb-Topping_D10_Balanced-00 -> ../controlC1

root@pve:~# ls -la /dev/snd/
total 0
drwxr-xr-x  4 root root      160 May 27 21:17 .
drwxr-xr-x 23 root root     4720 May 24 07:43 ..
drwxr-xr-x  2 root root       60 May 27 21:17 by-id
drwxr-xr-x  2 root root       60 May 27 21:17 by-path
crw-rw----  1 root audio 116,  3 May 27 21:17 controlC1
crw-rw----  1 root audio 116,  2 May 27 21:17 pcmC1D0p
crw-rw----  1 root audio 116,  1 May 24 07:43 seq

Now we can use this to add some additional lines to the LXC configuration:

lxc.cgroup2.devices.allow: c 116:* rwm
lxc.mount.entry: /dev/snd dev/snd none bind,optional,create=dir

After restarting the container, we check to see if the DAC is available:

root@roon:~# aplay --list-devices
**** List of PLAYBACK Hardware Devices ****
card 1: Balanced [D10 Balanced], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

NOTE: I used a privileged container for this setup. (Not sure if it’s required, but I didn’t feel the need to test it unprivileged.)

Roon works great as a container. I have mount points from my ZFS array for music and database backups. I gave the container 2 cores and 4GB of RAM, but I never really see it use even half of that. (And that’s while streaming Qobuz with DSP applied.)

5 Likes

Hi kopas,

Moved this to the Tinkering section.

2 Likes

really nice job, just not clear to me what exactly solved the click/pops issue - allowing usb pass-thru for Topping to the roonserver lxc?

To me it seems on the screen dumps that you are passing alsa devices?

Good point., here’s some additional detail…

I had 6 USB devices that I needed to pass through to my Windows VM:

  • Monitor’s USB hub (webcam and logitech unifying receiver)
  • External USB hub (headset dongle and whatever external drives i’m using)
  • Fingerprint Sensor
  • miniDSP 2x4 HD
  • Topping D10 Balanced
  • Laser Printer

I had originally tried passing through the USB devices themselves, but this was rife with problems. I then purchased two USB 3.0 4-Port PCIe Adapters and passed them through to the VM. Everything was functional, but the Topping D10 suffered from infrequent “pops and clicks” due to latency issues. (What was weird is that it only seemed to affect this DAC. My miniDSP and USB wireless headset had zero problems. Playing games or watching video never flaked out.)

I had tried tweaking and tuning in Proxmox, but any changes I made only seemed to make things worse. For whatever reason… passing through the ALSA device to the LXC container works like a charm. I can play audio all day long and I don’t notice any problems.

2 Likes

@kopas would you mind sharing more details on how to create roon core container (LXC)?
thanks

I used the Ubuntu 20.04 template with the following settings:

  • Privileged Container (Only if passing through ALSA devices)
  • 20GB Disk
  • 2 Cores / 4096MB Memory / 512MB Swap
  • Mount Point for my Music (/raid/music,mp=/mnt/music)

Then run the following commands in the container:

apt install -y curl ffmpeg cifs-utils alsa-lib alsa-utils
apt update && apt upgrade -y
curl -O https://download.roonlabs.net/builds/roonserver-installer-linuxx64.sh
chmod +x roonserver-installer-linuxx64.sh
./roonserver-installer-linuxx64.sh
3 Likes

i also needed to install lbzip2

apt install lbzip2

while alsa-lib was not available with ubuntu 22.04

1 Like

This was helpful, without lbzip2 the installer is unable to unzip the download and fails. Also saw that alsa is not available with 22.04, do you think that has any negative effects?

Otherwise, up and running pretty quickly last night …

1 Like

Thank you, very helpful!

1 Like

cant think of any since its just the decompression of the files.
if you got it running it should work i guess (:

I meant the alsa-lib

Here’s the current commands I use to deploy on an Ubuntu 22.04 container:

timedatectl set-timezone America/New_York
apt update && apt upgrade -y
apt install -y curl bzip2 ffmpeg cifs-utils
curl -O https://download.roonlabs.net/builds/roonserver-installer-linuxx64.sh
chmod +x roonserver-installer-linuxx64.sh
./roonserver-installer-linuxx64.sh
3 Likes

Performance is fantastic… it barely touches the CPU and Memory.