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

Bump app to v2.0.111

Louis Beaumont9618192b4c7f
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.lock b/screenpipe-app-tauri/src-tauri/Cargo.lock
index 139c95133..80c5c1ffe 100755
--- a/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -5629,7 +5629,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "screenpipe-app"
-version = "2.0.109"
+version = "2.0.110"
dependencies = [
"anyhow",
"async-stream",
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.toml
index ca4b77d85..b224d33b7 100644
--- a/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "2.0.110"
+version = "2.0.111"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/screenpipe-app-tauri/src-tauri/src/sidecar.rs b/screenpipe-app-tauri/src-tauri/src/sidecar.rs
index a64dbb401..a4b107e8b 100644
--- a/screenpipe-app-tauri/src-tauri/src/sidecar.rs
+++ b/screenpipe-app-tauri/src-tauri/src/sidecar.rs
@@ -164,25 +164,49 @@ pub async fn stop_screenpipe(
#[cfg(target_os = "windows")]
{
+ use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x08000000;
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
- match tokio::process::Command::new("powershell")
- .arg("-NoProfile")
- .arg("-WindowStyle")
- .arg("hidden")
- .arg("-Command")
- .arg(r#"taskkill.exe /F /T /IM screenpipe.exe"#)
+
+ // Try taskkill directly first (most reliable, doesn't depend on PowerShell)
+ let taskkill_result = tokio::process::Command::new("taskkill")
+ .args(["/F", "/T", "/IM", "screenpipe.exe"])
.creation_flags(CREATE_NO_WINDOW)
.output()
- .await
- {
- Ok(_) => {
- debug!("Successfully killed screenpipe processes");
+ .await;
+
+ match taskkill_result {
+ Ok(output) => {
+ // taskkill returns success even if process wasn't found, check stderr for real errors
+ let stderr = String::from_utf8_lossy(&output.stderr);
+ if output.status.success() || stderr.contains("not found") || stderr.contains("ERROR: The process") {
+ debug!("Successfully killed screenpipe processes (or none were running)");
+ return Ok(());
+ }
+ debug!("taskkill completed with output: {:?}", stderr);
Ok(())
}
Err(e) => {
- error!("Failed to kill screenpipe processes: {}", e);
- Err(format!("Failed to kill screenpipe processes: {}", e))
+ warn!("taskkill failed: {}, trying cmd.exe fallback", e);
+
+ // Fallback: try via cmd.exe
+ match tokio::process::Command::new("cmd")
+ .args(["/C", "taskkill", "/F", "/T", "/IM", "screenpipe.exe"])
+ .creation_flags(CREATE_NO_WINDOW)
+ .output()
+ .await
+ {
+ Ok(_) => {
+ debug!("Successfully killed screenpipe processes via cmd.exe fallback");
+ Ok(())
+ }
+ Err(e2) => {
+ error!("All methods to kill screenpipe processes failed. taskkill: {}, cmd: {}", e, e2);
+ // Don't fail hard - the process might not be running anyway
+ warn!("Continuing despite kill failure - process may not be running");
+ Ok(())
+ }
+ }
}
}
}
diff --git a/screenpipe-audio/src/core/device.rs b/screenpipe-audio/src/core/device.rs
index 09c19a894..12d6d6394 100644
--- a/screenpipe-audio/src/core/device.rs
+++ b/screenpipe-audio/src/core/device.rs
@@ -286,12 +286,118 @@ pub async fn list_audio_devices() -> Result<Vec<AudioDevice>> {
Ok(devices)
}
+/// Test if a cpal device actually works by trying to get its supported configs
+#[cfg(target_os = "linux")]
+fn test_device_works(device: &cpal::Device, is_input: bool) -> bool {
+ if is_input {
+ device.supported_input_configs().is_ok()
+ } else {
+ device.supported_output_configs().is_ok()
+ }
+}
+
+/// Linux fallback: try default device, then enumerate and find first working device
+#[cfg(target_os = "linux")]
+fn get_linux_device_with_fallback(
+ host: &cpal::Host,
+ is_input: bool,
+) -> Result<cpal::Device> {
+ // First, try the default device
+ let default_device = if is_input {
+ host.default_input_device()
+ } else {
+ host.default_output_device()
+ };
+
+ if let Some(device) = default_device {
+ if test_device_works(&device, is_input) {
+ tracing::debug!(
+ "linux audio: using default {} device: {:?}",
+ if is_input { "input" } else { "output" },
+ device.name()
+ );
+ return Ok(device);
+ }
+ tracing::warn!(
+ "linux audio: default {} device {:?} failed validation, trying fallbacks",
+ if is_input { "input" } else { "output" },
+ device.name()
+ );
+ }
+
+ // Fallback: enumerate all devices and try each one
+ let devices: Vec<_> = if is_input {
+ host.input_devices()?.collect()
+ } else {
+ host.output_devices()?.collect()
+ };
+
+ // Priority order for device names (prefer pulse/pipewire over raw hw)
+ let priority_prefixes = ["pulse", "pipewire", "default", "plughw", "hw"];
+
+ // Sort devices by priority
+ let mut sorted_devices: Vec<_> = devices.into_iter().collect();
+ sorted_devices.sort_by(|a, b| {
+ let a_name = a.name().unwrap_or_default().to_lowercase();
+ let b_name = b.name().unwrap_or_default().to_lowercase();
+
+ let a_priority = priority_prefixes
+ .iter()
+ .position(|p| a_name.starts_with(p))
+ .unwrap_or(priority_prefixes.len());
+ let b_priority = priority_prefixes
+ .iter()
+ .position(|p| b_name.starts_with(p))
+ .unwrap_or(priority_prefixes.len());
+
+ a_priority.cmp(&b_priority)
+ });
+
+ for device in sorted_devices {
+ let device_name = device.name().unwrap_or_else(|_| "unknown".to_string());
+
+ // Skip OSS devices explicitly
+ if device_name.contains("oss") || device_name.contains("/dev/dsp") {
+ tracing::debug!("linux audio: skipping OSS device: {}", device_name);
+ continue;
+ }
+
+ if test_device_works(&device, is_input) {
+ tracing::info!(
+ "linux audio: fallback successful, using {} device: {}",
+ if is_input { "input" } else { "output" },
+ device_name
+ );
+ return Ok(device);
+ }
+ tracing::debug!(
+ "linux audio: device {} failed validation, trying next",
+ device_name
+ );
+ }
+
+ Err(anyhow!(
+ "No working {} audio device found. Make sure PulseAudio or PipeWire is running.",
+ if is_input { "input" } else { "output" }
+ ))
+}
+
pub fn default_input_device() -> Result<AudioDevice> {
let host = cpal::default_host();
- let device = host
- .default_input_device()
- .ok_or(anyhow!("No default input device detected"))?;
- Ok(AudioDevice::new(device.name()?, DeviceType::Input))
+
+ #[cfg(target_os = "linux")]
+ {
+ let device = get_linux_device_with_fallback(&host, true)?;
+ Ok(AudioDevice::new(device.name()?, DeviceType::Input))
+ }
+
+ #[cfg(not(target_os = "linux"))]
+ {
+ let device = host
+ .default_input_device()
+ .ok_or(anyhow!("No default input device detected"))?;
+ Ok(AudioDevice::new(device.name()?, DeviceType::Input))
+ }
}
pub async fn default_output_device() -> Result<AudioDevice> {