[feat](trx-client): add diagnostic logging for decode pipeline
Log whether audio/decode is enabled at startup and warn when /decode is requested but the decode channel was not set. Helps diagnose broken decode pipelines. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
This commit is contained in:
@@ -302,6 +302,11 @@ async fn async_init() -> DynResult<AppState> {
|
||||
set_audio_channels(rx_audio_tx.clone(), tx_audio_tx, stream_info_rx);
|
||||
set_decode_channel(decode_tx.clone());
|
||||
|
||||
info!(
|
||||
"Audio enabled: connecting to {}, decode channel set",
|
||||
audio_addr
|
||||
);
|
||||
|
||||
tokio::spawn(audio_client::run_audio_client(
|
||||
audio_addr,
|
||||
rx_audio_tx,
|
||||
@@ -309,6 +314,8 @@ async fn async_init() -> DynResult<AppState> {
|
||||
stream_info_tx,
|
||||
decode_tx,
|
||||
));
|
||||
} else {
|
||||
info!("Audio disabled in config, decode will not be available");
|
||||
}
|
||||
|
||||
// Spawn frontends (skip appkit — it will be driven from main thread)
|
||||
|
||||
@@ -98,8 +98,10 @@ pub async fn events(
|
||||
#[get("/decode")]
|
||||
pub async fn decode_events() -> Result<HttpResponse, Error> {
|
||||
let Some(decode_rx) = crate::server::audio::subscribe_decode() else {
|
||||
tracing::warn!("/decode requested but decode channel not set (audio disabled?)");
|
||||
return Ok(HttpResponse::NotFound().body("decode not enabled"));
|
||||
};
|
||||
tracing::info!("/decode SSE client connected");
|
||||
|
||||
let decode_stream = futures_util::stream::unfold(decode_rx, |mut rx| async move {
|
||||
loop {
|
||||
|
||||
Reference in New Issue
Block a user