Privacy-first AI meeting note taker for Windows, macOS and Linux. Free, open source (MIT). On-device Whisper/Parakeet transcription and speaker diarization, no meeting bot. Open-source alternative to Granola, Otter and Fireflies. https://meetily.ai
Rust aiai-meeting-assistantllmlocal-aimacmeeting-minutesmeeting-notesoffline-firstollamaparakeetprivacy-focusedprivacy-toolsrustself-hostedsortformerspeech-to-texttranscriptionwhisperwhisper-cppwindows
fix: prevent Linux capture backlog on PipeWire
Mohammed Safvan3755459c9e96
diff --git a/docs/architecture.md b/docs/architecture.mdindex 602e95b4..631c5cac 100644--- a/docs/architecture.md+++ b/docs/architecture.md@@ -59,6 +59,8 @@ The mixed audio has two consumers with different requirements:The input-processing target is 48 kHz; VAD-selected transcription segments are sent at 16 kHz. Timing and buffering settings belong to the implementation, so inspect the current code rather than assuming a fixed mixing-window duration. During shutdown, the pipeline drains its channel and flushes remaining speech before completing.+On Linux, [pulse_linux.rs](../frontend/src-tauri/src/audio/capture/pulse_linux.rs) captures microphone and system audio through the PulseAudio protocol, including on PipeWire. It dispatches pending mainloop events in bounded nonblocking bursts, sleeping only when idle, so capture can keep up without starving sample delivery or stop checks.+For audio changes, start in the relevant subsystem:- Device discovery and platform configuration: [devices/](../frontend/src-tauri/src/audio/devices/).diff --git a/frontend/src-tauri/src/audio/capture/pulse_linux.rs b/frontend/src-tauri/src/audio/capture/pulse_linux.rsindex c914f0ca..0353235c 100644--- a/frontend/src-tauri/src/audio/capture/pulse_linux.rs+++ b/frontend/src-tauri/src/audio/capture/pulse_linux.rs@@ -279,16 +279,58 @@ fn closeout_bytes(available: usize, consumed: u64, cutoff: Option<u64>) -> usize}fn pump(mainloop: &mut Mainloop) -> Result<()> {- if matches!(mainloop.iterate(false), IterateResult::Err(_) | IterateResult::Quit(_)) {- return Err(anyhow!("Audio server mainloop stopped"));+ // Drain pending events without starving sample delivery and stop checks.+ for _ in 0..32 {+ match mainloop.iterate(false) {+ IterateResult::Success(0) => {+ std::thread::sleep(Duration::from_millis(10));+ return Ok(());+ }+ IterateResult::Success(_) => {}+ IterateResult::Err(_) | IterateResult::Quit(_) => {+ return Err(anyhow!("Audio server mainloop stopped"));+ }+ }}- std::thread::sleep(Duration::from_millis(10));Ok(())}#[cfg(test)]mod tests {use super::*;+ use libpulse_binding::mainloop::api::Mainloop as _;++ #[test]+ fn pump_drains_pending_dispatches_before_returning() {+ let mut mainloop = Mainloop::new().unwrap();+ let count = std::rc::Rc::new(std::cell::Cell::new(0usize));+ let dispatched = count.clone();+ let _event = mainloop.new_deferred_event(Box::new(move |mut event| {+ dispatched.set(dispatched.get() + 1);+ if dispatched.get() == 3 {+ event.disable();+ }+ })).unwrap();++ pump(&mut mainloop).unwrap();+ assert_eq!(count.get(), 3);+ }++ #[test]+ fn pump_yields_while_dispatches_remain_pending() {+ let mut mainloop = Mainloop::new().unwrap();+ let count = std::rc::Rc::new(std::cell::Cell::new(0usize));+ let dispatched = count.clone();+ let _event = mainloop.new_deferred_event(Box::new(move |mut event| {+ dispatched.set(dispatched.get() + 1);+ if dispatched.get() == 10_000 {+ event.disable();+ }+ })).unwrap();++ pump(&mut mainloop).unwrap();+ assert!(count.get() > 0 && count.get() < 10_000);+ }#[test]fn cancelled_capture_exits_without_opening_server_or_delivering_samples() {