Warnings about X11 $DISPLAY on Raspberry Pi
I have Mopidy with GMusic up and running fine on my Raspberry Pi. Except, on every song, I get the following message a couple of times on the terminal:
** (mopidy:7764): WARNING **: Cannot autolaunch D-Bus without X11 $DISPLAY
It doesn't seem to affect any functionality, but since it fills up the terminal quite quickly, I won't see any other messages that might come up.
If it is indeed harmless, can I disable the warning?
These should be entirely harmless.
That said, I'd like to know exactly why they appear and figure out how to suppress them.
I'd be happy to help by doing some debugging. Some extra info:
- Raspberry Pi runs Raspbian;
uname -agivesLinux raspberrypi 3.12.26+ #707 PREEMPT Sat Aug 30 17:39:19 BST 2014 armv6l GNU/Linux - $DISPLAY is indeed not set (not listed by
env - mopidy is run by a user that is member of only the
audiogroup; adding the user to thevideogroup does not help
Could be the avahi zeroconf publish code path triggering DBUS, would be easy enough to disable MPD/HTTP extensions, or at least MPD/HTTP zeroconf publishing and seeing if you can still trigger this.
The zeroconf option for both the MPD extension and the HTTP extension is disabled (at least, the entry is commented out; I'm assuming that by default it is off?).
Default is not off, you can try with 'mopidy config' to see what your effective config is right now. Setting it to a blank value is currently how to turn it off.
Setting zeroconf to blank for both extensions did not resolve the issue; the warning is still there. For playing the first song, the warning appeared 10 times. The count per song seems to be less after the first one.
This might be an easy fix but what about adding 'without X11 $DISPLAY' to warnings.filterwarnings('ignore', 'could not open display')? It works on my Raspberry PI.
@Crosant I'm open to that workaround as soon as we've understood exactly what causes the warning.
OK I will try to help find the reason of the warning.
I found a potential reason. The Error only occurs when the system is using PulseAudio. A quick search in the Raspberry PI forums found me a workaround. ( http://www.raspberrypi.org/forums/viewtopic.php?t=31961&p=278613 )
Does the problem go away with output = alsasink in the settings?
Oh I forgot to mention... Yes it "kills" the warning.
Ok, so it's probably from PulseAudio. What does PulseAudio use D-Bus for? What does one loose from ignoring this warning instead of fixing it?
Still don't feel we've dug properly into this. :-)
So @lcvisser and @Crosant did you both install Pulseaudio? Stock Raspbian doesn't use it AFAIK. I can't reproduce this warning message.
I use output = alsasink. I'm pretty sure I don't have PulseAudio even installed, but I can double-check tonight when I'm home again.
Just FYI - but I know for a fact that Pulseaudio uses D-bus as part of its bluetooth-discovery and bluetooth-device modules.
You can check if pulseaudio is running by issuing a command like pactl stat. You should get an output something like this if it is running:
Currently in use: 1 blocks containing 64.0 KiB bytes total.
Allocated during whole lifetime: 1750 blocks containing 74.6 MiB bytes total.
Sample cache size: 0 B
Server String: /tmp/pulse-9iwkFqIuS2MU/native
Library Protocol Version: 29
Server Protocol Version: 29
Is Local: yes
Client Index: 0
Tile Size: 65496
User Name: root
Host Name: mopidy
Server Name: pulseaudio
Server Version: 5.0
Default Sample Specification: s16le 2ch 44100Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.platform-bcm2835_AUD0.0.analog-stereo
Default Source: alsa_input.platform-snd-rpi-wsp.0.analog-stereo
Cookie: bc6d:eaef
Otherwise pactl will report:
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
Or of course ps aux | grep pulse. It's not running on my stock Raspbian install (which is what you'd hope since it saves some much needed CPU cycles).
pactl command not found. ps also doesn't give me anything. So I deduce it can't be PulseAudio generating those warnings on my system.