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
# 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)
###
@@ -101,6 +101,7 @@ sleep 1
# Run
docker run -d --name="${container_name}" \
--privileged=true \
--network=host \
--ipc="host" \
-e PUID="99" \
-e PGID="100" \
@@ -116,11 +117,10 @@ docker run -d --name="${container_name}" \
-e DISPLAY_SIZEH="720" \
-e DISPLAY_SIZEW="1280" \
-e DISPLAY_VIDEO_PORT="DFP" \
-e DISPLAY=":55" \
-e DISPLAY=":2" \
-e NVIDIA_DRIVER_CAPABILITIES="all" \
-e NVIDIA_VISIBLE_DEVICES="all" \
-p 8083:8083 \
-p 32123:32123 \
-e ENABLE_VNC_AUDIO="false" \
-v "${project_base_path}/config/home/default-${container_name}":"/home/default":"rw" \
-v "/tmp/":"/tmp/":"rw" \
--hostname="${container_name}" \

View File

@@ -1,5 +1,5 @@
echo "**** Configure pulseaudio ****"
echo "**** Configure VNC audio ****"
if [[ "${ENABLE_VNC_AUDIO}" == "true" ]]; then
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
@@ -19,11 +19,12 @@ if [[ "${ENABLE_VNC_AUDIO}" == "true" ]]; then
rm /opt/noVNC/audio.patch
fi
# 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
echo "Disable pulseaudio"
echo "Disable audio stream"
echo "Disable audio websock"
# 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

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]
autostart=true
autostart=false
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
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
[program:audiowebsock]
autostart=true
autostart=false
priority=10
command=/usr/local/bin/websockify 32123 localhost:5901
user=%(ENV_USER)s