Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: suppress audiopipe tensor logging, use spawn_blocking for stream invalidation

Louis Beaumont8acfce97ecfe
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
index c5347ae3e..0c811a22c 100755
--- a/apps/screenpipe-app-tauri/src-tauri/src/main.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
@@ -1046,12 +1046,12 @@ async fn main() {
let file_layer = tracing_subscriber::fmt::layer()
.with_writer(file_appender)
.with_ansi(false)
- .with_filter(EnvFilter::new("info,hyper=error,tower_http=error,whisper_rs=warn"));
+ .with_filter(EnvFilter::new("info,hyper=error,tower_http=error,whisper_rs=warn,audiopipe=warn"));
// Create a custom layer for console logging
let console_layer = tracing_subscriber::fmt::layer()
.with_writer(std::io::stdout)
- .with_filter(EnvFilter::new("info,hyper=error,tower_http=error,whisper_rs=warn"));
+ .with_filter(EnvFilter::new("info,hyper=error,tower_http=error,whisper_rs=warn,audiopipe=warn"));
// Initialize the tracing subscriber with both layers + optional Sentry layer
// The Sentry layer captures error!() and warn!() events (not just panics)
diff --git a/crates/screenpipe-engine/src/bin/screenpipe-engine.rs b/crates/screenpipe-engine/src/bin/screenpipe-engine.rs
index 9beea2089..cbb7ee8e6 100644
--- a/crates/screenpipe-engine/src/bin/screenpipe-engine.rs
+++ b/crates/screenpipe-engine/src/bin/screenpipe-engine.rs
@@ -161,7 +161,8 @@ fn setup_logging(
.add_directive("rusty_tesseract=error".parse().unwrap())
.add_directive("symphonia=error".parse().unwrap())
.add_directive("hf_hub=error".parse().unwrap())
- .add_directive("whisper_rs=error".parse().unwrap());
+ .add_directive("whisper_rs=error".parse().unwrap())
+ .add_directive("audiopipe=warn".parse().unwrap());
#[cfg(target_os = "windows")]
let filter = filter
diff --git a/crates/screenpipe-engine/src/event_driven_capture.rs b/crates/screenpipe-engine/src/event_driven_capture.rs
index bc8e8adbb..f228dfb96 100644
--- a/crates/screenpipe-engine/src/event_driven_capture.rs
+++ b/crates/screenpipe-engine/src/event_driven_capture.rs
@@ -338,13 +338,27 @@ pub async fn event_driven_capture_loop(
// After unlock or wake, invalidate persistent SCStream handles so
// the next capture picks up fresh frames instead of stale ones.
+ // Use spawn_blocking to avoid blocking the tokio thread — the
+ // underlying sck_rs::stop_all_streams() is a synchronous C call
+ // that can block on system I/O and previously caused deadlocks.
#[cfg(target_os = "macos")]
if screenpipe_screen::stream_invalidation::take() {
info!(
"invalidating persistent streams after unlock/wake for monitor {}",
monitor_id
);
- screenpipe_screen::stream_invalidation::invalidate_streams();
+ let invalidate_result = tokio::time::timeout(
+ Duration::from_secs(5),
+ tokio::task::spawn_blocking(|| {
+ screenpipe_screen::stream_invalidation::invalidate_streams();
+ }),
+ )
+ .await;
+ match invalidate_result {
+ Ok(Ok(())) => {}
+ Ok(Err(e)) => warn!("stream invalidation task failed: {}", e),
+ Err(_) => warn!("stream invalidation timed out after 5s, continuing"),
+ }
}
// Skip capture while DRM streaming content is focused
@@ -555,12 +569,13 @@ pub async fn event_driven_capture_loop(
}
debug!(
- "event capture: trigger={}, frame_id={}, text_source={:?}, dur={}ms, elements_deduped={}",
+ "event capture: trigger={}, frame_id={}, text_source={:?}, dur={}ms, elements_deduped={}, monitor={}",
trigger.as_str(),
result.frame_id,
result.text_source,
result.duration_ms,
- output.elements_deduped
+ output.elements_deduped,
+ monitor_id
);
} else {
// Content dedup or window filter — capture skipped