For instance, when it is run with the following code & service script, It will play a 1080 file but not a 4K file. If I run the python outside of systemd script, it will play a 1080 & 4k file just fine. Try it out with the following & let me know if you can figure it out. I greatly appreciate any & all help. Thanks!
EDITED: Rémi pointed me in the right direction for the dbus issue, but the bigger issue is the lack of 4K when using systemd now. Thanks Rémi!!! I've added more Environment= to the service file, but still no luck as of yet.
EDIT: ADDED VLC LOG TO REPLY
PYTHON CODE (testvlc):
Code: Select all
#!/usr/bin/env python
from subprocess import Popen, PIPE
import time
vid = 'somevideo.mp4'
cmd = 'DISPLAY=:0 cvlc -f --no-osd %s -L' % vid
Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE)
while True:
print("Hello!")
time.sleep(5)
Code: Select all
[Unit]
Description=Test VLC From Python Script
[Service]
User=user
Environment="DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus"
Environment="DISPLAY=:0"
Environment="XDG_RUNTIME_DIR=/run/user/1001"
Environment="XAUTHORITY=/home/ppp/.Xauthority"
ExecStart=/usr/bin/screen -D -S testvlc -m /home/user/testvlc
[Install]
WantedBy=multi-user.target