Volumio is a great dedicated audio player for raspberry pi, with integrated support for Spotify Connect.
Here’s a short step by step how to install the snapcast plugin by saiyato, to use volumio as a multi room audio system:
- Install Volumio
- activate SSH on your Volumio (via the webinterface: “http://volumio.local/dev”)
- install the snapcast plugin via SSH (SSH username=volumio, pass=volumio)
git clone https://github.com/Saiyato/volumio-snapcast-plugin.git
volumio plugin install
- configure the snapcast plugin via the webinterface on your server and your clients. Should be self-explanatory
- Nice-to-have: the android app “SnapDroid”, which lets you set the individual volumes of the snapcast devices
The advantage of the Snapcast solution over other multi-room systems is that Snapcast picks up the audio signal after the source and distributes it to the clients as an audio stream (FLAC, PCM or .ogg – FLAC works best). That’s the only way to serve multiple clients simultaneously with just one Spotify account.
Codec wise, you can choose from PCM, ogg and FLAC. FLAC together with “-c flac: 4” in the “Additional CLI commands” sounds and works best, here’s more info.
If you want to use Spotify Connect, it gets a bit more complicated:
- Install “Volumio Spotify Connect 2” via the plugin menu in the web interface and activate if not already done
- Under the snapcast plug-in settings both at the server, as well as with all clients, set everywhere 44.1 kHz, otherwise it comes to funny errors in resampling (otherwise Spotify music is too fast / hochgepitched)
- Under the snap-shot plug-in settings of the server, in the “Spotify Integration” section, set “volspotconnect2” and click save
- Reload the Snapcast plug-in window
- The selection field under “Patch Spotify Configuration File” should now have been updated automatically according to the upper settings. In our case there should be “volspotifyconnect2”.
- Now click on “patch file”
- Switch to the Spotify Connect plugin
- Click here directly on “save” (the previously patched file is now activated)
If you want to use the Spotify stand-alone plug-in from Volumio, follow the steps above.
However, at the time of this blog entry, the standalone Spotify plugin is broken because Spotify has recently changed the API – you can no longer browse its playlists. There is a somewhat complicated temporary fix here (you need a refresh token for this). Update December 2019: A fixed official Plugin got released recently!
Àpropos “Fix”: For some reason, Volumio doesn’t fetch the correct time zone, UTC is assumed. To fix that, you enter the following via SSH:
sudo nano /etc/default/crda
in the editor then complete:
save and close, then:
timedatectl set-ntp tru
sudo dpkg-reconfigure tzdata
then follow the menu and set the correct time zone, in my case Europe> Berlin. Check if it worked, go with:
If you have an old laptop lying around, you can also install the x86 version of Volumio on a bootable USB stick and boot your laptop. This automatically gives you the Volumio kiosk version, ie you do not need a web-interface to control Volumio, but you can do this directly on the laptop, which might be very useful for parties, for example.
To use Volumio as a Spotify alarm clock with the Standalone Spotify (SPOP), is a bit tricky. Volumio’s built-in alarm does not work with Spotify playlists…
Solution: cronjob! You have to install this first:
sudo apt-get install cron
you create a new crontab:
# weekdays 30 7 * * 1-5 /volumio/app/plugins/system_controller/volumio_command_line_client/volumio.sh next 15 8 * * 1-5 /volumio/app/plugins/system_controller/volumio_command_line_client/volumio.sh pause #weekend 25 9 * * 6,7 /volumio/app/plugins/system_controller/volumio_command_line_client/volumio.sh next 30 10 * * 6,7 /volumio/app/plugins/system_controller/volumio_command_line_client/volumio.sh pause
In the example above, your “alarm” goes off from 7:30 to 8:15 on weekdays, and at the weekend from 9:25 to 10:30.
If you have set / fixed the timezone as described before, you are good to go (with “date” you can check again, if your system time is correctly set).
Now you have to put the Spotify tracks or Spotify playlists (attention: Spotify playlists will be cropped from 100 tracks!) Into the queue of Volumio, and best set playback to random.
Finished! From now on you have a Spotify alarm clock! This also works with snapcast!
I made “fade-in” scripts, to use volumio as a radio clock in the morning, to use via cron job:
Version 2: Controls the volumio volume via CLI commands