AirPlay Stops Working on Volumio 2.692 on Raspberry Pi 4

After upgrading to the latest Volumio 2.692 on my Raspberry Pi 4, the AirPlay suddenly stopped working. I logged into the console using the default volumio user account and checked out the status of the shairport-sync program. What I found is the following:

$ systemctl status shairport-sync

● shairport-sync.service - Shairport Sync - AirPlay Audio Receiver
Loaded: loaded (/lib/systemd/system/shairport-sync.service; static)
Active: failed (Result: exit-code) since Wed 2019-12-25 16:48:50 UTC; 6s ago
Process: 21262 ExecStart=/usr/local/bin/shairport-sync --configfile=/tmp/shairport-sync.conf (code=exited, status=216/GROUP)
Main PID: 21262 (code=exited, status=216/GROUP)

Dec 25 16:48:50 musicbox systemd[1]: Starting Shairport Sync - AirPlay Audio Receiver…
Dec 25 16:48:50 musicbox systemd[1]: Started Shairport Sync - AirPlay Audio Receiver.
Dec 25 16:48:50 musicbox systemd[1]: shairport-sync.service: main process exited, code=exited, status=216/GROUP
Dec 25 16:48:50 musicbox systemd[1]: Unit shairport-sync.service entered failed state.

Then I launched the shairport-sync program directly using the command line specified in /lib/systemd/system/shairport-sync.service:

$ /usr/local/bin/shairport-sync --configfile=/tmp/shairport-sync.conf

{“time”:1577293129587,“response”:“airplayActive Success”}{“time”:1577293129596,“response”:“startAirplayPlayback Success”}{“time”:1577293143143,“response”:“stopAirplayPlayback Success”}{“time”:1577293153176,“response”:“airplayInactive Success”}

Now the AirPlay worked again!

Therefore, it’s the problem of systemd that’s responsible for launching shairport-sync. The error message “status=216/GROUP” indicates the problem has something to do with user/group privileges. The systemd script of shairport-sync contains the following configuration:

[Service]
ExecStart=/usr/local/bin/shairport-sync --configfile=/tmp/shairport-sync.conf
User=shairport-sync
Group=shairport-sync

So there must be something wrong messed up in the user/group settings in this latest version.

Please kindly record this bug and have it fixed in next release. Many thanks!

After further investigation, I found that the shairport-sync group required in /lib/systemd/system/shairport-sync.service is missing in /etc/group. Then I went to create a shairport-sync group and launched the shairport-sync service again:

$ systemctl status shairport-sync

● shairport-sync.service - Shairport Sync - AirPlay Audio Receiver
Loaded: loaded (/lib/systemd/system/shairport-sync.service; static)
Active: active (running) since Wed 2019-12-25 17:43:40 UTC; 4s ago
Main PID: 4277 (shairport-sync)
CGroup: /system.slice/shairport-sync.service
└─4277 /usr/local/bin/shairport-sync --configfile=/tmp/shairport-sync.conf

Dec 25 17:43:40 musicbox systemd[1]: Started Shairport Sync - AirPlay Audio Receiver.
volumio@musicbox:~$ sudo systemctl status shairport-sync
● shairport-sync.service - Shairport Sync - AirPlay Audio Receiver
Loaded: loaded (/lib/systemd/system/shairport-sync.service; static)
Active: active (running) since Wed 2019-12-25 17:43:40 UTC; 34s ago
Main PID: 4277 (shairport-sync)
CGroup: /system.slice/shairport-sync.service
└─4277 /usr/local/bin/shairport-sync --configfile=/tmp/shairport-sync.conf

But, when I started streaming the music from my iPhone to Voumio, then I saw the following error messages:

$ systemctl status shairport-sync

● shairport-sync.service - Shairport Sync - AirPlay Audio Receiver
Loaded: loaded (/lib/systemd/system/shairport-sync.service; static)
Active: active (running) since Wed 2019-12-25 17:35:23 UTC; 36s ago
Main PID: 2778 (shairport-sync)
CGroup: /system.slice/shairport-sync.service
└─2778 /usr/local/bin/shairport-sync --configfile=/tmp/shairport-sync.conf

Dec 25 17:35:59 musicbox shairport-sync[2778]: ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
Dec 25 17:35:59 musicbox shairport-sync[2778]: the alsa output_device “plughw:5,0” can not be found.

Therefore, there seems some other problems plaguing in the AirPlay service. Hope this can be a hint for your debugging work. Thanks!

After further more digging into the problem, I found the root cause finally:

  1. The group shairport-sync is missing on Raspberry Pi platform (and both the user and group shairport-sync are missing on x86 platform).

  2. The user shairport-sync is not added to the group audio, which caused the access denied error “the alsa output_device “plughw:5,0” can not be found” reported by “systemctl status shairport-sync” command.

Therefore, after creating the missing shairport-sync group on Raspberry Pi (and both the user and group shairport-sync on x86) and adding the user shairport-sync to the audio group, the AirPlay started working correctly.

Thanks!

Great detective work g4x86matrix! I experienced the same problem. Good fix!

Hi

Would you drop here these commands to add group sharepoint-sync and add user sharepoint-sync to audio group.
I,m quite newbie.
Thank you

I’m not smart enough to figure out what steps to take to fix Airplay from this post, but I’m glad to see someone else is experiencing them and that there’s hope for a fix in a future version. I’ve been having the same problem of on 2.692 on my Pi 3 B+ (but playback over the network and other functions work fine; it’s just Airplay that disappeared after a recent update).

Ineffective solution
Logged as User volumio - there is no User=shairport-sync (less /etc/passwd) - so how to add them to the existing audio group ?
“sudo usermod -a -G audio shairport-sync
usermod: user ‘shairport-sync’ does not exist”

Here are the steps to fix the problem:

  1. Creating the missing shairport-sync group on Raspberry Pi and both the user and group shairport-sync on x86 system:
# On both Raspberry Pi and x86
groupadd shairport-sync
# On x86
useradd -g shairport-sync -M -s /usr/sbin/nologin shairport-sync
  1. Adding the user shairport-sync to the audio group:
# On both Raspberry Pi and x86
usermod -aG audio shairport-sync

At last, restart the shairport-sync service:

systemctl restart shairport-sync

Thanks ! :smiley:

But this does not work:
Volumio Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
volumio@volumio:~$ sudo groupadd shairport-syn
volumio@volumio:~$ sudo usermod -aG audio shairport-sync
usermod: user ‘shairport-sync’ does not exist
volumio@volumio:~$ sudo delgroup shairport-sync
Removing group `shairport-sync’ …
Done.

This way WORKS for me:
volumio@volumio:~$ sudo adduser shairport-sync
Adding user shairport-sync' ... Adding new group shairport-sync’ (1001) …
Adding new user shairport-sync' (1001) with group shairport-sync’ …
Creating home directory /home/shairport-sync' ... Copying files from /etc/skel’ …
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for shairport-sync
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] Y
volumio@volumio:~$ sudo passwd -d shairport-sync
passwd: password expiry information changed.
volumio@volumio:~$ sudo usermod -aG audio shairport-sync
volumio@volumio:~$ sudo systemctl restart shairport-sync
volumio@volumio:~$

Thank you very much. I upgraded 2.692 and noticed my AirPlay wasn’t working. You saved me the time of troubleshooting, and now I’m back up and running.

Routine working for Raspberry Pi:

sudo adduser --system --no-create-home --group shairport-sync
sudo usermod -aG audio shairport-sync
sudo systemctl restart shairport-sync

I wonder why this is necessary, as we do it at build time… I think I am missing something

Hi Michelangelo,

the only script line I’ve found creating the user is Build/scripts/volumioconfig.sh

getent passwd shairport-sync &> /dev/null || useradd -r -M -g shairport-sync -s /usr/bin/nologin -G audio shairport-sync >/dev/null

this is not working for Raspbian (adduser not useradd) or i’am missing a script ?

The problem happens to me after updating maybe this problem occurs only if updating from older versions and not with a fresh new image?

Thanks that helps. Airplay is back :slight_smile:

Hello
Here is what I experienced. Please check if it is of any use.

Have installed the latest Volumio on RPi (B+ version) on which Hifiberry DAC is mounted. Could not stream from Ipad as Airplay does not see volumio. After lot of searching on-line have ended up on this discussion using which I could connect to volumio for a brief period.

Have accessed the shairportsync.conf file on /tmp and edit the line
output_device = “plughw:1, 0”;
to
output_device = “hw:0”;

After doing this airplay could see and connect to volumio for a brief period, after which volumio got disappeared again.

thanks

Hello, I thank you for these commands. This got Airplay working for me & my friend. But then that disabled reading my local media music library from the USB drive. Any followup assistance by you or anyone will be greatly appreciated.

Intro real quick… I have an updated Volumio running on a RPi 3B+ using a local 2.5" 2Tb USB 3.0 drive. I loaned my friend my hi-end system, including my Volumio source. All was work well for months before loaning it to him and after at his home. He’s an Apple guy. And I made the mistake of telling him he should be able to stream over Airplay to the Volumio device and play it on the high end system I’m loaning him. It didn’t work however. It wasn’t visible. I found a few threads on the topic. And this one, the instructions above I am replying to specifically, did the trick.

But then, the local USB drive’s music files is no longer being picked up. [!]

When I login to ssh, I see the /dev/sda1 fs mounted at /media/[volume name].
The owner and group is volumio:volumio.
I can CD into the directories and read all files.

The only one oddity I see is when I run ‘df’, I find there is a directory mount named /static, at volume /dev/loop0, and shows 100% use, 0% available.

Should this be the case? I usually worry if I see anything 100% used. But it appears to be mostly a mirror or the root / directory. So not clear what can be removed/deleted; or if it’s even needed (guessing it is?).

Any and All help appreciated from anyone, incl @volumio . Perhaps this should be its own thread. But as the problem of not seeing/reading my local HD library began immediately after applying the group and user add/mods detailed above, I thought perhaps I’d try here 1st.

Thanx!

p.s. 1st post. Joined here to pose this question.