minutes icon indicating copy to clipboard operation
minutes copied to clipboard

Track pyannote-rs upstream fix for i16 normalization bug

Open silverstein opened this issue 7 months ago • 6 comments

Context

PR #70 switched pyannote-rs from crates.io to gregoire22enpc's fork to fix a normalization bug (x as f32 without / 32768.0) that caused minutes enroll to fail with "No speech detected."

The fork also adds a trailing speech flush at end-of-audio.

Upstream PR

https://github.com/thewh1teagle/pyannote-rs/pull/28

Decision timeline

  • If the upstream PR merges and a new pyannote-rs version is published on crates.io within ~30 days, switch back to the crates.io release.
  • If upstream shows no activity, vendor pyannote-rs into this repo (copy the source, maintain it ourselves). This gives us full control and eliminates the git dependency that blocks crates.io publishing.

Why this matters

Git dependencies block cargo publish. We currently have two (cpal from #75, pyannote-rs from #70). The cpal one resolves when cpal 0.18 ships. This one needs the plan above.

silverstein avatar Apr 05 '26 23:04 silverstein

cpal release timeline note

@roderickvd's latest guidance in RustAudio/cpal#1145 was "less than a month" for the next cpal release with the PipeWire and ALSA correctness fixes, framed as best-effort, not a promise.

We are pinned to cpal git rev 8b152c3 (Cargo.toml). We've reported clean Linux build/runtime checks for the paths we exercised in RustAudio/cpal#1145 (Codespaces couldn't verify real monitor-source enumeration). If the cpal release lands anywhere near that estimate, the cpal git dep flips to a crates.io version and we lose one of the two cargo publish blockers.

The pyannote-rs side is unchanged: thewh1teagle/pyannote-rs#28 (the normalization fix PR) remains open.

silverstein avatar Apr 07 '26 15:04 silverstein

Status update (2026-05-13)

cpal

  • Our pin bumped from 8b152c3 to 33e05ec since this issue was filed (newer master with PipeWire/ALSA fixes from RustAudio/cpal#1145).
  • RustAudio/cpal#1145 closed 2026-05-09; release timeline conversation moved to RustAudio/cpal#1192 (FuriOS+Flatpak regression in devel). Release may now be gated on that investigation.
  • crates.io max is still 0.17.3.
  • Action: posting a brief stakeholder note on RustAudio/cpal#1192 identifying Minutes as a downstream user blocked on the PipeWire release for cargo publish, and offering to test pre-releases on macOS + Linux. No code change from our side.

pyannote-rs

  • Haven't seen maintainer response on thewh1teagle/pyannote-rs#28 since the 2026-04-06 nudge.
  • Default branch on the upstream repo appears quiet since 2025-09-07.
  • Published pyannote-rs 0.3.4 still appears to contain both bugs the fork patches (i16→f32 normalization in segmentation, missing end-of-audio flush).

Direction

Preparing a namespace fork (minutes-pyannote) in parallel rather than monorepo-vendoring. Reasoning:

  • Eliminates the git dep without pulling ONNX session management into this repo.
  • Avoids inheriting pyannote-rs's ort = "2.0.0-rc.9" version lock.
  • Reversible: drop the fork and switch back if upstream merges #28.

Will publish only if upstream stays quiet long enough that it blocks our publish path. Goal is unblocking cargo publish, not pre-empting the maintainer.

Feature-flag escape (checked, doesn't help)

diarize is correctly opt-in and pyannote-rs is optional = true, but cpal in crates/core is non-optional, so the cpal git dep is in the manifest on every build. cargo publish rejects the manifest regardless of features. Both blockers must clear.

Closing this issue when both deps point at crates.io.

silverstein avatar May 13 '26 17:05 silverstein

Can I suggest using speakrs instead of pyannote-rs, see why https://github.com/avencera/speakrs#why-not-pyannote-rs

praveenperera avatar May 26 '26 20:05 praveenperera

Status update (2026-06-03)

Re-checked both blockers. The pyannote-rs half is now resolved, and the fork turned out to be unnecessary. PR: #273.

pyannote-rs: resolved without a fork.

The fork we pinned (gregoire22enpc/pyannote-rs@ae9fbc1) is just crates.io pyannote-rs 0.3.4 plus a single patch to src/segment.rs::get_segments (the i16 to f32 normalization and trailing-speech flush). Minutes already bypasses get_segments: diarize.rs runs its own ONNX segmentation via ort and only consumes EmbeddingExtractor. embedding.rs, knf-rs, and knf-rs-sys are byte-identical between the fork and crates.io, so pyannote-rs = "0.3.4" is behavior-identical for us. Confirmed by source diff, a runtime diarization run, and an independent Codex review. The pyannote-rs git dependency is gone. No namespace fork needed, so the minutes-pyannote plan is dropped.

cpal: still the one remaining blocker, but self-resolving.

crates.io max is still 0.17.3, so cpal stays a git dependency for now. The FuriOS regression (#1192) that was gating the release is fixed: #1194 merged plus the PipeWire init-timeout follow-up, and roderickvd said he is finishing his list before v0.18. We bumped our pin to current master (d2a26883) to pick up that fix. When v0.18 lands on crates.io we flip one line and cargo publish is unblocked.

After PR #273, cpal is the only external git dependency left in the workspace. Closing this when cpal points at crates.io.

Engine sanity-check. Separately ran a June 2026 market scan on local-first diarization. Conclusion: stay on pyannote-rs. The 2026 differentiation has moved to the clustering layer, which Minutes already implements itself, so engine swaps net out near zero. speakrs is the only watchlist alternative, and it is DER parity rather than a gain, would force re-enrollment of every voice profile (different embedder), and conflicts with our ort pin.

silverstein avatar Jun 03 '26 18:06 silverstein

Small correction to the update above: dropping the cpal pin bump from PR #273. cpal's current master fails to compile on Windows (windows-core 0.62 breakage in its WASAPI backend), so rather than an interim git bump, cpal will move straight to crates.io when v0.18 ships. The PR is now purely the pyannote-rs to crates.io swap. cpal remains the only external git dependency, still self-resolving via v0.18.

silverstein avatar Jun 03 '26 20:06 silverstein

Remaining steps to close this

  • [x] pyannote-rs moved to crates.io 0.3.4 (PR #273)
  • [ ] cpal moved to crates.io: waiting on the cpal v0.18 release (crates.io max is still 0.17.3). Do not bump the cpal git pin in the meantime; current cpal master fails to compile on Windows (windows-core 0.62 in its WASAPI backend).
  • [ ] When cpal v0.18 publishes: change the one cpal line in Cargo.toml from the git rev to the crates.io release, run CI (must pass the Windows checks), then close this issue. cargo publish is unblocked at that point.

Tracking: a weekly local watcher checks crates.io for cpal v0.18 and pings when it lands, so this does not need manual polling.

silverstein avatar Jun 03 '26 20:06 silverstein