Jump to content

[Request] Mopidy and Mopify


Recommended Posts

I would love to test this out in a dockerized environment. Unless there is something else out there that is similar and already exists in a docker!

 

Mopidy is an extensible music server that plays music from local disk, Spotify, SoundCloud, Google Play Music, and more. You edit the playlist from any phone, tablet, or computer using a range of MPD and web clients. http://www.mopidy.com

 

https://github.com/mopidy/mopidy

 

And possibly a docker of Mopify, a Mopidy front-end.

https://github.com/dirkgroenen/mopidy-mopify

687474703a2f2f692e696d6775722e636f6d2f454b50587735622e6a7067.jpg.fc40d30c000f4bace3f70ab292eb0514.jpg

Link to comment

There's a container for mopidy on the dockerhub. I pulled it and it works.  Only problem is this bit.

 

PulseAudio over network

First to make audio from from within a Docker container, you should enable PulseAudio over network; so if you have X11 you may for example do:

 

Install PulseAudio Preferences. Debian/Ubuntu users can do this:

 

$ sudo apt-get install paprefs

Launch paprefs (PulseAudio Preferences) > "Network Server" tab > Check "Enable network access to local sound devices" (you may check "Don't require authentication" to avoid mounting cookie file described below).

 

Restart PulseAudio

 

$ sudo service pulseaudio restart

Link to comment
  • 5 months later...
  • 2 years later...

Hi,

 

it is possible to get mopidy running. I will try to explain it short and if you have some questions just ask.

The trick is not to use pulseaudio ;-)

 

The docker for that is available at the ca apps. 

 

I am using mopidy with snapcast and icecast for streaming the audio signal. you can use one of it but I love sync multi room audio ;-)

 

 

- set up snapcast from kevineye/snapcast 

- set Postargument to snapserver -s pipe:///data/snapfifo?name=Example&sampleformat=44100:16:2

- set up the network to br0 you have to reach your snapcast from the app or snap-client

- mount /mnt/user/appdata/mopidy/tmp/ >> /data for the snapfifo pipe file

 

- or set up icecast from infiniteproject/icecast

- set up the network to br0 you have to reach it over http

- set up env Parameter or use a xml config file

- btw: I had some trouble with stopping the radio by selecting the next track I worked around it wit a fallback config. 

See desciption in: https://hub.docker.com/r/knex666/mopidy

 

- set up the docker from https://hub.docker.com/r/knex666/mopidy

- set up the network to br0
- set up volume mount to /mnt/user/appdata/mopidy/mopidy.conf >> /mopidy.conf

- set up volume mount for tmp/snapfifo if you use snapcast /mnt/user/appdata/mopidy/tmp/ >> /tmp  

- set up volume mount for your local media 

 

generate the mopidy.conf file

Doc here https://docs.mopidy.com/en/latest/config/

example here https://github.com/wernight/docker-mopidy/blob/master/README.md

authentication for soundcloud and spotify https://www.mopidy.com/authenticate/

 

for audio you need a special config

for snapcast you have to generate the audio output in a pipe file /tmp/snapfifo this is mounted in both docker container

[audio]
output = audioresample ! audio/x-raw,rate=48000,channels=2,format=S16LE ! audioconvert ! wavenc ! filesink location=/tmp/snapfifo

 

icecast

[audio]
output = lamemp3enc ! shout2send async=false mount=mopidy ip=X.X.X.X port=8000 password=XXXXX

 

Here you go you can now use snap-client for multi room sync audio or your own icecast http radio stream.

I added youtube and radio stations and I am using Iris with is a very nice web client.

 

Have fun with it!

 

Edited by knex666
Link to comment
  • 1 year later...
54 minutes ago, GooseGoose said:

Hey, can you explain in a bit more detail how you get snapcast working?

 

I am new to docker (other than the ones in CA Apps) and i cant even see where I would put the docker commands that are on the github repo

 

Cheers

Hey,

 

short answer:

 

for snapcast you have to generate the audio output in a pipe file /tmp/snapfifo this is mounted in both docker container.

 

So you have to mount a volume to both container in the snapcast container from docker /data to /mnt/user/appdata/mopidy/tmp/

and inside mopidy docker /tmp and volume mount to /mnt/user/appdata/mopidy/tmp/

 

Edit the config at the [audio] section:

 

[audio]
output = audioresample ! audio/x-raw,rate=48000,channels=2,format=S16LE ! audioconvert ! wavenc ! filesink location=/tmp/snapfifo

 

and you will be fine.


you will get more advice on this thread:

 

 

Cheers

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...