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

feat(coreaudio-tap): experimental opt-in flag — SCK stays the default

Louis Beaumont9b6d80237e5d
diff --git a/apps/screenpipe-app-tauri/components/settings/privacy-section.tsx b/apps/screenpipe-app-tauri/components/settings/privacy-section.tsx
index 598298858..22f51ac67 100644
--- a/apps/screenpipe-app-tauri/components/settings/privacy-section.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/privacy-section.tsx
@@ -4,6 +4,7 @@
"use client";
import React, { useState, useCallback, useEffect, useMemo } from "react";
+import { invoke } from "@tauri-apps/api/core";
import { LockedSetting, ManagedSwitch } from "@/components/enterprise-locked-setting";
import {
Eye,
@@ -203,6 +204,18 @@ export function PrivacySection() {
const [filterView, setFilterView] = useState<"all" | "personal" | "team">("all");
const [pushingFilter, setPushingFilter] = useState<string | null>(null);
+ // Gate for the experimental CoreAudio System Audio toggle. We only show the
+ // switch on macOS 14.4+ where the Process Tap API actually exists — on any
+ // other platform flipping it is a no-op, so the toggle would just be
+ // confusing. Probed once via a Tauri command that proxies to
+ // `screenpipe_audio::core::process_tap::is_process_tap_available()`.
+ const [coreaudioTapAvailable, setCoreaudioTapAvailable] = useState<boolean | null>(null);
+ useEffect(() => {
+ invoke<boolean>("check_coreaudio_process_tap_available")
+ .then(setCoreaudioTapAvailable)
+ .catch(() => setCoreaudioTapAvailable(false));
+ }, []);
+
const { items: windowItems, isLoading: isWindowItemsLoading } =
useSqlAutocomplete("window");
const { items: urlItems, isLoading: isUrlItemsLoading } =
@@ -293,6 +306,11 @@ export function PrivacySection() {
handleSettingsChange({ pauseOnDrmContent: checked }, true);
};
+ const handleCoreaudioSystemAudioToggle = (checked: boolean) => {
+ handleSettingsChange({ experimentalCoreaudioSystemAudio: checked }, true);
+ posthog.capture("experimental_coreaudio_system_audio_toggled", { enabled: checked });
+ };
+
const handleRecordWhileLockedToggle = (checked: boolean) => {
handleSettingsChange({ recordWhileLocked: checked }, true);
};
@@ -653,6 +671,34 @@ export function PrivacySection() {
</CardContent>
</Card>
+ {/* Experimental: CoreAudio System Audio (macOS 14.4+ only) */}
+ {coreaudioTapAvailable && (
+ <Card>
+ <CardContent className="px-3 py-2.5">
+ <div className="flex items-center justify-between">
+ <div className="flex items-center space-x-2.5">
+ <Tv className="h-4 w-4 text-muted-foreground shrink-0" />
+ <div>
+ <h3 className="text-sm font-medium text-foreground flex items-center gap-1.5">
+ Experimental: CoreAudio System Audio
+ <Badge variant="outline" className="h-4 text-[10px] px-1">beta</Badge>
+ <HelpTooltip text="use the coreaudio process tap api (macos 14.4+) to capture system audio instead of screencapturekit. avoids sck display enumeration and sleep/wake issues. if disabled or on an older macos, system audio uses screencapturekit as before. restart recording after changing." />
+ </h3>
+ <p className="text-xs text-muted-foreground">
+ Capture System Audio via CoreAudio instead of ScreenCaptureKit
+ </p>
+ </div>
+ </div>
+ <Switch
+ id="experimentalCoreaudioSystemAudio"
+ checked={Boolean(settings.experimentalCoreaudioSystemAudio ?? false)}
+ onCheckedChange={handleCoreaudioSystemAudioToggle}
+ />
+ </div>
+ </CardContent>
+ </Card>
+ )}
+
{/* Record While Locked */}
<Card>
<CardContent className="px-3 py-2.5">
diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
index 749592df8..c888bde01 100644
--- a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
+++ b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
@@ -160,6 +160,9 @@ export type Settings = SettingsStore & {
offlineMode?: boolean;
/** Pause all screen capture when a DRM-protected streaming app (Netflix, Disney+, etc.) or a remote-desktop client (Omnissa/VMware Horizon) is focused — they blank their windows during screen recording */
pauseOnDrmContent?: boolean;
+ /** Experimental: capture System Audio via CoreAudio Process Tap (macOS 14.4+) instead of ScreenCaptureKit.
+ * Off by default. Ignored on macOS <14.4 and non-macOS — falls back to SCK. */
+ experimentalCoreaudioSystemAudio?: boolean;
/** Continue recording audio when the screen is locked (default: false) */
recordWhileLocked?: boolean;
/** Auto-append typed text to meeting notes when a meeting ends */
@@ -368,6 +371,7 @@ let DEFAULT_SETTINGS: Settings = {
filterMusic: false,
ignoreIncognitoWindows: true,
pauseOnDrmContent: false,
+ experimentalCoreaudioSystemAudio: false,
recordWhileLocked: false,
appendTypedTextToMeetingNotes: true,
localRetentionEnabled: true,
diff --git a/apps/screenpipe-app-tauri/lib/utils/tauri.ts b/apps/screenpipe-app-tauri/lib/utils/tauri.ts
index 347c33c17..03ee022c4 100644
--- a/apps/screenpipe-app-tauri/lib/utils/tauri.ts
+++ b/apps/screenpipe-app-tauri/lib/utils/tauri.ts
@@ -1292,11 +1292,17 @@ ignoreIncognitoWindows: boolean;
* Off by default; engine-only pause (no full app shutdown).
*/
pauseOnDrmContent?: boolean;
+/**
+ * Experimental: capture System Audio via the CoreAudio Process Tap API
+ * on macOS 14.4+ instead of ScreenCaptureKit. Off by default. Ignored on
+ * older macOS and non-macOS — falls back to SCK there.
+ */
+experimentalCoreaudioSystemAudio?: boolean;
/**
* Continue recording audio when the screen is locked.
* Default: false (audio pauses when screen is locked to save resources).
*/
-recordWhileLocked?: boolean;
+recordWhileLocked?: boolean;
/**
* Automatically append text typed during a meeting to the meeting's note
* when the meeting ends. Groups typed text by app/window context.
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
index 71e61c3a1..c326f0b25 100755
--- a/apps/screenpipe-app-tauri/src-tauri/src/main.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
@@ -566,6 +566,7 @@ async fn main() {
permissions::check_screen_recording_permission,
permissions::check_accessibility_permission_cmd,
permissions::check_arc_installed,
+ permissions::check_coreaudio_process_tap_available,
permissions::check_arc_automation_permission,
permissions::request_arc_automation_permission,
permissions::get_installed_browsers,
@@ -854,6 +855,7 @@ async fn main() {
permissions::reset_and_request_permission,
permissions::get_missing_permissions,
permissions::check_arc_installed,
+ permissions::check_coreaudio_process_tap_available,
permissions::check_arc_automation_permission,
permissions::request_arc_automation_permission,
set_tray_unhealth_icon,
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/permissions.rs b/apps/screenpipe-app-tauri/src-tauri/src/permissions.rs
index dfd8a28c9..90bf232db 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/permissions.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/permissions.rs
@@ -411,6 +411,23 @@ const CHROMIUM_BROWSERS: &[ChromiumBrowserInfo] = &[
},
];
+/// Returns true on macOS 14.4+ where the CoreAudio Process Tap API is
+/// available. Used to gate the "experimental System Audio via CoreAudio"
+/// toggle — we don't show it on platforms where flipping it would be a
+/// no-op. False on Windows, Linux, and older macOS.
+#[tauri::command(async)]
+#[specta::specta]
+pub fn check_coreaudio_process_tap_available() -> bool {
+ #[cfg(target_os = "macos")]
+ {
+ screenpipe_audio::core::process_tap::is_process_tap_available()
+ }
+ #[cfg(not(target_os = "macos"))]
+ {
+ false
+ }
+}
+
/// Check if Arc browser is installed (macOS only)
#[tauri::command(async)]
#[specta::specta]
diff --git a/crates/screenpipe-audio/src/audio_manager/builder.rs b/crates/screenpipe-audio/src/audio_manager/builder.rs
index 72ba4308d..5a012d601 100644
--- a/crates/screenpipe-audio/src/audio_manager/builder.rs
+++ b/crates/screenpipe-audio/src/audio_manager/builder.rs
@@ -59,6 +59,10 @@ pub struct AudioManagerOptions {
/// When true, automatically follow system default audio devices
/// and switch when the system default changes (e.g., device plug/unplug)
pub use_system_default_audio: bool,
+ /// Experimental: use CoreAudio Process Tap for System Audio (macOS 14.4+).
+ /// When false (default), System Audio uses ScreenCaptureKit as before.
+ /// Has no effect on non-macOS or macOS <14.4 — falls back to SCK.
+ pub experimental_coreaudio_system_audio: bool,
/// Controls when local Whisper transcription runs.
/// `Realtime` = immediate (default), `Batch` = accumulate longer chunks for quality.
pub transcription_mode: TranscriptionMode,
@@ -98,6 +102,7 @@ impl Default for AudioManagerOptions {
use_pii_removal: false,
filter_music: false,
use_system_default_audio: true,
+ experimental_coreaudio_system_audio: false,
transcription_mode: TranscriptionMode::default(),
meeting_detector: None,
vocabulary: vec![],
@@ -186,6 +191,11 @@ impl AudioManagerBuilder {
self
}
+ pub fn experimental_coreaudio_system_audio(mut self, enabled: bool) -> Self {
+ self.options.experimental_coreaudio_system_audio = enabled;
+ self
+ }
+
pub fn use_system_default_audio(mut self, use_system_default_audio: bool) -> Self {
self.options.use_system_default_audio = use_system_default_audio;
self
diff --git a/crates/screenpipe-audio/src/audio_manager/manager.rs b/crates/screenpipe-audio/src/audio_manager/manager.rs
index 293fc8d9f..3f3681482 100644
--- a/crates/screenpipe-audio/src/audio_manager/manager.rs
+++ b/crates/screenpipe-audio/src/audio_manager/manager.rs
@@ -117,7 +117,8 @@ pub struct CentralHandlerRestartResult {
impl AudioManager {
pub async fn new(options: AudioManagerOptions, db: Arc<DatabaseManager>) -> Result<Self> {
- let device_manager = DeviceManager::new().await?;
+ let device_manager =
+ DeviceManager::new(options.experimental_coreaudio_system_audio).await?;
let segmentation_manager = Arc::new(SegmentationManager::new(options.is_disabled).await?);
let status = RwLock::new(AudioManagerStatus::Stopped);
let vad_engine: Arc<Mutex<Box<dyn VadEngine + Send>>> = if options.is_disabled {
diff --git a/crates/screenpipe-audio/src/core/stream.rs b/crates/screenpipe-audio/src/core/stream.rs
index f2c599438..235120eda 100644
--- a/crates/screenpipe-audio/src/core/stream.rs
+++ b/crates/screenpipe-audio/src/core/stream.rs
@@ -79,9 +79,18 @@ enum StreamControl {
}
impl AudioStream {
+ /// Build an AudioStream for `device`.
+ ///
+ /// `use_coreaudio_tap` is a user-level experimental flag. When true AND
+ /// the target is System Audio on macOS 14.4+, the stream is backed by a
+ /// CoreAudio Process Tap (no ScreenCaptureKit session). In every other
+ /// case (flag off, non-macOS, macOS <14.4, mic input, specific output)
+ /// the existing cpal/SCK path runs unchanged — existing users see no
+ /// behavior change.
pub async fn from_device(
device: Arc<AudioDevice>,
is_running: Arc<AtomicBool>,
+ #[cfg_attr(not(target_os = "macos"), allow(unused_variables))] use_coreaudio_tap: bool,
) -> Result<Self> {
let (tx, _) = broadcast::channel::<Vec<f32>>(1000);
let tx_clone = tx.clone();
@@ -107,10 +116,13 @@ impl AudioStream {
let (audio_config, stream_thread) = {
// macOS 14.4+: try CoreAudio Process Tap for System Audio.
// Bypasses SCK display enumeration which fails after sleep/wake.
+ // Gated behind `use_coreaudio_tap` so the SCK path stays the
+ // default until the experimental flag is explicitly turned on.
#[cfg(target_os = "macos")]
let use_process_tap = {
use super::device::{DeviceType, MACOS_OUTPUT_AUDIO_DEVICE_NAME};
- device.device_type == DeviceType::Output
+ use_coreaudio_tap
+ && device.device_type == DeviceType::Output
&& device.name == MACOS_OUTPUT_AUDIO_DEVICE_NAME
&& super::process_tap::is_process_tap_available()
};
@@ -132,19 +144,31 @@ impl AudioStream {
Err(e) => {
tracing::warn!("Process Tap failed, falling back to SCK: {}", e);
Self::start_cpal_stream(
- &device, tx, stream_control_rx, &is_running,
- &is_disconnected, &stream_control_tx,
- ).await?
+ &device,
+ tx,
+ stream_control_rx,
+ &is_running,
+ &is_disconnected,
+ &stream_control_tx,
+ )
+ .await?
}
}
}
#[cfg(not(target_os = "macos"))]
- { unreachable!() }
+ {
+ unreachable!()
+ }
} else {
Self::start_cpal_stream(
- &device, tx, stream_control_rx, &is_running,
- &is_disconnected, &stream_control_tx,
- ).await?
+ &device,
+ tx,
+ stream_control_rx,
+ &is_running,
+ &is_disconnected,
+ &stream_control_tx,
+ )
+ .await?
}
};
diff --git a/crates/screenpipe-audio/src/device/device_manager.rs b/crates/screenpipe-audio/src/device/device_manager.rs
index 7c63249ba..cbd29428d 100644
--- a/crates/screenpipe-audio/src/device/device_manager.rs
+++ b/crates/screenpipe-audio/src/device/device_manager.rs
@@ -13,14 +13,23 @@ use tracing::info;
pub struct DeviceManager {
streams: Arc<DashMap<AudioDevice, Arc<AudioStream>>>,
states: Arc<DashMap<AudioDevice, Arc<AtomicBool>>>,
+ /// When true, System Audio (output) uses the CoreAudio Process Tap path
+ /// on macOS 14.4+ instead of ScreenCaptureKit. Propagated to
+ /// AudioStream::from_device at device-start time. Has no effect on
+ /// macOS <14.4 or non-macOS — falls back to SCK there.
+ use_coreaudio_tap: bool,
}
impl DeviceManager {
- pub async fn new() -> Result<Self> {
+ pub async fn new(use_coreaudio_tap: bool) -> Result<Self> {
let streams = Arc::new(DashMap::new());
let states = Arc::new(DashMap::new());
- Ok(Self { streams, states })
+ Ok(Self {
+ streams,
+ states,
+ use_coreaudio_tap,
+ })
}
pub async fn devices(&self) -> Vec<AudioDevice> {
@@ -37,13 +46,18 @@ impl DeviceManager {
}
let is_running = Arc::new(AtomicBool::new(false));
- let stream =
- match AudioStream::from_device(Arc::new(device.clone()), is_running.clone()).await {
- Ok(stream) => stream,
- Err(e) => {
- return Err(e);
- }
- };
+ let stream = match AudioStream::from_device(
+ Arc::new(device.clone()),
+ is_running.clone(),
+ self.use_coreaudio_tap,
+ )
+ .await
+ {
+ Ok(stream) => stream,
+ Err(e) => {
+ return Err(e);
+ }
+ };
info!("starting recording for device: {}", device);
diff --git a/crates/screenpipe-config/src/recording.rs b/crates/screenpipe-config/src/recording.rs
index c177f7624..82e197108 100644
--- a/crates/screenpipe-config/src/recording.rs
+++ b/crates/screenpipe-config/src/recording.rs
@@ -70,6 +70,14 @@ pub struct RecordingSettings {
#[serde(rename = "useSystemDefaultAudio")]
pub use_system_default_audio: bool,
+ /// Experimental: capture System Audio via the CoreAudio Process Tap API
+ /// (macOS 14.4+) instead of ScreenCaptureKit. Avoids SCK's display
+ /// enumeration failures after sleep/wake and the GPU/compositor wake
+ /// overhead. Off by default — existing users keep the SCK path.
+ /// Ignored on macOS <14.4 and on non-macOS platforms.
+ #[serde(rename = "experimentalCoreaudioSystemAudio", default)]
+ pub experimental_coreaudio_system_audio: bool,
+
/// Duration of each audio chunk in seconds before transcription.
/// Stored as i32 to match existing store.bin schema (cast to u64 by engine).
#[serde(rename = "audioChunkDuration")]
@@ -303,6 +311,7 @@ impl Default for RecordingSettings {
transcription_mode: "batch".to_string(),
audio_devices: vec![],
use_system_default_audio: true,
+ experimental_coreaudio_system_audio: false,
audio_chunk_duration: 30,
deepgram_api_key: String::new(),
vad_sensitivity: "high".to_string(),
diff --git a/crates/screenpipe-engine/src/cli/mod.rs b/crates/screenpipe-engine/src/cli/mod.rs
index b5c7af6b3..4cb34986d 100644
--- a/crates/screenpipe-engine/src/cli/mod.rs
+++ b/crates/screenpipe-engine/src/cli/mod.rs
@@ -269,6 +269,12 @@ pub struct RecordArgs {
#[arg(long, default_value_t = true)]
pub use_system_default_audio: bool,
+ /// [experimental, macOS 14.4+] Capture System Audio via CoreAudio Process
+ /// Tap instead of ScreenCaptureKit. Off by default; ignored on older macOS
+ /// and non-macOS.
+ #[arg(long, default_value_t = false)]
+ pub experimental_coreaudio_system_audio: bool,
+
/// Data directory. Default to $HOME/.screenpipe
#[arg(long, value_hint = ValueHint::DirPath)]
pub data_dir: Option<String>,
@@ -429,6 +435,7 @@ impl RecordArgs {
transcription_mode: mode_str.to_string(),
audio_devices: self.audio_device.clone(),
use_system_default_audio: self.use_system_default_audio,
+ experimental_coreaudio_system_audio: self.experimental_coreaudio_system_audio,
monitor_ids: self.monitor_id.iter().map(|id| id.to_string()).collect(),
use_all_monitors: self.use_all_monitors,
ignored_windows: self.ignored_windows.clone(),
diff --git a/crates/screenpipe-engine/src/recording_config.rs b/crates/screenpipe-engine/src/recording_config.rs
index 6eaffc1e2..9f37b36ca 100644
--- a/crates/screenpipe-engine/src/recording_config.rs
+++ b/crates/screenpipe-engine/src/recording_config.rs
@@ -40,6 +40,8 @@ pub struct RecordingConfig {
// Devices & monitors
pub audio_devices: Vec<String>,
pub use_system_default_audio: bool,
+ /// Experimental: use CoreAudio Process Tap for System Audio on macOS 14.4+.
+ pub experimental_coreaudio_system_audio: bool,
pub monitor_ids: Vec<String>,
pub use_all_monitors: bool,
@@ -168,6 +170,7 @@ impl RecordingConfig {
},
audio_devices: settings.audio_devices.clone(),
use_system_default_audio: settings.use_system_default_audio,
+ experimental_coreaudio_system_audio: settings.experimental_coreaudio_system_audio,
monitor_ids: settings.monitor_ids.clone(),
use_all_monitors: settings.use_all_monitors,
ignored_windows: settings.ignored_windows.clone(),
@@ -254,6 +257,7 @@ impl RecordingConfig {
.transcription_engine(self.audio_transcription_engine.clone())
.enabled_devices(audio_devices)
.use_system_default_audio(self.use_system_default_audio)
+ .experimental_coreaudio_system_audio(self.experimental_coreaudio_system_audio)
.deepgram_api_key(self.deepgram_api_key.clone())
.output_path(output_path)
.use_pii_removal(self.use_pii_removal)