Playback issue on Raspberry Pi

I installed Mopidy and the GMusic extension successfully on my Raspberry Pi according to the instructions. I can use the Musicbox web client to browse my music and such. (Note: I didn’t use the Pi Musicbox image, as I already have a working setup with a bunch of stuff installed.)

When selecting a track, I get the following error:

** (mopidy:6465): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY (repeated about 10 times)
ERROR    GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure. Debug message: gstplaysink.c(1899): gen_audio_chain (): /GstPlayBin2:playbin20/GstPlaySink:playsink0

Of course, as a result I don’t get any music. I’m not even sure if the two (warning and error) are related. I start Modipy in a ‘screen’ session via SSH, so I’m not surprised it can’t find a $DISPLAY.
Aside from that, I have no clue on how to even begin to debug this issue. Some help is much appreciated!

(And apologies if this is not the correct forum. If it is a bug, I can post it to the project issue tracker, but before I do so, I would like to know what’s going on.)


Some extra info:

$ mopidy deps

Platform: Linux-3.12.26±armv6l-with-debian-7.6
Python: CPython 2.7.3 from /usr/lib/python2.7
Mopidy: 0.19.4 from /usr/local/lib/python2.7/dist-packages
setuptools: 5.7 from /usr/local/lib/python2.7/dist-packages/setuptools-5.7-py2.7.egg
Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
tornado>=2.3: 4.0.1 from /usr/local/lib/python2.7/dist-packages
certifi: 14.05.14 from /usr/local/lib/python2.7/dist-packages
backports.ssl-match-hostname: 3.4.0.2 from /usr/local/lib/python2.7/dist-packages
Mopidy-GMusic: 0.3.0 from /usr/local/lib/python2.7/dist-packages
setuptools: 5.7 from /usr/local/lib/python2.7/dist-packages/setuptools-5.7-py2.7.egg
Mopidy>=0.18: 0.19.4 from /usr/local/lib/python2.7/dist-packages
setuptools: 5.7 from /usr/local/lib/python2.7/dist-packages/setuptools-5.7-py2.7.egg
Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
tornado>=2.3: 4.0.1 from /usr/local/lib/python2.7/dist-packages
certifi: 14.05.14 from /usr/local/lib/python2.7/dist-packages
backports.ssl-match-hostname: 3.4.0.2 from /usr/local/lib/python2.7/dist-packages
Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/dist-packages
gmusicapi>=4.0.0: 4.0.0 from /usr/local/lib/python2.7/dist-packages
validictory>=0.8.0,!=0.9.2: 1.0.0a2 from /usr/local/lib/python2.7/dist-packages
decorator>=3.3.1: 3.4.0 from /usr/local/lib/python2.7/dist-packages
mutagen>=1.18: 1.24 from /usr/local/lib/python2.7/dist-packages
protobuf>=2.4.1: 2.6.0 from /usr/local/lib/python2.7/dist-packages
setuptools: 5.7 from /usr/local/lib/python2.7/dist-packages/setuptools-5.7-py2.7.egg
requests>=1.1.0,!=1.2.0,!=2.2.1: 2.4.0 from /usr/local/lib/python2.7/dist-packages
certifi: 14.05.14 from /usr/local/lib/python2.7/dist-packages
python-dateutil>=1.3,!=2.0: 2.2 from /usr/local/lib/python2.7/dist-packages
six: 1.7.3 from /usr/local/lib/python2.7/dist-packages
proboscis>=1.2.5.1: 1.2.6.0 from /usr/local/lib/python2.7/dist-packages
oauth2client>=1.1: 1.2 from /usr/local/lib/python2.7/dist-packages
httplib2>=0.8: 0.9 from /usr/local/lib/python2.7/dist-packages
mock>=0.7.0: 1.0.1 from /usr/local/lib/python2.7/dist-packages
appdirs>=1.1.0: 1.4.0 from /usr/local/lib/python2.7/dist-packages
GStreamer: 0.10.36.0 from /usr/lib/python2.7/dist-packages/gst-0.10/gst
Detailed information:
Python wrapper: gst-python 0.10.22.0
Relevant elements:
Found:
uridecodebin
souphttpsrc
appsrc
alsasink
osssink
oss4sink
id3demux
id3v2mux
lame
mad
mp3parse
vorbisdec
vorbisenc
vorbisparse
oggdemux
oggmux
oggparse
flacdec
flacparse
shout2send
Not found:
pulsesink
flump3dec

$ mopidy

INFO Starting Mopidy 0.19.4
INFO Loading config from: builtin defaults, /etc/xdg/mopidy/mopidy.conf, /home/mpd/.config/mopidy/mopidy.conf, command line options
INFO Enabled extensions: mpd, http, stream, gmusic, softwaremixer, local
INFO Disabled extensions: none
INFO Starting Mopidy mixer: SoftwareMixer
INFO Mixing using GStreamer software mixing
INFO Starting Mopidy audio
INFO Starting Mopidy backends: GMusicBackend, LocalBackend, StreamBackend
INFO Mopidy uses Google Music
INFO Audio output set to "alsasink"
INFO Loaded 0 local playlists from /home/mpd/.local/share/mopidy/local/playlists
INFO No local library metadata cache found at /home/mpd/.local/share/mopidy/local/library.json.gz. Please run mopidy local scan to index your local music library. If you do not have a local music collection, you can disable the local backend to hide this message.
INFO Loaded 0 local tracks using json
INFO Starting Mopidy core
INFO Start refreshing Google Music library
INFO Starting Mopidy frontends: HttpFrontend, MpdFrontend
INFO MPD server running at [::ffff:127.0.0.1]:6600
INFO HTTP server running at [::]:6680
INFO Loaded 0 playlists from Google Music
INFO Finished refreshing Google Music content in 13s

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

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

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

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

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

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

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

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

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

** (mopidy:6465): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY
ERROR GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure. Debug message: gstplaysink.c(1899): gen_audio_chain (): /GstPlayBin2:playbin20/GstPlaySink:playsink0
^CINFO Interrupted. Exiting…
INFO Stopping Mopidy frontends
INFO Stopping Mopidy core
INFO Stopping Mopidy backends
INFO Stopping Mopidy audio
INFO Stopping Mopidy mixer

Are you using raspbian? Are you using pulseaudio? Does gst-launch-0.10 audiotestsrc ! audioresample ! autoaudiosink work?

EDIT: Oh and are you using the analogue output? Is the snd_bcm2835 module loaded (sudo modprobe snd_bcm2835) ?

Yes, I am using Raspbian. I am unsure if I’m using pulse audio; how do I find out? gst-launch gives me an error (see below). I am indeed using the analogue output. Executing sudo mod probe snd_bcm2835 gives back nothing, so I guess the module is not loaded.

$ gst-launch-0.10 audiotestsrc ! audioresample ! autoaudiosink

Setting pipeline to PAUSED …
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
ERROR: Pipeline doesn’t want to pause.
ERROR: from element /GstJackAudioSink:autoaudiosink0-actual-sink-jackaudio: Jack server not found
Additional debug info:
gstjackaudiosink.c(358): gst_jack_ring_buffer_open_device (): /GstJackAudioSink:autoaudiosink0-actual-sink-jackaudio:
Cannot connect to the Jack server (status 17)
Setting pipeline to NULL …
Freeing pipeline …

If it’s just normal raspbian then you’ll be using ALSA. You could run aplay -l do double check it’s alive. Note that modprobe is all one word. You can run lsmod to get a list of what exactly is loaded. Please try running gst-launch-0.10 audiotestsrc ! audioresample ! alsasink.

Using alsasink gave me an annoying continuous beep, and the following output:

$ gst-launch-0.10 audiotestsrc ! audioresample ! alsasink

Setting pipeline to PAUSED …
Pipeline is PREROLLING …
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstAudioSinkClock
^CCaught interrupt – handling interrupt.
Interrupt: Stopping pipeline …

(gst-launch-0.10:7173): GLib-CRITICAL **: Source ID 17 was not found when attempting to remove it
Execution ended after 12273261733 ns.
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

Some auto-formatting put the space between mod and probe. I double checked, and the command doesn’t give any output. However, I see the module in lsmod:

$ sudo lsmod

Module Size Used by
ipv6 315765 16
snd_bcm2835 19584 0
snd_soc_bcm2708_i2s 6202 0
regmap_mmio 2818 1 snd_soc_bcm2708_i2s
snd_soc_core 127841 1 snd_soc_bcm2708_i2s
snd_compress 8259 1 snd_soc_core
regmap_i2c 1661 1 snd_soc_core
snd_pcm_dmaengine 5505 1 snd_soc_core
regmap_spi 1913 1 snd_soc_core
snd_pcm 83845 3 snd_bcm2835,snd_soc_core,snd_pcm_dmaengine
snd_page_alloc 5132 1 snd_pcm
evdev 10661 2
snd_seq 55484 0
joydev 9257 0
snd_seq_device 6469 1 snd_seq
snd_timer 20998 2 snd_pcm,snd_seq
leds_gpio 2079 0
led_class 4118 1 leds_gpio
snd 62252 7 snd_bcm2835,snd_soc_core,snd_timer,snd_pcm,snd_seq,snd_seq_device,snd_compress

The output of aplay -l:

$ aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0

Ok, call me an idiot.

I was testing all of the above as user pi, while Mopidy runs under a differed user. Adding this user to the audio group solved the problem. Credit goes to the gst-launch tip, which gave me a permission denied error when running it under the Mopidy user.