controller: UI-toggle audio output + astreamselect decouple (Phase 7 Вариант 2)
Web UI checkbox в Audio source карточке: «вывод аудио в стрим». Off →
TV получает silence + downstream audio chain isolated от live-audio RTSP
(нестабильный sidecar поток больше не блокирует video pipeline).
Изменения:
state.InstanceState: + audio_output_enabled (default True)
config.InstanceCfg:
+ audio_output_volume_target (default volume@output_audio)
+ audio_input_select_target (default astreamselect@audio_input)
dispatch.set_audio_output_enabled(enabled):
enabled=False → astreamselect map=1 (anullsrc) + volume=0
enabled=True → astreamselect map=0 (live-audio) + volume=1
Двойная команда: select decouples upstream, volume гарантирует тишину
на случай если в anullsrc что-то не так.
http_api: + GET /audio-output/{instance}, POST /audio-output/{instance}
static/index.html: + checkbox в Audio source header + loadAudioOut/toggleAudioOut
ZMQ smoke test OK. HTTP roundtrip OK.
Сопутствующий pipeline change: docker-compose.phase7.yml — amix заменён
на astreamselect@audio_input (см. localhost-infra commit).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -57,7 +57,7 @@ pre { background:#0f0f12; padding:8px; border-radius:4px; font-size:11px; overfl
|
||||
|
||||
<!-- Audio -->
|
||||
<div class="card">
|
||||
<h2>Audio source</h2>
|
||||
<h2>Audio source <span style="float:right; font-size:11px"><label><input id="audio-out-tog" type="checkbox" onchange="toggleAudioOut()"> вывод аудио в стрим</label></span></h2>
|
||||
<div class="row" id="audio-buttons"></div>
|
||||
</div>
|
||||
|
||||
@@ -181,6 +181,18 @@ async function toggleAuto() {
|
||||
await api('POST', `/auto-layout/${INSTANCE}`, {enabled}, 'auto ' + (enabled?'ON':'OFF'));
|
||||
}
|
||||
|
||||
// ── Audio output toggle (Phase 7 volume@output_audio) ─
|
||||
async function loadAudioOut() {
|
||||
const r = await fetch(`/audio-output/${INSTANCE}`);
|
||||
if (!r.ok) return;
|
||||
const d = await r.json();
|
||||
document.getElementById('audio-out-tog').checked = d.enabled;
|
||||
}
|
||||
async function toggleAudioOut() {
|
||||
const enabled = document.getElementById('audio-out-tog').checked;
|
||||
await api('POST', `/audio-output/${INSTANCE}`, {enabled}, 'audio out ' + (enabled?'ON':'OFF'));
|
||||
}
|
||||
|
||||
// ── Layout buttons ────────────────────────────────────
|
||||
async function loadLayouts() {
|
||||
const r = await fetch(`/layouts/${INSTANCE}`);
|
||||
|
||||
Reference in New Issue
Block a user