It turns out that avahi-daemon is not running, and shairport won’t start for me (using Volumio 1.4). Here’s why, and how to fix it.
As I found that volumio.local was not working, and there was no Airplay alternatives available, I logged into my little Raspberry Pi to check it out. I also noticed that the Android client MPDroid was unable to detect Volumio automatically.
What I found was that avahi-daemon was not running. The command ‘sudo /etc/init.d/avahi-daemon start’ gave this error message: “avahi-daemon disabled because there is a unicast .local domain”.
When I tried to start shairport with the command ‘sudo /etc/init.d/shairport start’, it complained that avahi-daemon wasn’t running.
Looking at avahi-daemon’s init-script, it is doing a test to see if there already is a .local domain. Some ISPs do (unfortunately) have such a domain, which makes the avahi-daemon bow out.
If you’re experiencing the same problems, you can check if your ISP is the culprit right from Volumio’s command line like this:
sudo host -t SOA local
If it says “local has SOA record…”, then you can fix the problem like I did below.
I haven’t ruled out that this is a bug in Volumio, because on other computers in my network this test tells me: “Host local not found: 3(NXDOMAIN)”. Either way, I have tested this solution and it works. It also works between reboots.
To get avahi-daemon running, I commented out that test in /etc/init.d/avahi-daemon (Please note that this is not the entire file, just the part that shows my alteration. You will need to actually edit the file, using an editor like nano or vi):
[code]#!/bin/sh
BEGIN INIT INFO
Provides: avahi
Required-Start: $remote_fs dbus
Required-Stop: $remote_fs dbus
Should-Start: $syslog
Should-Stop: $syslog
Default-Start: 2 3 4 5
Default-Stop: 0 1 6
Short-Description: Avahi mDNS/DNS-SD Daemon
Description: Zeroconf daemon for configuring your network
automatically
END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DESC=“Avahi mDNS/DNS-SD Daemon”
NAME=“avahi-daemon”
DAEMON="/usr/sbin/$NAME"
SCRIPTNAME=/etc/init.d/$NAME
Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
Include avahi-daemon defaults if available.
test -f /etc/default/avahi-daemon && . /etc/default/avahi-daemon
DISABLE_TAG="/var/run/avahi-daemon/disabled-for-unicast-local"
Function that starts the daemon/service.
d_start() {
$DAEMON -c && return 0
if [ -e $DISABLE_TAG -a “$AVAHI_DAEMON_DETECT_LOCAL” != “0” ]; then
# Disabled because of the existance of an unicast .local domain
log_warning_msg “avahi-daemon disabled because there is a unicast .local domain”
exit 0;
fi;
$DAEMON -D[/code]
The part that I commented out is the five lines above the “$DAEMON -D”.
Now you can either reboot, or issue the following commands:
sudo /etc/init.d/avahi-daemon start
sudo /etc/init.d/shairport start