Skip to content

Mopidy Setup ​

Mopidy is a Linux-based media player that can play music from local music files.

Web client ​

sudo python3 -m pip install Mopidy-MusicBox-Webclient

Add [musicbox_webclient] block to /etc/mopidy/mopidy.conf.

...
[musicbox_webclient]
enabled = true
musicbox = false
websocket_host =
websocket_port =
on_track_click = PLAY_ALL

Visit http://avalon.local:6680 to see a list of client, or http://avalon.local:6680/musicbox_webclient to directly access the web UI.

Local ​

Use local which will build metadata for audio files

sudo python3 -m pip install Mopidy-Local

Be sure to move Music library to /home/Music instead of /home/<username>/Music. Otherwise it will complaint about permission

Set permission for the Music dir to mopidy:audio

Add [local] block to /etc/mopidy/mopidy.conf See https://pypi.org/project/Mopidy-Local/ for more settings for this block.

[local]
media_dir = /home/Music
scan_follow_symlinks = true

Finally, scan the local library using mopidyctl instead of the deprecated mopidy local scan

mopidyctl local scan

After it complete scanning, go to the web client and you should see it populated.

You should also see a new web client Local that populates all covert art on http://avalon.local:6680

Install Snapserver ​

wget https://github.com/badaix/snapcast/releases/download/v0.26.0/snapserver_0.26.0-1_amd64.deb
dpkg -i snapserver_0.26.0-1_amd64.deb

Check config at /etc/snapserver.conf. Notice the source statement

...
source = pipe:///tmp/snapfifo?name=default

Restart snapserver

systemctl restart snapserver

Next modify /etc/mopidy/mopidy.conf again and change the output = autoaudiosink in [audio] block to the following:


[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 =

Next, modify the permission of the fifo pipe /tmp/snapfifo.

sudo chown -R mopidy /tmp/snapfifo

Restart mopidy

systemctl restart mopidy

Go to web client and click any track to playback. Check the mopidy logs and it shouldn't prompt error such as mopidy GStreamer error: Could not open file "/tmp/snapfifo" for writing.

Now for the moment of truth. Open another webpage for snapweb (which is a web UI served by snapserver that we installed earlier on port 1780) http://avalon.local:1780/

You should hear music coming out from your device accessing snapweb.

mopidy-Iris ​

A more fancy web player for mopidy.

sudo python3 -m pip install Mopidy-Iris

Restart mopidy and you should see a new web client iris

systemctl restart mopidy

Playing a track.

Configure SnapCast ​

Go to Settings and configure Snapcast on it so that we don't have to open the previous snapweb webpage to listen to the audio.

Configure LastFM ​

You can also configure scrobbing to LastFM

TODO ​

Stream to bluetooth speaker using PulseAudio https://www.technicallywizardry.com/speaker-multi-room-wireless-receiver/

References ​

Full list of extensions: https://mopidy.com/ext/