SystemD 应用程序没有声音

SystemD 应用程序没有声音

我正在尝试运行一个信息亭应用程序,这要归功于 systemd 服务启动的 chromium 中播放的一些视频。当我手动启动以下脚本时,我可以听到视频的声音

#!/bin/bash
xset s noblank
xset s off
xset -dpms

unclutter -idle 0.5 -root &

LIBVA_DRIVER_NAME=i965 /usr/bin/chromium-browser --noerrdialogs --autoplay-policy=no-user-gesture-required --disable-accelerated-video-decode --start-fullscreen --kiosk --incognito --disable-translate --no-first-run --fast --fast-start --disable-infobars --disable-features=TranslateUI --disk-cache-dir=/dev/null  --password-store=basic http://127.0.0.1

不幸的是,当我的 kiosk.service 启动脚本时,没有声音(我在论坛上发现了一些类似的案例,但似乎没有一个能解决我的问题)

cat /lib/systemd/system/kiosk.service
[Unit]
Description=Chromium Kiosk
Wants=graphical.target
After=graphical.target

[Service]
User=user1
Group=user1
Environment=DISPLAY=:0
Environment=XAUTHORITY=/home/user1/.Xauthority
Type=simple
ExecStart=/bin/bash /home/user1/kiosk.sh
Restart=on-abort

[Install]
WantedBy=graphical.target

地位 :

user1@user1-nuc:~$ sudo systemctl status kiosk.service 
● kiosk.service - Chromium Kiosk
     Loaded: loaded (/lib/systemd/system/kiosk.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2020-09-06 17:52:11 CEST; 10s ago
   Main PID: 2822 (bash)
      Tasks: 102 (limit: 4523)
     Memory: 424.4M
     CGroup: /system.slice/kiosk.service
             ├─2822 /bin/bash /home/user1/kiosk.sh
             ├─2840 unclutter -idle 0.5 -root
             ├─2841 /usr/lib/chromium-browser/chromium-browser --enable-pinch --noerrdialogs --autoplay-policy=no-user-gesture-required --disable-accelerated-video-decode --start-fullscreen --kiosk --incognito >
             ├─2849 /usr/lib/chromium-browser/chromium-browser --type=zygote --no-zygote-sandbox --noerrdialogs
             ├─2850 /usr/lib/chromium-browser/chromium-browser --type=zygote --noerrdialogs
             ├─2852 /usr/lib/chromium-browser/chromium-browser --type=zygote --noerrdialogs
             ├─2872 /usr/lib/chromium-browser/chromium-browser --type=gpu-process --field-trial-handle=12499335857368612092,12890752898176720314,131072 --disable-features=TranslateUI --noerrdialogs --gpu-prefer>
             ├─2874 /usr/lib/chromium-browser/chromium-browser --type=utility --field-trial-handle=12499335857368612092,12890752898176720314,131072 --disable-features=TranslateUI --lang=en-US --service-sandbox->
             ├─2899 /usr/lib/chromium-browser/chromium-browser --type=renderer --autoplay-policy=no-user-gesture-required --disable-accelerated-video-decode --disable-webrtc-apm-in-audio-service --field-trial-h>
             ├─2926 /usr/lib/chromium-browser/chromium-browser --type=renderer --autoplay-policy=no-user-gesture-required --disable-accelerated-video-decode --disable-webrtc-apm-in-audio-service --field-trial-h>
             ├─2969 /usr/lib/chromium-browser/chromium-browser --type=renderer --autoplay-policy=no-user-gesture-required --disable-accelerated-video-decode --disable-webrtc-apm-in-audio-service --field-trial-h>
             └─2983 /usr/lib/chromium-browser/chromium-browser --type=utility --field-trial-handle=12499335857368612092,12890752898176720314,131072 --disable-features=TranslateUI --lang=en-US --service-sandbox->

sept. 06 17:52:13 user1-nuc bash[2841]: [2841:2871:0906/175213.315275:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp>
sept. 06 17:52:13 user1-nuc bash[2841]: [2841:2871:0906/175213.315295:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp>
sept. 06 17:52:13 user1-nuc bash[2841]: [2841:2871:0906/175213.315317:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp>
sept. 06 17:52:13 user1-nuc bash[2841]: [2841:2871:0906/175213.315336:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp>
sept. 06 17:52:13 user1-nuc bash[2841]: [2841:2871:0906/175213.315370:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp>
sept. 06 17:52:19 user1-nuc bash[2841]: [2841:2871:0906/175219.534878:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp>
sept. 06 17:52:19 user1-nuc bash[2841]: [2841:2871:0906/175219.534969:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp>
sept. 06 17:52:19 user1-nuc bash[2841]: [2841:2871:0906/175219.535020:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp>
sept. 06 17:52:19 user1-nuc bash[2841]: [2841:2871:0906/175219.535098:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp>
sept. 06 17:52:19 user1-nuc bash[2841]: [2841:2871:0906/175219.535135:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp>

你对此有什么想法吗?

相关内容