Improvements to pulseaudio
- Add a DEBUGGING flag - Make the location of the unix socket configurable While I was here I moved all the priority configs in supervisord to the top. I like it better there
This commit is contained in:
@@ -11,13 +11,24 @@ else
|
||||
echo "Configure pulseaudio to pipe audio to a socket"
|
||||
mkdir -p /tmp/pulse
|
||||
chmod -R a+rw /tmp/pulse
|
||||
|
||||
# Configure the palse audio socket
|
||||
sed -i 's|^; default-server.*$|default-server = unix:/tmp/pulse/pulse-socket|' /etc/pulse/client.conf
|
||||
export PULSE_SERVER=${PULSE_SERVER:-unix:/tmp/pulse/pulse-socket}
|
||||
sed -i "s|^; default-server.*$|default-server = ${PULSE_SERVER}|" /etc/pulse/client.conf
|
||||
sed -i 's|^load-module module-native-protocol-unix.*$|load-module module-native-protocol-unix socket=/tmp/pulse/pulse-socket auth-anonymous=1|' \
|
||||
/etc/pulse/default.pa
|
||||
|
||||
# Disable pulseaudio from respawning (https://unix.stackexchange.com/questions/204522/how-does-pulseaudio-start)
|
||||
sed -i 's|^; autospawn.*$|autospawn = no|' /etc/pulse/client.conf
|
||||
sed -i 's|^; daemon-binary.*$|daemon-binary = /bin/true |' /etc/pulse/client.conf
|
||||
sed -i 's|^; daemon-binary.*$|daemon-binary = /bin/true|' /etc/pulse/client.conf
|
||||
|
||||
# Enable debug logging
|
||||
if [ "X${DEBUGGING:-}" == "X" ]; then
|
||||
sed -i 's|^; log-level.*$|log-level = debug|' /etc/pulse/daemon.conf
|
||||
fi
|
||||
|
||||
# Make startup script executable
|
||||
chmod +x /usr/bin/start-pulseaudio.sh
|
||||
fi
|
||||
chown -R ${USER} /etc/pulse
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
|
||||
[program:dbus]
|
||||
autostart=true
|
||||
priority=10
|
||||
user=%(ENV_USER)s
|
||||
autostart=true
|
||||
autorestart=true
|
||||
directory=/
|
||||
user=%(ENV_USER)s
|
||||
command=dbus-daemon --config-file=/usr/share/dbus-1/system.conf --nofork --nopidfile
|
||||
environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s"
|
||||
autorestart=true
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
[program:desktop]
|
||||
priority=50
|
||||
autostart=true
|
||||
autorestart=true
|
||||
priority=50
|
||||
user=%(ENV_USER)s
|
||||
directory=/home/%(ENV_USER)s
|
||||
command=/usr/bin/start-desktop.sh
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
[program:neko]
|
||||
priority=30
|
||||
autostart=false
|
||||
autorestart=true
|
||||
priority=30
|
||||
user=%(ENV_USER)s
|
||||
# /usr/bin/neko serve --static "/var/www" --display ${DISPLAY} --bind :${PORT_NOVNC_WEB}
|
||||
# /usr/bin/neko serve --static "/var/www" --display ${DISPLAY} --bind :${PORT_NOVNC_WEB} --nat1to1 $(ip route get 1 | awk '{print $(NF-2);exit}') --screen 1280x720@30 --hwenc VAAPI --h264
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
|
||||
[program:pulseaudio]
|
||||
priority=30
|
||||
autostart=true
|
||||
autorestart=true
|
||||
priority=10
|
||||
# TODO: Should this run as user
|
||||
#user=root
|
||||
directory=/
|
||||
user=%(ENV_USER)s
|
||||
command=/usr/bin/pulseaudio -vvvv --disallow-module-loading --disallow-exit --exit-idle-time=-1
|
||||
#command=/usr/bin/pulseaudio -vvvv --system --disallow-module-loading --disallow-exit --exit-idle-time=-1
|
||||
command=/usr/bin/start-pulseaudio.sh
|
||||
environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s"
|
||||
stopsignal=INT
|
||||
stdout_logfile=/home/%(ENV_USER)s/.cache/log/pulseaudio.log
|
||||
stdout_logfile_maxbytes=2MB
|
||||
stdout_logfile_backups=7
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/home/%(ENV_USER)s/.cache/log/pulseaudio.err.log
|
||||
stderr_logfile_maxbytes=2MB
|
||||
stderr_logfile_backups=7
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
[program:sshd]
|
||||
priority=10
|
||||
autostart=true
|
||||
autorestart=true
|
||||
priority=10
|
||||
user=root
|
||||
command=/usr/sbin/sshd -Ddp "%(ENV_PORT_SSH)s"
|
||||
stopsignal=INT
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
# Optionally launch directly to steam big picture (disabled by default)
|
||||
[program:steam]
|
||||
priority=50
|
||||
autostart=false
|
||||
autorestart=true
|
||||
# Retry a restart a few times.
|
||||
# This allows this container to start up before X is ready and restart the process until it becomes available.
|
||||
# Each restart will have a small delay of a few seconds. So 50 attempts should be a few mins.
|
||||
startretries=50
|
||||
priority=50
|
||||
user=%(ENV_USER)s
|
||||
directory=/home/%(ENV_USER)s
|
||||
# command=/usr/games/steam -bigpicture
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
[program:udev]
|
||||
priority=10
|
||||
autostart=false
|
||||
autorestart=true
|
||||
priority=10
|
||||
user=root
|
||||
directory=/
|
||||
command=/usr/bin/start-udev.sh
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
[program:audiostream]
|
||||
priority=30
|
||||
autostart=false
|
||||
autorestart=true
|
||||
priority=10
|
||||
user=%(ENV_USER)s
|
||||
command=tcpserver 127.0.0.1 %(ENV_PORT_AUDIO_STREAM)s gst-launch-1.0 -q pulsesrc server=/tmp/pulse/pulse-socket ! audio/x-raw, channels=2, rate=24000 ! cutter ! opusenc ! webmmux ! fdsink fd=1
|
||||
stopsignal=INT
|
||||
@@ -14,9 +14,9 @@ stderr_logfile_maxbytes=10MB
|
||||
stderr_logfile_backups=7
|
||||
|
||||
[program:audiowebsock]
|
||||
priority=40
|
||||
autostart=false
|
||||
autorestart=true
|
||||
priority=10
|
||||
user=%(ENV_USER)s
|
||||
command=/usr/local/bin/websockify %(ENV_PORT_AUDIO_WEBSOCKET)s localhost:%(ENV_PORT_AUDIO_STREAM)s
|
||||
stopsignal=INT
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
[program:x11vnc]
|
||||
priority=30
|
||||
autostart=false
|
||||
autorestart=true
|
||||
priority=30
|
||||
user=%(ENV_USER)s
|
||||
command=/usr/bin/x11vnc -display %(ENV_DISPLAY)s -rfbport %(ENV_PORT_VNC)s -shared -forever
|
||||
stopsignal=INT
|
||||
@@ -14,9 +14,9 @@ stderr_logfile_maxbytes=10MB
|
||||
stderr_logfile_backups=7
|
||||
|
||||
[program:novnc]
|
||||
priority=30
|
||||
autostart=false
|
||||
autorestart=true
|
||||
priority=30
|
||||
user=%(ENV_USER)s
|
||||
# /opt/noVNC/utils/launch.sh --vnc localhost:${PORT_VNC} --listen ${PORT_NOVNC_SERVICE}
|
||||
command=/opt/noVNC/utils/launch.sh --vnc localhost:%(ENV_PORT_VNC)s --listen %(ENV_PORT_NOVNC_SERVICE)s
|
||||
@@ -30,9 +30,9 @@ stderr_logfile_maxbytes=10MB
|
||||
stderr_logfile_backups=7
|
||||
|
||||
[program:vncproxy]
|
||||
priority=30
|
||||
autostart=false
|
||||
autorestart=true
|
||||
priority=30
|
||||
numprocs=1
|
||||
startsecs=0
|
||||
user=%(ENV_USER)s
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
[program:xorg]
|
||||
priority=20
|
||||
autostart=false
|
||||
autorestart=true
|
||||
priority=20
|
||||
user=root
|
||||
command=/usr/bin/start-xorg.sh
|
||||
environment=DISPLAY="%(ENV_DISPLAY)s",DISPLAY_DPI="%(ENV_DISPLAY_DPI)s"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
[program:xvfb]
|
||||
priority=20
|
||||
autostart=false
|
||||
autorestart=true
|
||||
priority=20
|
||||
user=root
|
||||
command=/usr/bin/Xvfb %(ENV_DISPLAY)s -screen 0 "%(ENV_DISPLAY_SIZEW)sx%(ENV_DISPLAY_SIZEH)sx24"
|
||||
environment=DISPLAY="%(ENV_DISPLAY)s"
|
||||
|
||||
28
overlay/usr/bin/start-pulseaudio.sh
Executable file
28
overlay/usr/bin/start-pulseaudio.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
###
|
||||
# File: start-desktop.sh
|
||||
# Project: bin
|
||||
# File Created: Thursday, 1st January 1970 12:00:00 pm
|
||||
# Author: Josh.5 (jsunnex@gmail.com)
|
||||
# -----
|
||||
# Last Modified: Sunday, 2nd October 2022 22:58:17 pm
|
||||
# Modified By: Josh.5 (jsunnex@gmail.com)
|
||||
###
|
||||
|
||||
# CATCH TERM SIGNAL:
|
||||
_term() {
|
||||
kill -TERM "$pulseaudio_pid" 2>/dev/null
|
||||
}
|
||||
trap _term SIGTERM
|
||||
|
||||
|
||||
# EXECUTE PROCESS:
|
||||
echo "PULSEAUDIO: Starting pulseaudio service"
|
||||
sleep 5
|
||||
#/usr/bin/pulseaudio --disallow-module-loading --disallow-exit --exit-idle-time=-1 &
|
||||
/usr/bin/pulseaudio --exit-idle-time=-1 &
|
||||
pulseaudio_pid=$!
|
||||
|
||||
|
||||
# WAIT FOR CHILD PROCESS:
|
||||
wait "$pulseaudio_pid"
|
||||
Reference in New Issue
Block a user