Raspberry Pi Zero audio playback: vlcpulse audio output error: PulseAudio server connection failure: Connection refused

*nix specific usage questions
Passiday
New Cone
New Cone
Posts: 5
Joined: 28 Jan 2019 20:31

Raspberry Pi Zero audio playback: vlcpulse audio output error: PulseAudio server connection failure: Connection refused

Postby Passiday » 28 Jan 2019 20:37

I am checking if VLC Python bindings (https://wiki.videolan.org/Python_bindings) could serve for my project (media player on Raspberry Pi Zero).

By default, the RasPi Zero does not have audio output, and there are several standard ways to implement one. I chose to go the I2S audio path and set up the system accordingly.

Code: Select all

$ aplay --list-devices **** List of PLAYBACK Hardware Devices **** card 0: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0
I am running Raspbian Stretch Lite, so no GUI. Maybe some of the problems described below are related to this fact.

Testing the mp3 playback from commandline I get the sound, but there are several errors at start:

Code: Select all

$ cvlc song.mp3 VLC media player 3.0.3 Vetinari (revision 3.0.3-1-0-gc2bb759264) [00ed3650] vlcpulse audio output error: PulseAudio server connection failure: Connection refused [00f00f70] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 [00f00f70] main interface error: no suitable interface module [00e79420] main libvlc error: interface "dbus,none" initialization failed [00ef5ee8] main interface error: no suitable interface module [00e79420] main libvlc error: interface "globalhotkeys,none" initialization failed [00ef6198] dummy interface: using the dummy interface module...
When using the VLC Python bindings, only one of those errors remains, but twice:

Code: Select all

import vlc from time import sleep dir_path = os.path.dirname(os.path.realpath(__file__)) file_name = 'song.mp3' p = vlc.MediaPlayer(dir_path + '/' + file_name) p.play() sleep(5) p.stop()

Code: Select all

$ python test.py [0202c9c8] vlcpulse audio output error: PulseAudio server connection failure: Connection refused [0203d000] vlcpulse audio output error: PulseAudio server connection failure: Connection refused

Passiday
New Cone
New Cone
Posts: 5
Joined: 28 Jan 2019 20:31

Re: Raspberry Pi Zero audio playback: vlcpulse audio output error: PulseAudio server connection failure: Connection refu

Postby Passiday » 28 Jan 2019 20:38

I am not sure should I be bothered, after all the audio playback is fine, and probably I could just ignore that error. But maybe there's some parameter, some configuration that I could do to get rid of this error? For example, if I run the cvlc with aout parameter, the 'Connection refused' error goes away:

Code: Select all

$ cvlc song.mp3 --aout alsa VLC media player 3.0.3 Vetinari (revision 3.0.3-1-0-gc2bb759264) [01138098] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 [01138098] main interface error: no suitable interface module [010d6420] main libvlc error: interface "dbus,none" initialization failed [0114b1c0] main interface error: no suitable interface module [010d6420] main libvlc error: interface "globalhotkeys,none" initialization failed [0114b228] dummy interface: using the dummy interface module...

1MAXT3HKphYo
Blank Cone
Blank Cone
Posts: 22
Joined: 29 Jan 2019 01:35

Re: Raspberry Pi Zero audio playback: vlcpulse audio output error: PulseAudio server connection failure: Connection refu

Postby 1MAXT3HKphYo » 29 Jan 2019 03:02

If you want the error to go away you'll have to figure out how to configure pulseaudio on the pi zero. It's not necessary, however, since it seems you already have alsa working. Pulseaudio basically wraps alsa to add some more advanced mixing features and is most useful in a gui environment where you have multiple audio sources that need mixing. It would probably be pointless for your situation using stretch lite.


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 20 guests