* Add support for custom PulseAudio cookie configuration
This commit is contained in:
1 parent
efbad18275
commit
b53678e0f3
6 files changed
+25
-2
No files matched your search
@@ -21,6 +21,7 @@ LVA_USER_GROUP="1000"
|
|||||||
# Pipewire Server: /run/user/1000/pulse/native
|
# Pipewire Server: /run/user/1000/pulse/native
|
||||||
LVA_PULSE_SERVER="unix:/run/user/${LVA_USER_ID}/pulse/native"
|
LVA_PULSE_SERVER="unix:/run/user/${LVA_USER_ID}/pulse/native"
|
||||||
LVA_XDG_RUNTIME_DIR="/run/user/${LVA_USER_ID}"
|
LVA_XDG_RUNTIME_DIR="/run/user/${LVA_USER_ID}"
|
||||||
|
LVA_PULSE_COOKIE="/app/configuration/tmp_pulse_cookie"
|
||||||
|
|
||||||
### Path to the preferences file (optional):
|
### Path to the preferences file (optional):
|
||||||
# PREFERENCES_FILE="/app/configuration/preferences.json"
|
# PREFERENCES_FILE="/app/configuration/preferences.json"
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ LABEL \
|
|||||||
# - iproute2: For ss command in entrypoint (port check)
|
# - iproute2: For ss command in entrypoint (port check)
|
||||||
# - procps: For pgrep in healthcheck
|
# - procps: For pgrep in healthcheck
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install --yes --no-install-recommends \
|
apt-get install --yes --no-install-recommends \
|
||||||
avahi-utils \
|
avahi-utils \
|
||||||
pulseaudio-utils \
|
pulseaudio-utils \
|
||||||
alsa-utils \
|
alsa-utils \
|
||||||
|
|||||||
@@ -5,7 +5,12 @@ services:
|
|||||||
image: "ghcr.io/ohf-voice/linux-voice-assistant:latest"
|
image: "ghcr.io/ohf-voice/linux-voice-assistant:latest"
|
||||||
entrypoint: []
|
entrypoint: []
|
||||||
command: "chown -R ${LVA_USER_ID}:${LVA_USER_GROUP} /app/local /app/configuration /app/wakewords/custom /app/sounds/custom"
|
command: "chown -R ${LVA_USER_ID}:${LVA_USER_GROUP} /app/local /app/configuration /app/wakewords/custom /app/sounds/custom"
|
||||||
env_file: .env
|
environment:
|
||||||
|
# Pulseaudio
|
||||||
|
- XDG_RUNTIME_DIR=${LVA_XDG_RUNTIME_DIR}
|
||||||
|
- PULSE_SERVER=${LVA_PULSE_SERVER}
|
||||||
|
- PULSE_COOKIE=${LVA_PULSE_COOKIE}
|
||||||
|
env_file: ${ENV_FILE:-.env}
|
||||||
group_add:
|
group_add:
|
||||||
- audio
|
- audio
|
||||||
volumes:
|
volumes:
|
||||||
@@ -27,6 +32,7 @@ services:
|
|||||||
# Pulseaudio
|
# Pulseaudio
|
||||||
- XDG_RUNTIME_DIR=${LVA_XDG_RUNTIME_DIR}
|
- XDG_RUNTIME_DIR=${LVA_XDG_RUNTIME_DIR}
|
||||||
- PULSE_SERVER=${LVA_PULSE_SERVER}
|
- PULSE_SERVER=${LVA_PULSE_SERVER}
|
||||||
|
- PULSE_COOKIE=${LVA_PULSE_COOKIE}
|
||||||
env_file: .env
|
env_file: .env
|
||||||
group_add:
|
group_add:
|
||||||
- audio
|
- audio
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ services:
|
|||||||
image: "ghcr.io/ohf-voice/linux-voice-assistant:latest"
|
image: "ghcr.io/ohf-voice/linux-voice-assistant:latest"
|
||||||
entrypoint: []
|
entrypoint: []
|
||||||
command: "chown -R ${LVA_USER_ID}:${LVA_USER_GROUP} /app/local /app/configuration /app/wakewords/custom /app/sounds/custom"
|
command: "chown -R ${LVA_USER_ID}:${LVA_USER_GROUP} /app/local /app/configuration /app/wakewords/custom /app/sounds/custom"
|
||||||
|
environment:
|
||||||
|
# Pulseaudio
|
||||||
|
- XDG_RUNTIME_DIR=${LVA_XDG_RUNTIME_DIR}
|
||||||
|
- PULSE_SERVER=${LVA_PULSE_SERVER}
|
||||||
|
- PULSE_COOKIE=${LVA_PULSE_COOKIE}
|
||||||
env_file: ${ENV_FILE:-.env}
|
env_file: ${ENV_FILE:-.env}
|
||||||
group_add:
|
group_add:
|
||||||
- audio
|
- audio
|
||||||
@@ -27,6 +32,7 @@ services:
|
|||||||
# Pulseaudio
|
# Pulseaudio
|
||||||
- XDG_RUNTIME_DIR=${LVA_XDG_RUNTIME_DIR}
|
- XDG_RUNTIME_DIR=${LVA_XDG_RUNTIME_DIR}
|
||||||
- PULSE_SERVER=${LVA_PULSE_SERVER}
|
- PULSE_SERVER=${LVA_PULSE_SERVER}
|
||||||
|
- PULSE_COOKIE=${LVA_PULSE_COOKIE}
|
||||||
env_file: ${ENV_FILE:-.env}
|
env_file: ${ENV_FILE:-.env}
|
||||||
group_add:
|
group_add:
|
||||||
- audio
|
- audio
|
||||||
|
|||||||
@@ -81,6 +81,14 @@ if [ -n "${UNMUTE_SOUND}" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Add cookie file for pulseaudio to prevent errors
|
||||||
|
if [ ! -f "$PULSE_COOKIE" ]; then
|
||||||
|
echo "Creating PulseAudio cookie file"
|
||||||
|
touch "$PULSE_COOKIE"
|
||||||
|
chmod 600 "$PULSE_COOKIE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
### Wait for PulseAudio
|
### Wait for PulseAudio
|
||||||
# Wait for PulseAudio to be available before starting the application
|
# Wait for PulseAudio to be available before starting the application
|
||||||
CP_MAX_RETRIES=30
|
CP_MAX_RETRIES=30
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ Environment=PATH=/home/pi/linux-voice-assistant/.venv/bin:/usr/bin:/bin
|
|||||||
# Environment=CLIENT_NAME="My Voice Assistant Speaker"
|
# Environment=CLIENT_NAME="My Voice Assistant Speaker"
|
||||||
Environment=LVA_PULSE_SERVER="unix:/run/user/${LVA_USER_ID}/pulse/native"
|
Environment=LVA_PULSE_SERVER="unix:/run/user/${LVA_USER_ID}/pulse/native"
|
||||||
Environment=LVA_XDG_RUNTIME_DIR="/run/user/${LVA_USER_ID}"
|
Environment=LVA_XDG_RUNTIME_DIR="/run/user/${LVA_USER_ID}"
|
||||||
|
Environment=LVA_PULSE_COOKIE="/home/pi/linux-voice-assistant/tmp_pulse_cookie"
|
||||||
Environment=PREFERENCES_FILE="/home/pi/linux-voice-assistant/preferences.json"
|
Environment=PREFERENCES_FILE="/home/pi/linux-voice-assistant/preferences.json"
|
||||||
# Environment=NETWORK_INTERFACE="eth0"
|
# Environment=NETWORK_INTERFACE="eth0"
|
||||||
# Environment=HOST="0.0.0.0"
|
# Environment=HOST="0.0.0.0"
|
||||||
@@ -276,6 +277,7 @@ The following variables can be configured in the `.env` or in the service file:
|
|||||||
| `CLIENT_NAME` | (optional) | Custom name for this voice assistant instance |
|
| `CLIENT_NAME` | (optional) | Custom name for this voice assistant instance |
|
||||||
| `LVA_PULSE_SERVER` | `unix:/run/user/${LVA_USER_ID}/pulse/native` | Path to the PulseAudio/PipeWire socket |
|
| `LVA_PULSE_SERVER` | `unix:/run/user/${LVA_USER_ID}/pulse/native` | Path to the PulseAudio/PipeWire socket |
|
||||||
| `LVA_XDG_RUNTIME_DIR` | `/run/user/${LVA_USER_ID}` | XDG runtime directory |
|
| `LVA_XDG_RUNTIME_DIR` | `/run/user/${LVA_USER_ID}` | XDG runtime directory |
|
||||||
|
| `LVA_PULSE_COOKIE` | `/app/configuration/tmp_pulse_cookie` | Cookie file for PulseAudio if you use encryption. By default disabled. We use a tmp file to avoid errors if the file is not found |
|
||||||
| `ENABLE_DEBUG` | (optional) | Set to "1" to enable debug mode |
|
| `ENABLE_DEBUG` | (optional) | Set to "1" to enable debug mode |
|
||||||
| `LIST_DEVICES` | (optional) | Set to "1" to list audio devices instead of starting |
|
| `LIST_DEVICES` | (optional) | Set to "1" to list audio devices instead of starting |
|
||||||
| `PREFERENCES_FILE` | (optional) | Path to a custom preferences JSON file |
|
| `PREFERENCES_FILE` | (optional) | Path to a custom preferences JSON file |
|
||||||
|
|||||||
Reference in new issue
Block a user