Volumio2 Bluetooth Plugin - Spotify Edition

Friday, September 24, 2021

Volumio

t f B! P L

Volumio2 Bluetooth Plugin enables Bluetooth output on the latest Volumio2 image as of September 2021. However, the settings described at that time only enabled Bluetooth output for the local music library and web radio; the Spotify plugin required additional configuration, which is explained here.

After Spotify plugin installation

Spotify Plugins for Volumio2

Volumio2 has two official Spotify plugins. Here is a brief explanation of their differences.

Spotify Plugin

This plugin adds a Spotify menu to Volumio2 itself, allowing direct playback of the Spotify music library from Volumio. A Spotify Premium account is required.

Volumio Spotify Connect2 Plugin

This plugin allows Volumio2 to be selected as a playback device from the official Spotify app on a smartphone or other device.

In an environment where Volumio2 is always connected to a Bluetooth speaker, if you want to play through the same Bluetooth speaker when listening via the Spotify app on your phone as you do from Volumio2, simply switching the device connection on the phone side switches the Volumio2 input source, making this plugin + Bluetooth output combination useful.

This plugin itself does not require Spotify account information to run on Volumio2, but the sending Spotify app should require a Spotify Premium account.

Bluetooth Output Configuration for the Spotify Plugin

To configure Bluetooth output for the Spotify plugin, first SSH into Volumio2.

$ ssh volumio@volumio

After SSH login, edit the following file.

$ cd /data/plugins/music_service/spop
$ cp spop.conf.tmpl spop.conf.tmpl.bak
$ nano spop.conf.tmpl
…
[sox]
output_type = alsa
#output_name = ${outdev}
output_name = bluealsa

Then, go to Settings > Playback Options > Audio Output, select any output device from the choices, and click Save. After that, restart Volumio2. After startup, select and connect a Bluetooth receiver device in the Bluetooth plugin. Spotify tracks should then output via Bluetooth.

Note that /data/plugins/music_service/spop/spop.conf.tmpl is generated as /etc/spopd.conf when the playback options audio output is updated, and that configuration is what is actually referenced.

Bluetooth Output Configuration for the Volumio Spotify Connect2 Plugin

To configure Bluetooth output for the Volumio Spotify Connect2 plugin, after SSH login, do the following.

$ cd /data/plugins/music_service/volspotconnect2
$ cp volspotify.tmpl volspotify.tmpl.bak
$ nano volspotify.tmpl
...
[Output]
#device = '${outdev}'
device = 'bluealsa'
initial-volume = ${initvol}
mixer = '${mixer}' # softvolume or alsa
mixer-name = '${mixname}'
#mixer-card = '${mixdev}'
#mixer-index = ${mixidx}
#Disable alsa's mapped volume scale (cubic). Default false
mixer-linear-volume = ${mixlin}
backend = 'alsa'
...

After that, restart Volumio2. After startup, select and connect a Bluetooth receiver device in the Bluetooth plugin.


Next, from the Spotify app on your phone, click the device icon

Spotify app: No device selected (phone)

Select the Volumio device on the next screen.

Spotify app: Select Volumio device

Once connected to the Volumio device as shown below, audio should output via Bluetooth.

Spotify app: Connected to Volumio device

The edited volspotify.tmpl file is generated as a volspotify.toml file upon restart, and that configuration is what is actually referenced.

Differences Between Normal Playback and Spotify Plugin Playback

The reason additional configuration is needed for Spotify plugin playback is that normal playback uses mpd + alsa, while the Spotify plugin uses sox, and Volumio Spotify Connect2 (presumably) uses alsa without going through mpd.

For the same reason, while normal playback could output simultaneously to both a regular output device like a USB DAC and Bluetooth, playback via the Spotify plugin or Volumio Spotify Connect2 plugin currently requires choosing either the regular output device or Bluetooth.


This concludes the explanation of how to configure Bluetooth output when using Spotify-related plugins with Volumio2.

About Me

My photo
Electronics, programming & audio

Featured Post

Synchronizing Radio-Controlled Clocks with Raspberry Pi Pico W (JJY Standard Radio Wave Emulator)

As a Raspberry Pi Pico W application, I built a JJY emulator for radio-controlled clocks (for time synchronization) with minimal peripheral...

QooQ