Can’t seem get VLC module to run in python as sudo – Raspberry Pi 4 env

  Kiến thức lập trình

Trying to set up a self-run app on my Raspberry Pi that runs a Gonk droid.

I’ve installed VLC to be able to play the sounds.

When I try to run the app with sudo (I’ve been told I need this ability to get the python app to run as an autostart script at boot), I get this error message

$ sudo python GonkRunVLC.py
[010209e8] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[01051b50] vlcpulse audio output error: PulseAudio server connection failure: Connection refused

Making the assumption it is a rights issue, can someone clue me in?

When I run it without sudo it runs just fine!

The audio files are one sub directory below the app….

Ex: /home/me/programs/sounds/sound.mp3
Ex: python script is in on /home/me/programs/

~/my_programs $ python GonkRunVLC.py   (Runs)

~/my_programs $ sudo python GonkRunVLC.py
[010209e8] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[01051b50] vlcpulse audio output error: PulseAudio server connection failure: Connection refused

New contributor

Wjl is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT