pub(crate) fn pa_capture_session_open(
inner: &Inner,
spec: &Spec,
device: Option<&str>,
attr: &BufferAttr,
adjust_latency: bool,
device_was_present: bool,
) -> Result<PaCaptureSession, SessionOpenError>Expand description
Open a capture session: mainloop + context + record stream driven to Ready on the
bounded pump, honoring stop_pending at every turn. A NAMED device is validated by
an introspect probe on every call (an async connect_record would not fail
synchronously on a bad name, and on reconnect this is also what notices the device
reappearing after an outage). device_was_present distinguishes initial bring-up
from reconnect: a named device missing at startup is probably a misconfiguration, so
it is reported as DeviceNotFound and the caller spends only a short window on it;
the same device vanishing mid-run (PulseAudio/PipeWire restart kills every source) is
transient and must be retried or audio never comes back.