Mopidy as service, disconnects on playing local track, run on raspbian


#1

Mopidy disconnects on playing local track when run as service, while it works fine when not run as service. Raspberry Pi 3B+, raspbian 9.4 2018-06-27 release.

As suggested here I set permission of /etc/mopidy/ to 777, below is what prints out when I typed sudo mopidyctl config and sudo service mopidy status on disconnection.

Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf config" as user mopidy
/usr/local/lib/python2.7/dist-packages/pylast/__init__.py:51: UserWarning: You are using pylast with Python 2. Pylast will soon be Python 3 only. Moreinfo: https://github.com/pylast/pylast/issues/265
  UserWarning,
[core]
cache_dir = $XDG_CACHE_DIR/mopidy
config_dir = $XDG_CONFIG_DIR/mopidy
data_dir = $XDG_DATA_DIR/mopidy
max_tracklist_length = 10000
restore_state = false

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

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

[local-images]
enabled = true
library = json
base_uri = /images/
image_dir =
album_art_files =
  *.jpg
  *.jpeg
  *.png

[iris]
enabled = true
country = NZ
locale = en_NZ
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
snapcast_enabled = false
snapcast_host = localhost
snapcast_port = 1705

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

[http]
enabled = true
hostname = 10.0.1.18
port = 6680
static_dir =
zeroconf = Mopidy HTTP server on $hostname
allowed_origins =
csrf_protection = true

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

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

[softwaremixer]
enabled = true

[file]
enabled = true
media_dirs =
  $XDG_MUSIC_DIR|Music
  ~/|Home
excluded_file_extensions =
  .jpg
  .jpeg
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[local]
enabled = true
library = json
media_dir = /var/lib/mopidy/media/
scan_timeout = 1000
scan_flush_threshold = 100
scan_follow_symlinks = false
excluded_file_extensions =
  .directory
  .html
  .jpeg
  .jpg
  .log
  .nfo
  .png
  .txt
● mopidy.service - Mopidy music server
   Loaded: loaded (/lib/systemd/system/mopidy.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2018-11-11 14:35:48 KST; 4s ago
  Process: 30374 ExecStart=/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf (code=exited, status=255)
  Process: 30372 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exited, status=0/SUCCESS)
  Process: 30369 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status=0/SUCCESS)
 Main PID: 30374 (code=exited, status=255)

Nov 11 14:35:31 raspberrypi mopidy[30374]:     validation.check_integer(port)
Nov 11 14:35:31 raspberrypi mopidy[30374]:   File "/usr/lib/python2.7/dist-packages/mopidy/internal/validation.py", line 60, in check_integer
Nov 11 14:35:31 raspberrypi mopidy[30374]:     raise exceptions.ValidationError('Expected an integer, not %r' % arg)
Nov 11 14:35:31 raspberrypi mopidy[30374]: ValidationError: Expected an integer, not None
Nov 11 14:35:31 raspberrypi mopidy[30374]: INFO     HTTP server running at [::ffff:10.0.1.18]:6680
Nov 11 14:35:31 raspberrypi mopidy[30374]: INFO     Starting GLib mainloop
Nov 11 14:35:48 raspberrypi mopidy[30374]: * failed to open vchiq instance
Nov 11 14:35:48 raspberrypi systemd[1]: mopidy.service: Main process exited, code=exited, status=255/n/a
Nov 11 14:35:48 raspberrypi systemd[1]: mopidy.service: Unit entered failed state.
Nov 11 14:35:48 raspberrypi systemd[1]: mopidy.service: Failed with result 'exit-code'.

Any help would be appreciated.


#2

I had this problem, * failed to open vchiq instance you need to ensure mopidy is part of the video group, https://docs.mopidy.com/en/latest/installation/raspberrypi/#how-to-for-raspbian


#3

oh my god that was ridiculously simple… thank you so much