Let the Device field be picked, not typed blind
Diagnosing capture on a real TV meant reading pactlSources off the screen and typing an exact PulseAudio source name back in through the same remote-driven text field — no way to copy-paste, easy to mistype, and the one piece of information (which source, if any, is actually RUNNING) was buried in a JSON dump. Added two choice() pickers bound to the same capture.device setting: one built from pactlSources (pulse/auto backends), one built from alsaCapturePcms (alsa backend), both parsed from diagnostics the service already collects — no new Luna method needed. Diagnostics already run once at boot, so the picker is populated immediately, before the user ever presses "Run diagnostics" by hand. Picking a value writes straight into capture.device, and the plain text field stays as the fallback for anything the parser misses. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
f3a4cddfd6
commit
0759cc00aa
@@ -0,0 +1,20 @@
|
||||
# Runs host/lgtv-audiocap-receiver.py as a container instead of a systemd
|
||||
# unit — for setups (e.g. Unraid) where Docker is the native way to run
|
||||
# anything, but the ALSA loopback itself still has to be loaded on the real
|
||||
# host kernel first (see unraid/lgtv-audiocap-loopback.plg or
|
||||
# host/install-loopback.sh --method alsa, whichever fits the host).
|
||||
#
|
||||
# Build from the repo root, not this directory, so the image always tracks
|
||||
# the same receiver the systemd install path uses — no second copy to drift:
|
||||
# docker build -f docker/Dockerfile -t lgtv-audiocap-receiver .
|
||||
FROM alpine:3.20
|
||||
|
||||
RUN apk add --no-cache python3 alsa-utils
|
||||
|
||||
COPY host/lgtv-audiocap-receiver.py /usr/local/bin/lgtv-audiocap-receiver.py
|
||||
COPY docker/entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /usr/local/bin/lgtv-audiocap-receiver.py /entrypoint.sh
|
||||
|
||||
EXPOSE 5004/udp
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# Maps environment variables onto lgtv-audiocap-receiver.py's flags, since
|
||||
# that's how Unraid (and most container UIs) expose configuration — nobody
|
||||
# wants to hand-edit a CLI in the "extra parameters" box.
|
||||
set -eu
|
||||
|
||||
args="--port ${PORT:-5004} --bind ${BIND:-0.0.0.0}"
|
||||
args="$args --output ${OUTPUT:-aplay} --device ${DEVICE:-hw:Loopback,0,0}"
|
||||
args="$args --rate ${RATE:-48000} --channels ${CHANNELS:-2}"
|
||||
args="$args --latency-ms ${LATENCY_MS:-80} --prebuffer-ms ${PREBUFFER_MS:-60}"
|
||||
args="$args --max-gap ${MAX_GAP:-200} --reset-after ${RESET_AFTER:-5.0}"
|
||||
args="$args --stats ${STATS:-30}"
|
||||
|
||||
[ -n "${MULTICAST:-}" ] && args="$args --multicast $MULTICAST"
|
||||
[ -n "${IFACE:-}" ] && args="$args --iface $IFACE"
|
||||
[ "${FILL_SILENCE:-1}" = "0" ] && args="$args --no-fill-silence"
|
||||
|
||||
# Anything passed on the "docker run" command line (or Unraid's "Extra
|
||||
# Parameters") is appended last, so it can override an env-derived flag —
|
||||
# and so plain `--help` works instead of silently starting the daemon.
|
||||
echo "lgtv-audiocap-receiver.py $args $*"
|
||||
# shellcheck disable=SC2086
|
||||
exec python3 /usr/local/bin/lgtv-audiocap-receiver.py $args "$@"
|
||||
Reference in New Issue
Block a user