Mopidy and Snapclient Spotify output

Good day to all,

I am a newbie to Mopidy but managed to get it somehow setup.

  1. OS - Raspbian lite.
  2. Hardware - Rasp 4 and Rasp 3
  3. I have snapserver and snap client installed on the mopidy server and snapclient on the “dining room” pi.
  4. Iris is installed with Spotify which plays through the mopidy server >headphone jack > Logitech speakers

Issue: I am unable to play Spotify through raspberry pi (3) > Headphone Jack > Bose speaker.
Note: on the client, I do hear audio when I run the command
aplay /usr/share/sounds/alsa/Front_Center.wav”

Snap client log:
sudo service snapclient status
● snapclient.service - Snapcast client
Loaded: loaded (/lib/systemd/system/snapclient.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-12-29 22:31:24 CST; 11h ago
Docs: man:snapclient(1)
Main PID: 325 (snapclient)
Tasks: 2 (limit: 881)
CGroup: /system.slice/snapclient.service
└─325 /usr/bin/snapclient --logsink=system mopidy

Preformatted text`Dec 30 10:03:03 diningroom snapclient[325]: ServerSettings - buffer: 1000, latency: 0, volume: 64,
Dec 30 10:03:03 diningroom snapclient[325]: ServerSettings - buffer: 1000, latency: 0, volume: 88,
Dec 30 10:03:04 diningroom snapclient[325]: ServerSettings - buffer: 1000, latency: 0, volume: 92,
Dec 30 10:03:04 diningroom snapclient[325]: ServerSettings - buffer: 1000, latency: 0, volume: 100
Dec 30 10:03:05 diningroom snapclient[325]: ServerSettings - buffer: 1000, latency: 0, volume: 96,
Dec 30 10:03:05 diningroom snapclient[325]: ServerSettings - buffer: 1000, latency: 0, volume: 44,
Dec 30 10:03:05 diningroom snapclient[325]: ServerSettings - buffer: 1000, latency: 0, volume: 28,
Dec 30 10:03:05 diningroom snapclient[325]: ServerSettings - buffer: 1000, latency: 0, volume: 12,
Dec 30 10:03:05 diningroom snapclient[325]: ServerSettings - buffer: 1000, latency: 0, volume: 8,
Dec 30 10:03:05 diningroom snapclient[325]: ServerSettings - buffer: 1000, latency: 0, volume: 4,

Could you explain your setup again, it is not clear. Is ‘raspberry pi (3)’ == “dining room” pi?

Is the Mopidy server configured to output to snapserver? How? If not, how it audio supposed to get to other pi? If so, how is “mopidy server >headphone jack > Logitech speakers” working?

Provide your Mopidy config: https://docs.mopidy.com/en/latest/troubleshooting/#show-effective-configuration

My apologies for not being clear:

Q: Is ‘raspberry pi (3)’ == “dining room” pi?
A: Yes the Pi3 is the dining room pi.

Q: Is the Mopidy server configured to output to snapserver.
A: Yes, through “mopidy server >headphone jack > Logitech speakers”.

Mopidy server - ```
Running “/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf config” as user mopidy
[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy
max_tracklist_length = 10000
restore_state = false

[logging]
verbosity = 0
format = %(levelname)-8s [%(threadName)s] %(name)s %(message)s
color = false
config_file =

[audio]
mixer = software
mixer_volume =
output = autoaudiosink
buffer_time =

[proxy]
scheme =
hostname =
port =
username =
password =

[mobile]
enabled = true
title = Mopidy Mobile on $hostname
ws_url =

[iris]
enabled = true
country = us
locale = en_US
spotify_authorization_url = https://jamesbarnsley.co.nz/iris/auth_spotify.php
lastfm_authorization_url = https://jamesbarnsley.co.nz/iris/auth_lastfm.php
genius_authorization_url = https://jamesbarnsley.co.nz/iris/auth_genius.php
data_dir = $XDG_DATA_DIR/iris

[file]
enabled = true
media_dirs =
$XDG_MUSIC_DIR|Music
~/|Home
excluded_file_extensions =
.directory
.html
.jpeg
.jpg
.log
.nfo
.pdf
.png
.txt
.zip
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[http]
enabled = true
hostname = 192.168.17.52
port = 6680
zeroconf = Mopidy HTTP server on $hostname
allowed_origins =
csrf_protection = true
default_app = iris

[m3u]
enabled = true
base_dir =
default_encoding = latin-1
default_extension = .m3u8
playlists_dir =

[softwaremixer]
enabled = true

[stream]
enabled = true
protocols =
http
https
mms
rtmp
rtmps
rtsp
metadata_blacklist =
timeout = 5000

[spotify]
enabled = true
username = email address
password = ********
client_id = ID Entered
client_secret = ********
bitrate = 320
volume_normalization = true
private_session = false
timeout = 30
allow_cache = true
allow_network = true
allow_playlists = true
search_album_count = 20
search_artist_count = 10
search_track_count = 50
toplist_countries =

[mpd]
enabled = true
hostname = 127.0.0.1
port = 6600
password =
max_connections = 20
connection_timeout = 60
zeroconf = Mopidy MPD server on $hostname
command_blacklist =
listall
listallinfo
default_playlist_scheme = m3u

Snapclient

START_SNAPCLIENT=true
SNAPCLIENT_OPTS=“mopidy”

OK, so how in your system, does Spotify audio get from Mopidy on pi 4 to snapclient on pi 3? Normally Mopidy’s output would be configured to use a fifo or some other mechanism. Then the snapserver would connect to the other end of the fifo (or whatever mechanism) so it could access the audio data and send it to snapclients. I don’t see anything like that in the setup you’ve described.

Q: so how in your system, does Spotify audio get from Moidy on pi 4 to snapclient on pi 3?
A: this is the issue, no Spotify audio is getting from the Mopidy on pi4 to the snapclient on the pi3.

I think you are correct and this is missing I will need to figure this out.
" Mopidy’s output would be configured to use a fifo or some other mechanism."

Note: when I run the command (aplay /usr/share/sounds/alsa/Front_Center.wav”) on the pi 3 I do get audio output which tells me the connection to the pi3 > bose speak is correct.

There’s some good information available on the snapcast github pages about how to interface snapcast and Mopidy.

Thank you again for your help.

It’s ages since I used it unfortunately, however I think you should have the snapclient set up on each Pi you are using, you also need to change the [audio] to something like this.
[audio]
mixer = software
mixer_volume =
#output = autoaudiosink
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo
buffer_time =

This page here is also very good.
It explains the whole set up quite well and simply, I’ve found in the past the info from the snapcast pages is very good, but quite difficult to follow and implement. The only thing I noticed is that some of the info might be out of date as it was written before the latest version of Mopidy was released.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.