Airplay hardware volume control

I have an Allo Boss on a raspberry pi. I was able to get hardware volume control for volumio just fine. However when I connect to airplay, it uses the software control in shairport-sync rather than the hardware control of the Boss. To use hardware volume control I have to pull up the volumio interface and control it from there rather than the volume buttons on my computer, which is very annoying. I tried editing the shairport-sync config file to use the correct alsa parameters but it appears that volumio’s implementation of shairport-sync ignores the config file because the changes have no effect. How can I get hardware volume control directly through airplay?

Where do you update this the config file?
You should probably update the shairport-sync.conf.tmpl file directly, to add your entries for mixer_device and mixer_control_name. That way the plugin will create the right config for you on each boot.

The standard file for configuring shairport-sync is /etc/shairport-sync.conf which is what I’m editing with the proper mixer_device and mixer_control_name. Interestingly, the mixer_device that volumio had populated when I first opened the file was a plughw which is a no-no in my book.
Where would I find this shairport-sync.conf.tmpl?
Also are you implying that this file would create a new shairport-sync.conf on each boot based on it’s content? That doesn’t seem to be the case on my installation because the edits I made were retained through reboots.

No, it doesn’t touch the /etc/shairport-sync.conf file, but rather uses the one located at /tmp/shairport-sync.conf

:~$ 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 Fri 2020-05-15 14:33:27 UTC; 1 day 22h ago
 Main PID: 20746 (shairport-sync)
   CGroup: /system.slice/shairport-sync.service
           └─20746 /usr/local/bin/shairport-sync --configfile=/tmp/shairport-sync.conf

This configuration file is created by the plugin and is rebuilt based on different events (change audio output, change player name, etc etc)

So, if you want to ensure that your changes survive, edit the .tmpl file that is at /volumio/app/plugins/music_service/airplay_emulation/shairport-sync.conf.tmpl.
Beware you’ll lose the ability to perform a system upgrade when you do this, as your device will fail the “System integrity check”, so make a backup of the file so you can restore it when you want to upgrade…

Ah I see. Shaiport-sync reports it was built with sysconfdir=/etc but the service loads a tmp file instead. It also reports it was built with soxr but the template doesn’t utilize that either.
Comparing the template to the index file you linked, it seems the provision for “mixer” variable gets lost, even though I set it in the volumio interface settings. Adding mixer_control_name = “${mixer}” to the template properly populates the mixer name to the config file necessary for control with my DAC. However it still doesn’t quite work because it still uses the plughw alsa device rather than the proper hw. Would it be possible to fix these things in a future update?
Also hypothetically, if I changed the service to load the /etc/shairport-sync.conf instead of editing the template, would system upgrades still work?

For those playing along in the future, I modified the service to load the config in /etc and now I can properly set all the fun parameters like on a normal installation of shairport-sync, inlcuding enabling soxr.
Still would be nice if volumio fixed the template creation though.

1 Like

Oh wow, thanks so much for this, lifesaver. I’ll see if I can make a PR to fix this.