From 04706151b1b0690032c1ccc8d1bf5d23c26c4ba8 Mon Sep 17 00:00:00 2001 From: Stanislaw Grams Date: Sun, 8 Feb 2026 22:37:53 +0100 Subject: [PATCH] [fix](trx-server): start audio capture when decoder tasks are subscribed The capture thread only checked Opus broadcast subscribers to decide whether to start cpal input. PCM tap subscribers (APRS/CW decoders) were not considered, so decoding never started without a browser audio client. Include pcm_tx receiver count in the has_receivers check. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Stanislaw Grams --- src/trx-server/src/audio.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/trx-server/src/audio.rs b/src/trx-server/src/audio.rs index b9918b9..16d10d9 100644 --- a/src/trx-server/src/audio.rs +++ b/src/trx-server/src/audio.rs @@ -110,7 +110,8 @@ fn run_capture( let mut capturing = false; loop { - let has_receivers = tx.receiver_count() > 0; + let has_receivers = tx.receiver_count() > 0 + || pcm_tx.as_ref().map_or(false, |p| p.receiver_count() > 0); if has_receivers && !capturing { let _ = stream.play();