Audirvāna for LINUX and NAS (QNAP/Synology) officially released

Afte installing avahi-daemon, the server is detected. Thanks!

1 Like

Thanks for your very detailed and helpful reply. I’ve now got Studio working on my favorite distro!

About Audirvāna not releasing exclusive hold of ALSA: If the unlock button doesn’t work (which IMO would be a UI bug), then I’m thinking the only answer for the time being would be stopping the service.

1 Like

I reached the same conclusion. Interestingly, when I start the audirvana-studio service after shutting it down like this, it holds on to the lock. Not a huge deal.

I did a bit more investigation on the Docker side of things, and it seems inevitable that mDNS/Avahi Daemon running in the container will need to be exposed at the host network level, which means that it will conflict with any Avahi Daemon running on the host. That said, if anyone wants to run this in a container on a server that isn’t running an Avahi daemon already, this is how it could be accomplished (in theory, I haven’t fully tested):

Create a file called Dockerfile with these contents:

# Use the latest Ubuntu LTS as base image
FROM ubuntu:22.04

# Avoid user interaction with tzdata
ENV DEBIAN_FRONTEND=noninteractive

# Update and install necessary packages
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    gdebi-core \
    avahi-daemon \
    avahi-utils

# Copy the Audirvana Studio deb package into the container
COPY audirvana-studio_2.8.1.1_amd64.deb /tmp/audirvana-studio_2.8.1.1_amd64.deb

# Install the Audirvana Studio deb package along with its dependencies
RUN gdebi -n /tmp/audirvana-studio_2.8.1.1_amd64.deb

# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# Set up the entrypoint to start Avahi daemon and then Audirvana Studio
ENTRYPOINT ["sh", "-c", "service avahi-daemon start && /opt/audirvana/studio/audirvanaStudio"]

Build your container (while in the dir with your Dockerfile & Audirvana deb file)

docker build -t audirvana-studio .

Run this quick and dirty command to test (you may want to limit container caps for production)

docker run --rm -d --network host --privileged --device /dev/snd audirvana-studio

It’s probably a good idea to mount the audirvana config in a Docker volume or bind mount to the desired directory on the host so that when the container is removed, you do not lose config data.

Any way, some variant of this is good for a Linux server with no Avahi Daemon running on the host.

Running on a Linux Host that already has an Avahi Daemon

If you’d like to run on an existing Linux Desktop with Avahi already installed, you would need to modify your Dockerfile to ensure that you configure NSSwitch to use the mdns4 plugin. You can probably do this by modifying the /etc/nsswitch.conf file within the container to look like this:

# /etc/nsswitch.conf
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

In the Dockerfile, this might be accomplished by:

# Modify nsswitch.conf
RUN sed -i 's/hosts: files dns/hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4/g' /etc/nsswitch.conf

When you’re ready to run the new container, you’ll want to add these flags: -v /var/run/dbus:/var/run/dbus -v /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket which (in theory) give access to your host operating system’s Avahi daemon.

Alas, I do not have time to fully test this today. Others are welcome to try. No warranties/guarantees though.

3 Likes

Exactly that I was looking for !
Thanks a lot !

1 Like

For any users looking to run Audirvana in a Docker container on an existing desktop host and wish to use the host Avahi daemon and mDNS services, I’ve tested this on Arch Linux based Endeavour OS:

# Use the latest Ubuntu LTS as base image
FROM ubuntu:22.04

# Avoid user interaction with tzdata
ENV DEBIAN_FRONTEND=noninteractive

# Update and install necessary packages
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    gdebi-core

# Copy the Audirvana Studio deb package into the container
COPY audirvana-studio_2.8.1.1_amd64.deb /tmp/audirvana-studio_2.8.1.1_amd64.deb

# Install the Audirvana Studio deb package along with its dependencies
RUN gdebi -n /tmp/audirvana-studio_2.8.1.1_amd64.deb

# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# Modify nsswitch.conf
RUN sed -i 's/hosts: files dns/hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4/g' /etc/nsswitch.conf

# Set up the entrypoint to start Avahi daemon and then Audirvana Studio
## Commenting out as I'm using the host avahi daemon
#ENTRYPOINT ["sh", "-c", "service avahi-daemon start && /opt/audirvana/studio/audirvanaStudio"]

# Set up the entrypoint to run Audirvana Studio
ENTRYPOINT ["/opt/audirvana/studio/audirvanaStudio"]

The command that you can run, which will also save Audirvana configs in a Docker named volume (so you can remove and recreate the container), is:

docker run --rm -d --network host --privileged --device /dev/snd -v audirvana-configs:/root/.config -v /var/run/dbus:/var/run/dbus --name "audirvana-studio" audirvana-studio

Docker Compose

The equivalent docker-compose.yml file would be structured as follows, automatic restart with Docker daemon on boot is configured via restart (I haven’t tested this):

yaml

services:
  audirvana-studio:
    image: audirvana-studio
    container_name: "audirvana-studio"
    network_mode: host
    privileged: true
    devices:
      - /dev/snd
    volumes:
      - audirvana-configs:/root/.config
      - /var/run/dbus:/var/run/dbus
    restart: "unless-stopped"
volumes:
  audirvana-configs:

docker-compose command to start

docker-compose up -d

While in the directory with docker-compose.yml

docker-compose command to stop

docker-compose down

Update: I’ve tested this now, and it seems to work.
Update 2: Your mileage may vary with the docker-compose version. Some odd issues causing the app to crash.
Update 3: Complete removal / re-install of the Remote app seems to have corrected this. Docker-compose version running well.

Issues noted:

1.) Settings menu in the Remote app for Audirvana has a lot of poorly rendered popups on Android and strange titles in the Settings page in app. E.g., titles like “SETTINGSAUDIOOUTPUTDEVICETITLE”. It’s usable, but very “beta”.

2.) Audio playback progress bar not incrementing while track is playing. Play/Pause works though, so it is usable.

3.) “Unlock Device” does not release my iFi Zen DAC v2 from ALSA. Stopping the container releases it, obviously.

4.) When upsampling is enabled, playback progress bar increments correctly.

1 Like

Re playback progress bar incrementing, see UI bug on Debian

1 Like

Do you use the Raspberry Pi Linux distribution, or did you choose another? I have a Pi with 2Gb and would like to try, but I’m not a Linux expert .

Hi

I used the standard Raspian distribution as I thought it might be easiest. Audirvana seems to run fine in 2 gig at original sampling rates.

1 Like

Not sure if this is an Audirvana bug, or something else.

My 2 gig Pi 4 works well over USB at any incoming sampling rates. I have a Pi2AES HAT which uses the same driver as the HiFiBerry Digital Pro +. If I edit the appropriate ;one into config.txt it works fine fore sources ar 44100/16 bit, but for any other incoming rate, even 44100/24 I just get static.

Can anyone recommend how to install this on a 10i7NUC? I currently run Euphony on it. I also have a QNAP NAS so perhaps I should run that first on the QNAP NAS and then compare both… I’ve been an Audirvana user since version 2 and always loved the sound quality.

I have made a package for Archlinux (without using debtap).
avahi daemon socket is enabled. To be sure I have also enabled avahi-daemon service.

However if I start audirvana I have always this message:

2024-04-14 15:06:10.172 [info]:         =============  Started Logging, Audirvana Studio 2.8.1.1 linux  =============        
2024-04-14 15:06:10.173 [info]: EULA not accepted yet, showing it

How can I accept EULA?

1 Like

That’s the message I get when avahi-daemon isn’t running. In your case, could it be a firewall interfering with communication?

I don’t think so. All other audio services are working, including Roonserver and HQplayer with UPnP.
I must open some port?

1 Like

I know 1% of the Linux you know, if that. :slightly_smiling_face: But when Audirvāna is working, I do get a message the server is communicating on a port number, but IIRC the port used is not necessarily consistent.

The EULA is accepted when you attach the remote app to Audirvana and is recorded in an INI file in $HOME/.config/audirvana/. You could also set it to accepted by editing the INI config. I’m not near a computer, so don’t recall the file name or the exact variable. Hope that helps.

Apologies but Linux isn’t my forte.
In fact, installing it on my NUC as a dual-boot with Win11 almost buggered the PC completely :scream: :rofl: :rofl:

What exactly do I need to do with this file to enable Studio to automatically start upon system start-up?
The file exists, but I still need to start Studio manually in order for the remote app to see it.

Also, when I play back a file from Qobuz (still haven’t worked out how to mount my local music library drive), the age-old UPnP problem of incompatability with my Auralic streamer is still apparent.

Not entirely sure if I’ll make the best use of this Linux build, but wish Audirvana all the best with it :+1:

2 Likes

It won’t solve all problems with the Auralic (though I did notice at least one Windows bug I reported didn’t exist with the Linux app), but here’s how to start on every bootup automatically:

sudo ./setAsService.sh enable

(Do this in a terminal opened in the same folder as setAsService.sh .)

3 Likes

The directory i$HOME/.config/audirvana/ s empty after starting audirvana.
If you can find the content of the file…

BTW, when you are attempting to first run Audirvana, have you stopped Roonserver and hqplayerd?

I have success with installing on RPI Zero 2W, but it doesn’t play anything more than 96khz because of insufficient ram. Whole rpi crashing. Even i can’t log into ssh.

On RPI 4 2GB working fine and plays everything.