screenpipe/screenpipe · error

timed out activating process loopback for pid {root_pid}: {e

Error message

timed out activating process loopback for pid {root_pid}: {error}

What it means

The asynchronous process-loopback activation never completed within ACTIVATION_TIMEOUT: the channel recv_timeout hit a timeout because the Windows activation handler never called back with success or failure.

Source

Thrown at crates/screenpipe-audio/src/core/process_tap/windows.rs:541

    let mut propvariant = RawPropVariantBlob::new(&mut params);
    let (tx, rx) = mpsc::sync_channel(1);
    let handler = ActivateCompletion {
        tx: Mutex::new(Some(tx)),
    };
    let handler: IActivateAudioInterfaceCompletionHandler = handler.into();

    let _operation = ActivateAudioInterfaceAsync(
        VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK,
        &IAudioClient::IID,
        Some(propvariant.as_propvariant_ptr()),
        &handler,
    )
    .map_err(|e| anyhow!("ActivateAudioInterfaceAsync failed for pid {root_pid}: {e}"))?;

    match rx.recv_timeout(ACTIVATION_TIMEOUT) {
        Ok(Ok(client)) => Ok(client),
        Ok(Err(error)) => Err(anyhow!(error)),
        Err(error) => Err(anyhow!(
            "timed out activating process loopback for pid {root_pid}: {error}"
        )),
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum CaptureExit {
    Disconnected,
    TargetExited,
    TargetChanged,
    EndpointChanged,
    WaitFailed,
    DrainFailed,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum SupervisorStep {
    Stop,

View on GitHub (pinned to 4ebf712990)

Solutions

  1. Increase ACTIVATION_TIMEOUT and/or retry activation with backoff
  2. Confirm the target process is alive and stable before activating; re-resolve the pid and retry
  3. Verify the audio engine is responsive (audiodg) and restart Windows Audio services if wedged
  4. Drop stale IActivateAudioInterfaceCompletionHandler registrations; serialize activations to avoid leaks
Defensive patterns

Strategy: retry

Try / catch

match rx.recv_timeout(ACTIVATION_TIMEOUT) {
    Ok(Ok(client)) => Ok(client),
    Ok(Err(e)) => Err(anyhow!(e)),
    Err(_) => Err(anyhow!("timed out activating process loopback for pid {root_pid}")),
}
// wrap call site: on timeout, re-resolve pid and retry once with a longer timeout

Prevention

When it happens

Trigger: Audio engine (audiodg) busy or hung; the target process tree churns causing activation to stall; system under heavy load; a leaked/hung previous activation holding the virtual device; ACTIVATION_TIMEOUT set too small.

Common situations: Games or apps starting/stopping rapidly while capture attaches; overloaded machines; running many loopback activations concurrently.

Understand the failure class

Related errors


AI-assisted analysis of screenpipe/screenpipe@4ebf712990 (2026-09-01). Data as JSON: /api/errors/55ede00d80b9dcce. Report an issue: GitHub.