Docker images for Roon [Please Note: Using Dockers and VMs isn't supported by Roon]

Running your image on Ubuntu 18.4 server on top of esxi for some time now. Stable, perfect, just liesten to the music, as it was intended.
Thanks, appreciate your work and effort.

I’m looking for advice about the best processor affinity for pinning a docker image running roon on unraid. I’ve been using @Steef_de_Bruijn’s docker image for over a year.

roonlabs says that roon is optimized for two high-speed CPUs in their white paper about the Nucleus design. (linked from here)

The optimal hardware platform for Roon is one which provides a small number of high-speed CPU cores. To provide the best possible user experience, Roon is designed to take advantage of a high-speed dual-core CPU, fast RAM, and a fast SSD.

I have unraid running on a machine with a Xeon E3-1245 v3 cpu. It has four cores with hyperthreading. Also have 32GB of DDR3 1600 RAM (fast enough I hope:). roon is running off of the SSD cache drive.

On this machine, unraid’s docker configuration page permits a docker image to be pinned to one or more of CPUs 0-3 and HTs 4-7. I interpret CPU 0-3 as the first of each pair of hyperthreads on cores 0-3, and HT 4-7 as the second of each pair of hyperthreads on cores 0-3.

[Update: I checked the specs of all four CPUs used in the 7th generation NUCs, some of which are used in the two Nucleus products. All four are hyperthreaded dual-core CPUs.]

It looks like combinations such as CPU0+HT0+CPU1+HT1 or even CPU0+CPU1+CPU2+CPU3 would emulate the dual-core hyperthreaded CPU roon is optimized for.

Any advice from roonlabs or docker users would be appreciated. Does pinning four cores improve roon’s performance without degrading unraid itself? Which combinations work better?

Thanks,
- Eric

I am using a slightly altered Docker setup. I am using docker-compose and I am connecting my KEF LS50W via USB to the Docker host (Ubuntu 18.04 server, minimal install with Docker 18.09 from the Ubuntu repos.

I am running Ubuntu on a Intel Nuc i3 (third gen core i3 with 16GB of memory and a 120GB sata M2 SSD) and it works great! No need to buy CPU overkill NUCs.

I have the issue that Linux sets the volume in the audio mixer to 31. I need it to go to 100. Volume control is done on the KEF itself and not via Roon.
So you have to set the volume to 100%. You can do that via a shell in the running container or just via the Roon controller on your phone/tablet/windows/mac
I have stored the values in a state file and mount them via docker on /var/lib/alsa/asound.state
I put the restore settings in the start.sh script of the container.
I have also done some /dev mounts. Those dev files are my LS50W device files
In my setup I am using native networks via VLANs, but you don’t have to!

My docker-compose yaml.

version: '3'
services:
  roon:
    build: .
    image: roon:latest
    container_name: roon_server
    hostname: roonserver
    restart: unless-stopped
    environment:
      - TZ="Europe/Amsterdam"
    volumes:
      - ./app:/app
      - ./data:/data
      - ./music:/music
      - ./backup:/backup
      - ./asound.state:/var/lib/alsa/asound.state
    devices:
      - /dev/snd/controlC1
      - /dev/snd/pcmC1D0p

networks:
  devices:
    ipv4_address: 172.16.0.181

networks:
 devices:
   external: true

My Dockerfile

FROM debian:9.9
ENV DEBIAN_FRONTEND noninteractive
ENV ROON_SERVER_PKG RoonServer_linuxx64.tar.bz2
ENV ROON_SERVER_URL http://download.roonlabs.com/builds/${ROON_SERVER_PKG}
ENV ROON_DATAROOT /data
ENV ROON_ID_DIR /data

RUN apt-get update \
    && apt-get -y upgrade \
    && apt-get -y install bash curl bzip2 ffmpeg cifs-utils alsa-utils

VOLUME [ "/app", "/data", "/music", "/backup" ]

ADD run.sh /
RUN chmod 755 /run.sh
ENTRYPOINT /run.sh

My run.sh file

#!/bin/bash
cd /app
if test ! -d RoonServer; then
  curl $ROON_SERVER_URL -O
  tar xjf $ROON_SERVER_PKG
  rm -f $ROON_SERVER_PKG
fi
/usr/sbin/alsactl restore
/app/RoonServer/start.sh

To make it all working. I have put it all in /opt/roon

mkdir -p /opt/roon/app /opt/roon/data /opt/roon/music
cp docker-compose.yml /opt/roon
cp Dockerfile /opt/roon
cp run.sh /opt/roon
cd /opt/roon
docker-compose build
docker-compose up -d
2 Likes

Thanks for sharing -

I copied your setup and used the network-mode “host” every thing is fine, my server is recognized but sadly a can’t login. It throws a network error. :frowning:

roon_server | terminate called after throwing an instance of ‘OpenHome::NetworkError’
roon_server | Stacktrace:
roon_server |
roon_server | Cannot transition thread 0x7fb680a37700 from STATE_BLOCKING with DO_BLOCKING
roon_server | at <0xffffffff>
roon_server | Not responding
roon_server | Error
roon_server | Initializing
roon_server | Started
roon_server | aac_fixed decoder found, checking libavcodec version…
roon_server | has mp3float: 1, aac_fixed: 0
roon_server | terminate called after throwing an instance of ‘OpenHome::NetworkError’
roon_server | Stacktrace:
roon_server |
roon_server | at <0xffffffff>
roon_server | at (wrapper managed-to-native) OpenHome.Net.ControlPoint.CpDeviceListUpnpServiceType.CpDeviceListCreateUpnpServiceType (intptr,intptr,uint,OpenHome.Net.ControlPoint.CpDeviceList/CallbackDevice,intptr,OpenHome.Net.ControlPoint.CpDeviceList/CallbackDevice,intptr) [0x00030] in <21295a8acb1a4b59920209b723ef0864>:0
roon_server | at OpenHome.Net.ControlPoint.CpDeviceListUpnpServiceType…ctor (string,string,uint,OpenHome.Net.ControlPoint.CpDeviceList/ChangeHandler,OpenHome.Net.ControlPoint.CpDeviceList/ChangeHandler) [0x00042] in <21295a8acb1a4b59920209b723ef0864>:0
roon_server | at OpenHome.Net.ControlPoint.CpUpnpDeviceListFactory.CreateListServiceType (string,string,uint,OpenHome.Net.ControlPoint.CpDeviceList/ChangeHandler,OpenHome.Net.ControlPoint.CpDeviceList/ChangeHandler) [0x00007] in <21295a8acb1a4b59920209b723ef0864>:0
roon_server | at Sooloos.Broker.Transport.SongcastDirect.ReInit () [0x00235] in :0
roon_server | at Sooloos.Broker.Transport.SongcastDirect…ctor (Sooloos.Broker.State,Sooloos.Broker.Transport.Module) [0x0007e] in :0
roon_server | at Sooloos.Broker.Transport.Module.Enable () [0x001e9] in :0
roon_server | at Sooloos.Broker.Transport.Module.UpdateEnabled () [0x00035] in :0
roon_server | at Sooloos.Broker.Transport.Module.b__74_0 (Sooloos.Broker.Api.LoadStatus) [0x00001] in :0
roon_server | at Sooloos.Broker.LoadStatus.b__35_0 (System.Action`1<Sooloos.Broker.Api.LoadStatus>) [0x00002] in <b547e

Any suggestions?

Try another kernel?

Are you running Emby and/or Plex on the same machine?

If you need more help, please provide detailed information about your setup, finish already opened support requests, use the forum search or external search engines like e.g. Google | Bing | …

And an additional question to the one from @noris: Why are you trying to run Roon in a Docker instead of natively running it on the CentOS 8 Linux using the instructions from the knowledge base: LinuxInstall.

At first thank you for your great support!

Well I wanted to keep my Homeserver (wich is doing some Samba Shares, Plex (for Videos) and a few Homeautomation stuff) as celan as possible -> Docker.

But I guess I need to use a seperate machine for Roon because one fits all is obviously not sufficent. If I run roon core on my main PC (intel i9900 3,6 GHz 32 Gb RAM) it’s really consuming some power. I hope it drops if when Roon is finished analyzing my Media.

I did the native install but it drains my server a lot (no wonder, hence it has to do so much other jobs), I didn’t think the docker version would be better (I know it would be worse) but i thought that I could control the power it consumes a little.

So here are 2 Questions

  1. After roon did all the scanning and so on - how much cpu does it need when idle.
  2. Sould I disable DSP completly (if possible)
  3. Should I stick with a spare ROON server?

My Library: 832 Albums mostly FLAC.

Regards,

  1. Hardly any at all. The audio analysis that comes with the first scan is intensive; afterwards things go quiet. Very quiet. :wink:
  2. Not really. Anything PCM is a light load; DSD is a different story.
  3. I’d wait until your audio analysis has ended and your library is fully imported.

Thank you :slight_smile: for your info :slight_smile:

Hey @Steef_de_Bruijn love this, and thank you! I’m running the docker over on unRaid. Do you prefer a location for support and discussion on this docker?

You’re welcome. Discussion about the image is fine on either github or here.

1 Like

[FIXED] seems to be updating fine now. See post below

Went to update Roon Server when a pop-up showed up saying there was an update. After that update, it broke. I removed the Docker + Image, and deleted corresponding appdata folders

root@rubble:/mnt/user/appdata# rm -Rf RAATServer/ RoonGoer/ RoonServer/

(*** Anyone who does the “rm -Rf” command, be REAL CAREFUL, probably SOBER :slight_smile:)

When I reinstalled the Docker, it still pulled an older version of 1.7 Build 537. Doing an update broke it again. Restoring a backup, also of 1.7 Build 537, would also break it.

Interestingly, I did an install on a Ubuntu VM using the shell script from the Roon site here, and it pulls http://download.roonlabs.com/builds/RoonServer_linuxx64.tar.bz2, which is ALSO 1.7 Build 537.

The update did not break the VM Ubuntu version.

Thanks for any direction! And I can update the unRaid forum post over here if we get it hammered out.

Hi sorry for your update troubles.

I tried the same update this morning an it succeeded without a glitch.

I followed the link in your post and seeing all the troubles people have setting this up makes me think docker on unraid Is a bit more difficult to set up :flushed:

Anyway, your logs over there are full of permission errors which make me think there are wonky things going on with permissions. Does unraid something special with userids running the container or with file permissions or fs attributes? Did previous updates work fine? (In that case no clue why this particular one failed, maybe the Roon guys changed something in the update process which in turn unveiled some underlying problem ?)

Also, same update in vanilla VM worked fine you say; this enforces my suspicion above.

Finally, you state over there that VM runs more smoothly. Is the drive mapping topology different from the docker setup? At least for the docker version mount /app and /data on SSD, /music and /backup can be hosted on rotating hardware.

I have same problem as Drew_Kerlee. When I update, using Roon on iPad, my Roon stops working.

But I saw a post that said they did Roon update a different way and it worked good. They did update from the Unraid docker. Is that the difference that makes it work? I am not sure how to update from unraid docker but I guess I would click on “check for updates”, then install update.

And then restart the docker, juuust to make sure.

Re-attempted update via Docker, and it worked no problems. Rebuilding library now. Here are the steps I used for the update:

Double checked that no Roon related directories existed in /mnt/user/appdata

Installed Docker via these steps

Clicked Check For Updates via unRaid GUI Docker tab at bottom, nothing found

Connected via Windows 10 Roon app

Disconnected VM version Roon Server, Connected to Docker version

Roon server installed version 1.7 build 537

Clicked “Unauthorize” VM version Roon Server, logged in to Docker version with Roon credentials

Clicked Relaunch in Windows Roon app > Settings > About

Unraid logs after successful update

Rebuilding library. Bob’s your uncle.

1 Like

Great! I cannot extract from your description if I can change anything in my image to make it more compatible with unraid. I you do, please inform me so I can look into it.

You and me both @Steef_de_Bruijn! We’ll let 'er ride 'till she bucks us.

Yahooo! :grinning: ride that thang!
it sounds like if my iPad asked me to update I should not do it. It also sounds like the best way to update is to go into Roon on the desktop where you can see the unraid Roon install,And click “relaunch”. Somehow relaunch does an update. Maybe the desktop roon pushes the update to the unraid core on the unraid Machine. When I have time I’m going to try to copy what you did. Thanks for the clear instructions and the screenshots. And thanks to Mr. Steef For the docker.

1 Like

Yes, thanks very much!!! I have been having an issue for some time with this.

1 Like

Thanks for sharing your solution. My question is this: Did you have to rebuild your entire library, or were you able restore from a backup after you were on the latest version?