From f96bb0f8c265b247ef1bd2ec5e3853e40e85f295 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Tue, 1 Jul 2025 22:38:56 -0500 Subject: [PATCH] Stable Point - AV/K/M/Mic working --- client/src/app.rs | 13 +++++++++++-- scripts/install/server.sh | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/client/src/app.rs b/client/src/app.rs index a76c0ba..aa7115e 100644 --- a/client/src/app.rs +++ b/client/src/app.rs @@ -3,6 +3,7 @@ use anyhow::Result; use std::time::Duration; use std::sync::Arc; +use std::sync::atomic::{AtomicUsize, Ordering}; use tokio::sync::broadcast; use tokio_stream::{wrappers::BroadcastStream, StreamExt}; use tonic::{transport::Channel, Request}; @@ -255,6 +256,7 @@ impl LesavkaClientApp { /*──────────────── mic stream ─────────────────*/ async fn mic_loop(ep: Channel, mic: Arc) { + static FAIL_CNT: AtomicUsize = AtomicUsize::new(0); loop { let mut cli = RelayClient::new(ep.clone()); @@ -278,10 +280,17 @@ impl LesavkaClientApp { match cli.stream_microphone(Request::new(outbound)).await { Ok(mut resp) => { - // Drain and ignore Empty replies while resp.get_mut().message().await.transpose().is_some() {} } - Err(e) => warn!("❌🎤 connect failed: {e}"), + Err(e) => { + // first failure → warn, subsequent ones → debug + if FAIL_CNT.fetch_add(1, Ordering::Relaxed) == 0 { + warn!("❌🎤 connect failed: {e}"); + warn!("⚠️🎤 further microphone‑stream failures will be logged at DEBUG"); + } else { + debug!("❌🎤 reconnect failed: {e}"); + } + } } let _ = stop_tx.send(()); tokio::time::sleep(Duration::from_secs(1)).await; diff --git a/scripts/install/server.sh b/scripts/install/server.sh index ae75388..1a9f19a 100755 --- a/scripts/install/server.sh +++ b/scripts/install/server.sh @@ -122,7 +122,7 @@ After=network.target lesavka-core.service [Service] ExecStart=/usr/local/bin/lesavka-server Restart=always -Environment=RUST_LOG=lesavka_server=info,lesavka_server::audio=trace,lesavka_server::video=info,lesavka_server::gadget=info +Environment=RUST_LOG=lesavka_server=info,lesavka_server::audio=info,lesavka_server::video=info,lesavka_server::gadget=info Environment=RUST_BACKTRACE=1 Environment=GST_DEBUG="*:2,alsasink:6,alsasrc:6" Restart=always