mopidy icon indicating copy to clipboard operation
mopidy copied to clipboard

Warnings about X11 $DISPLAY on Raspberry Pi

Open lcvisser opened this issue 11 years ago • 18 comments

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?

lcvisser avatar Sep 05 '14 19:09 lcvisser

These should be entirely harmless.

That said, I'd like to know exactly why they appear and figure out how to suppress them.

jodal avatar Sep 07 '14 09:09 jodal

I'd be happy to help by doing some debugging. Some extra info:

  • Raspberry Pi runs Raspbian; uname -a gives Linux 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 audio group; adding the user to the video group does not help

lcvisser avatar Sep 07 '14 12:09 lcvisser

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.

adamcik avatar Sep 07 '14 14:09 adamcik

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?).

lcvisser avatar Sep 07 '14 15:09 lcvisser

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.

adamcik avatar Sep 07 '14 15:09 adamcik

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.

lcvisser avatar Sep 07 '14 15:09 lcvisser

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 avatar Sep 08 '14 20:09 Crosant

@Crosant I'm open to that workaround as soon as we've understood exactly what causes the warning.

jodal avatar Sep 08 '14 20:09 jodal

OK I will try to help find the reason of the warning.

Crosant avatar Sep 08 '14 20:09 Crosant

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 )

Crosant avatar Sep 08 '14 20:09 Crosant

Does the problem go away with output = alsasink in the settings?

adamcik avatar Sep 08 '14 20:09 adamcik

Oh I forgot to mention... Yes it "kills" the warning.

Crosant avatar Sep 08 '14 20:09 Crosant

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. :-)

jodal avatar Sep 08 '14 20:09 jodal

So @lcvisser and @Crosant did you both install Pulseaudio? Stock Raspbian doesn't use it AFAIK. I can't reproduce this warning message.

kingosticks avatar Sep 08 '14 23:09 kingosticks

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.

lcvisser avatar Sep 09 '14 06:09 lcvisser

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

liamw9534 avatar Sep 12 '14 16:09 liamw9534

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).

kingosticks avatar Sep 12 '14 17:09 kingosticks

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.

lcvisser avatar Sep 12 '14 19:09 lcvisser