A number of questions using Mopidy

Congrats to this great tool!

System: Raspberry Pi, Raspian 4.1.4-v7+ #808 SMP PREEMPT
Installed mopidy through # Mopidy APT archive.
Added musicbox_webclient through sudo pip install Mopidy-MusicBox-Webclient.

All of the below worked before I did the upgrade to moipdy V 1.1. .

In order to run a single mopidy.conf for user mopidy, root and my only normal user, I use and edit this file
sudo nano /etc/mopidy/mopidy.conf
and copy it to the root and user home directory
sudo cp /root/.config/mopidy/mopidy.conf /etc/mopidy/mopidy.conf
sudo cp /root/.config/mopidy/mopidy.conf ~/.config/mopidy/mopidy.conf

    mopidy.conf:
    # For further information about options in this file see:

#   xhttp://docs.mopidy.com/
#
# The initial commented out values reflect the defaults as of:
#   Mopidy 1.1.0
#   Mopidy-File 1.1.0
#   Mopidy-HTTP 1.1.0
#   Mopidy-Local 1.1.0
#   Mopidy-M3U 1.1.0
#   Mopidy-MPD 1.1.0
#   Mopidy-MusicBox-Webclient 2.0.0
#   Mopidy-SoftwareMixer 1.1.0
#   Mopidy-Stream 1.1.0
#
# Available options and defaults might have changed since then,
# run `mopidy config` to see the current effective config and
# `mopidy --version` to check the current version.

[core]
cache_dir = $XDG_CACHE_DIR/mopidy
config_dir = $XDG_CONFIG_DIR/mopidy
data_dir = $XDG_DATA_DIR/mopidy
max_tracklist_length = 10000

[logging]
color = true
console_format = %(levelname)-8s %(message)s
debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n  %(message)s
debug_file = mopidy.log
#debug_file = /mnt/server/music/mopidy.log
#debug_file = /var/log/mopidy/mopidy.log
config_file =

[audio]
mixer = software
mixer_volume = 
output = autoaudiosink

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

[musicbox_webclient]
enabled = true
musicbox = false

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

[http]
enabled = true
hostname = 0.0.0.0
port = 6680
static_dir =
#zeroconf = Mopidy HTTP server on $hostname
zeroconf =

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

[m3u]
enabled = true
#playlists_dir = $XDG_DATA_DIR/mopidy/m3u
playlists_dir = /mnt/server/music/playlists

[softwaremixer]
enabled = true

[file]
enabled = true
# media_dirs = $XDG_MUSIC_DIR|Music
media_dirs = /mnt/server/music/music
#  ~/|Home
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[local]
enabled = true
library = json
#media_dir = $XDG_MUSIC_DIR
media_dir = /mnt/server/music/music
data_dir = $XDG_DATA_DIR/mopidy/local
scan_timeout = 1000
scan_flush_threshold = 1000
scan_follow_symlinks = false
excluded_file_extensions = 
#  .directory
#  .html
#  .jpeg
#  .jpg
#  .log
#  .nfo
#  .png
#  .txt 

So sudo mopidy config shows

[core]
cache_dir = $XDG_CACHE_DIR/mopidy
config_dir = $XDG_CONFIG_DIR/mopidy
data_dir = $XDG_DATA_DIR/mopidy
max_tracklist_length = 10000

[logging]
color = true
console_format = %(levelname)-8s %(message)s
debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n  %(message)s
debug_file = mopidy.log
config_file =

[audio]
mixer = software
mixer_volume = 
output = autoaudiosink

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

[musicbox_webclient]
enabled = true
musicbox = false

[mpd]
enabled = true
hostname = 0.0.0.0
port = 6600
password = 
max_connections = 20
connection_timeout = 60
zeroconf = 
command_blacklist = 

[http]
enabled = true
hostname = 0.0.0.0
port = 6680
static_dir =
zeroconf = 

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

[m3u]
enabled = true
playlists_dir = /mnt/server/music/playlists

[softwaremixer]
enabled = true

[file]
enabled = true
media_dirs = 
  /mnt/server/music/music
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[local]
enabled = true
library = json
media_dir = /mnt/server/music/music
data_dir = $XDG_DATA_DIR/mopidy/local
scan_timeout = 1000
scan_flush_threshold = 1000
scan_follow_symlinks = false
excluded_file_extensions = 

Question 1) does that work to have one mopidy.conf for all?

Question 2) why is there no content in /var/log/mopidy/mopidy.log?

Starting sudo mopidy and using the web frontend of
xhttp://xx.x.x.xx/musicbox_webclient/index.html#stream
most of the streams provide issues
Pinguin Radio:

** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY
WARNING Problem scanning URI xhttp://pr320.pinguinradio.com/listen.pls: Could not determine type of stream.
WARNING Track is not playable: xhttp://pr320.pinguinradio.com/listen.pls

=> and no sound

Groove Salad:

** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY
ERROR StreamBackend needs to be updated to work with this version of Mopidy.
WARNING Track is not playable: xhttp://somafm.com/groovesalad.pls
=> no sound

BBC
** **(mopidy:3706): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY
WARNING Element doesn’t implement handling of this stream. Please file a bug.
=> Sound works

Sublime FM, a stream I added:

** **(mopidy:3761): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY
ERROR StreamBackend needs to be updated to work with this version of Mopidy.
WARNING Track is not playable: xhttp://8.201.47.68/SublimeFM2.m3u

=> no sound

Question 3) how do I get this working again ?

Regarding " StreamBackend needs to be updated" I tried to update the gstreamer 0.10 to a 1.0 Version, but it did not help.

Lastly, I try to have a radio stream playing when the mopidy comes up
by
sudo nano /etc/rc.local

#!/bin/sh

###!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

mount -a
mount

sudo service mopidy status
sudo service mopidy stop
sudo service mopidy status
sudo mopidy local scan
sudo mopidyctl local scan
sudo service mopidy start
sudo service mopidy status
sudo sleep 5
sudo mpc add http://82.201.47.68/SublimeFM2.m3u
sudo mpc play 1


exit 0

=> no sound.

trying
sudo mpc add http://8.201.47.68/SublimeFM2.m3u
sudo paden@ourpi2m ~ $ mpc play 1

to a
sudo mopidy Server
gives

INFO     New MPD connection from [127.0.0.1]:50543

** (mopidy:3096): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** (mopidy:3096): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** (mopidy:3096): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** (mopidy:3096): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** (mopidy:3096): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY
WARNING  Problem scanning URI http://8.201.47.68/SublimeFM2.m3u: Timeout after 5000ms
WARNING  Track is not playable: http://8.201.47.68/SublimeFM2.m3u

** (mopidy:3096): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** (mopidy:3096): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** (mopidy:3096): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** (mopidy:3096): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY

** (mopidy:3096): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY
WARNING  Problem scanning URI http://8.201.47.68/SublimeFM2.m3u: Timeout after 5000ms
WARNING  Track is not playable: http://8.201.47.68/SublimeFM2.m3u



** (mopidy:3046): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY
WARNING  Problem scanning URI http://8.201.47.68/SublimeFM2.m3u: Timeout after 5000ms
WARNING  Track is not playable: http://8.201.47.68/SublimeFM2.m3u

Question 4) Whats wrong with mopidy and mpc playing streams? Again, this worked before.

Looking forward to advise …

Yehaa!

sudo apt-get install build-essential python-dev    
sudo pip install Mopidy-MusicBox-Webclient --upgrade

fixed Question 3 and 4 - music plays again, but Warnings still occur

** (mopidy:3047): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY
WARNING  Element doesn't implement handling of this stream. Please file a bug.

You may need to install some more Phyton tools as the error messages say.

One step beyond…

Hi DerDonDon
Question 1 : I had the exact same issue.
Let me explain how I solved it, even if I’m not 100% of the impacts of what i did

I want to run mopidy as a service, so i edited /etc/mopidy/mopidy.conf
My config file looks like yours especially this line
config_dir = $XDG_CONFIG_DIR/mopidy

I guess that this line is forcing mopidy to look to the config file which is located in $XDG_CONFIG/mopidy instead of looking to the default one when mopidy is run as a service (ie /etc/mopidy).
I don’t know how to read the content of $XDG_CONFIG, but I’m 99% sure it is not equal to “/etc”.

So did force to /etc/mopidy thanks to the following line
config_dir = /etc/mopidy
In fact I did the same for the 2 other lines.

then I restarted the service and everything is OK now

Hope this will help to make your second step beyond !!

Why are you doing this? What is wrong with just running Mopidy as a service?

You only need to specify config values for the particular settings where the value you want differs from the default. Nearly all of your config file is unnecessary and it’ll lead to problems.

Mopidy uses gstreamer0.10. Trying to upgrade to 1.0 won’t help.

/etc/rc.local is run by the root user so no commands inside of it require sudo. And there is never any reason to run mpc as root. Why are you running mopidy local scan here? Lastly, it’ll probably work most of the time but there is no guarantee that Mopidy will be ready to receive MPD commands after 5 seconds so that’s not a great idea.

Thanks for your comments!!!

@kingosticks:
I find the concept of 3 users (pi to log in, root to run and mopidy for the service quite confusing, especially since different .conf files are used.

Thats why I want to keep the 3 .conf file 1:1:1 the same, so I can test any way getting the same results.
I will take the 'sudo’s out of the rc.local, just for sanity.
mopidy scan local is for the sake of having the same database content for all users, again. Better to do it while reboot, than forget it all of the time.
Finally, the 5 seconds work on a Pi2, nut tested on a Pi1. Are you aware of a more clever way than empiric testing?

@moema_sp- I will try your tip. If that works, It makes things much easier. How do I figure if the users pi and mopidy have access tot he file /etc/mopidy/mopidy.conf? I assume
sudo chmod 660 /etc/mopidy/mopidy.conf

Typically you run Mopidy as a system service, there is one config file (at /etc/mopidy/mopidy.conf) and you ensure the mopidy user has permission to read your music directory. You login as pi as normal and you can interact with the service. In most cases there should be nothing else to worry about, no need for multiple config files and no need to manually run Mopidy. I’m not sure what you mean by “root to run” and the fact that the service runs as user mopidy shouldn’t impact your usage (outside of the previously mentioned music directory permissions).

If you really want to use the same config and run mopidy as a bunch of random users (I can’t see the benefit of this) then just create a bunch of symlinks all pointing to a single config file and ensure the permissions are adequate for all users to read it.

Are you aware of a more clever way than empiric testing?