Pulse audio is require to stream using steam link

This commit is contained in:
Josh.5
2022-01-14 08:45:58 +13:00
parent ad9cbb9bca
commit 14871dcecd
4 changed files with 23 additions and 22 deletions

View File

@@ -5,7 +5,7 @@
# File Created: Saturday, 8th January 2022 2:34:23 pm # File Created: Saturday, 8th January 2022 2:34:23 pm
# Author: Josh.5 (jsunnex@gmail.com) # Author: Josh.5 (jsunnex@gmail.com)
# ----- # -----
# Last Modified: Tuesday, 11th January 2022 9:43:50 pm # Last Modified: Friday, 14th January 2022 8:45:00 am
# Modified By: Josh.5 (jsunnex@gmail.com) # Modified By: Josh.5 (jsunnex@gmail.com)
### ###
@@ -101,6 +101,7 @@ sleep 1
# Run # Run
docker run -d --name="${container_name}" \ docker run -d --name="${container_name}" \
--privileged=true \ --privileged=true \
--network=host \
--ipc="host" \ --ipc="host" \
-e PUID="99" \ -e PUID="99" \
-e PGID="100" \ -e PGID="100" \
@@ -116,11 +117,10 @@ docker run -d --name="${container_name}" \
-e DISPLAY_SIZEH="720" \ -e DISPLAY_SIZEH="720" \
-e DISPLAY_SIZEW="1280" \ -e DISPLAY_SIZEW="1280" \
-e DISPLAY_VIDEO_PORT="DFP" \ -e DISPLAY_VIDEO_PORT="DFP" \
-e DISPLAY=":55" \ -e DISPLAY=":2" \
-e NVIDIA_DRIVER_CAPABILITIES="all" \ -e NVIDIA_DRIVER_CAPABILITIES="all" \
-e NVIDIA_VISIBLE_DEVICES="all" \ -e NVIDIA_VISIBLE_DEVICES="all" \
-p 8083:8083 \ -e ENABLE_VNC_AUDIO="false" \
-p 32123:32123 \
-v "${project_base_path}/config/home/default-${container_name}":"/home/default":"rw" \ -v "${project_base_path}/config/home/default-${container_name}":"/home/default":"rw" \
-v "/tmp/":"/tmp/":"rw" \ -v "/tmp/":"/tmp/":"rw" \
--hostname="${container_name}" \ --hostname="${container_name}" \

View File

@@ -1,5 +1,5 @@
echo "**** Configure pulseaudio ****" echo "**** Configure VNC audio ****"
if [[ "${ENABLE_VNC_AUDIO}" == "true" ]]; then if [[ "${ENABLE_VNC_AUDIO}" == "true" ]]; then
echo "Configure pulseaudio to use a socket to pipe audio to VNC" echo "Configure pulseaudio to use a socket to pipe audio to VNC"
sed -i 's|^; default-server.*$|default-server = unix:/tmp/pulseaudio.socket|' /etc/pulse/client.conf sed -i 's|^; default-server.*$|default-server = unix:/tmp/pulseaudio.socket|' /etc/pulse/client.conf
@@ -19,11 +19,12 @@ if [[ "${ENABLE_VNC_AUDIO}" == "true" ]]; then
rm /opt/noVNC/audio.patch rm /opt/noVNC/audio.patch
fi fi
# Enable supervisord script # Enable supervisord script
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor/conf.d/audio.conf sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor/conf.d/vnc-audio.conf
else else
echo "Disable pulseaudio" echo "Disable audio stream"
echo "Disable audio websock"
# Disable supervisord script # Disable supervisord script
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor/conf.d/audio.conf sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor/conf.d/vnc-audio.conf
fi fi

View File

@@ -0,0 +1,12 @@
[program:pulseaudio]
autostart=true
priority=10
directory=/
command=/usr/bin/pulseaudio -vvvv --disallow-module-loading --disallow-exit --exit-idle-time=-1
user=%(ENV_USER)s
environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s"
autorestart=true
stopsignal=QUIT
stdout_logfile=/home/%(ENV_USER)s/.cache/log/pulseaudio.log
stderr_logfile=/home/%(ENV_USER)s/.cache/log/pulseaudio.err

View File

@@ -1,18 +1,6 @@
[program:pulseaudio]
autostart=true
priority=10
directory=/
command=/usr/bin/pulseaudio -vvvv --disallow-module-loading --disallow-exit --exit-idle-time=-1
user=%(ENV_USER)s
environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s"
autorestart=true
stopsignal=QUIT
stdout_logfile=/home/%(ENV_USER)s/.cache/log/pulseaudio.log
stderr_logfile=/home/%(ENV_USER)s/.cache/log/pulseaudio.err
[program:audiostream] [program:audiostream]
autostart=true autostart=false
priority=10 priority=10
command=tcpserver localhost 5901 gst-launch-1.0 -q pulsesrc server=/tmp/pulseaudio.socket ! audio/x-raw, channels=2, rate=24000 ! cutter ! opusenc ! webmmux ! fdsink fd=1 command=tcpserver localhost 5901 gst-launch-1.0 -q pulsesrc server=/tmp/pulseaudio.socket ! audio/x-raw, channels=2, rate=24000 ! cutter ! opusenc ! webmmux ! fdsink fd=1
user=%(ENV_USER)s user=%(ENV_USER)s
@@ -22,7 +10,7 @@ stdout_logfile=/home/%(ENV_USER)s/.cache/log/audiostream.log
stderr_logfile=/home/%(ENV_USER)s/.cache/log/audiostream.err stderr_logfile=/home/%(ENV_USER)s/.cache/log/audiostream.err
[program:audiowebsock] [program:audiowebsock]
autostart=true autostart=false
priority=10 priority=10
command=/usr/local/bin/websockify 32123 localhost:5901 command=/usr/local/bin/websockify 32123 localhost:5901
user=%(ENV_USER)s user=%(ENV_USER)s