Dbus refused to connect to a vlc service, and audio became dithering noise.

*nix specific usage questions
Seiken
New Cone
New Cone
Posts: 4
Joined: 05 Sep 2019 22:29

Dbus refused to connect to a vlc service, and audio became dithering noise.

Postby Seiken » 07 Sep 2019 10:29

I installed vlc in a headless Debian 10 server and trying to stream a webcam to localhost. When I ran cvlc directly things worked fine, but when I use a .sh file to launch cvlc as a systemd service all sounds turned into some dithering noise.

The .sh file:

Code: Select all

echo "Starting camera service..."; cvlc v4l2:// :input-slave=alsa:// :v4l2-standard=1 :v4l2-dev=/dev/video0 :live-caching=1000 :sout="#transcode{vcodec=theo, vb=1000, scale=0.5, fps=5, acodec=vorb, ab=128, channels=1$, samplerate=44100}:duplicate{dst=gather:std{dst=:8080/stream.ogg,access=http}}}"
The .service file:

Code: Select all

[Unit] Description=Security camera service. [Service] Type=simple User=username ExecStart=/bin/bash /location/of/securecamera.sh [Install] WantedBy=multi-user.target
And I got the error message with systemctl status:

Code: Select all

9月 07 15:54:29 verite systemd[1]: Started Security camera service.. 9月 07 15:54:29 verite bash[8925]: Starting camera service... 9月 07 15:54:29 verite bash[8925]: [0000561b4b1839a0] vlcpulse audio output error: PulseAudio server connection failure: Connection refused 9月 07 15:54:29 verite bash[8925]: [0000561b4b22e1f0] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 9月 07 15:54:29 verite bash[8925]: [0000561b4b22e1f0] main interface error: no suitable interface module 9月 07 15:54:29 verite bash[8925]: [0000561b4b0af580] main libvlc error: interface "dbus,none" initialization failed 9月 07 15:54:29 verite bash[8925]: [0000561b4b22da70] main interface error: no suitable interface module 9月 07 15:54:29 verite bash[8925]: [0000561b4b0af580] main libvlc error: interface "globalhotkeys,none" initialization failed 9月 07 15:54:29 verite bash[8925]: [0000561b4b22da70] dummy interface: using the dummy interface module... 9月 07 15:54:29 verite bash[8925]: [00007f96384ca130] mux_ogg mux: Open
I have tried several options like "-A alsa,none" and some device relative options but no luck. Some options could make the service started without the "PulseAudio server connection failure" line but still cannot get sounds other than noise.

How could I start vlc as a service and streaming video with valid sound?

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Dbus refused to connect to a vlc service, and audio became dithering noise.

Postby Rémi Denis-Courmont » 07 Sep 2019 10:50

Ignore the D-Bus and PulseAudio errors that stem from the lack of user session. You won't be able to listen/view, but streaming is fine, subject to suitably configured system permissions.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Seiken
New Cone
New Cone
Posts: 4
Joined: 05 Sep 2019 22:29

Re: Dbus refused to connect to a vlc service, and audio became dithering noise.

Postby Seiken » 09 Sep 2019 07:26

Thank you, but I still have no idea about how to fix this. I have turned on -vvv and saw no notable error message in systemd journal. And I noticed that the stream still got audio that response to real sounds, but with loud noise and unrecognizable some times, which didn't happened when it started directly with cvlc.

Any advise about this?

Seiken
New Cone
New Cone
Posts: 4
Joined: 05 Sep 2019 22:29

Re: Dbus refused to connect to a vlc service, and audio became dithering noise.

Postby Seiken » 10 Sep 2019 18:31

Okay I found the problem. I didn't noticed that my mini computer (ECS Liva Z2V) have a built-in microphone and just use input-slave=alsa:// as my audio record device. When I started cvlc directly it chose my webcam buit-in microphone but chose the computer built-in microphone when it started as a system service.

The problem solved when I used

Code: Select all

arecord -L
to list device names, then assigned the specific device in my code:

Code: Select all

cvlc v4l2:// :input-slave=alsa://hw:C920,0 :v4l2-standard=1 :v4l2-dev=/dev/video0 :live-caching=1000 :sout="#transcode{vcodec=theo, vb=1000, scale=0.5, fps=5, acodec=vorb, ab=128, channels=1$, samplerate=44100}:duplicate{dst=gather:std{dst=:8080/stream.ogg,access=http}}}"


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

Who is online

Users browsing this forum: No registered users and 17 guests