feat(audio): JACK backend foundation (#263 Tier 3 — player wiring pending)

Backend-side foundation for a native JACK output. The hard, RT-sensitive part
is done and compiles: jack_backend.rs holds a JackStream that opens a JACK client
'qbz' with stable ports qbz:out_FL/FR, a lock-free SPSC ring buffer, and an
allocation-free process callback (de-interleaves stereo f32 to the ports). The
feeder pushes interleaved f32 via write_f32().

Also: jack 0.13 dep (linux), AudioBackendType::Jack + its factory arm + the
qbz-slint label/bit-perfect match arms. NOT yet offered in the selector
(available_backends push commented) because the player wiring is still pending:
StreamType::Jack + the dispatch branch (backend==Jack -> JackStream) + a
PlaybackEngine::Jack feeder thread that resamples each track to the JACK graph
rate. JACK mode will be opt-in and NOT bit-perfect (one fixed graph rate); the
ALSA-exclusive / DAC-passthrough bit-perfect paths are untouched.

TODO(distribution): feature-gate jack for Flatpak/distro builds without libjack.

cc
This commit is contained in:
vicrodh committed 2026-05-31 12:36:37 -06:00
1 parent d2c4aaf99c
commit fbc03f41b7
6 files changed
+279 -6

No files matched your search

+5
View File
@@ -47,6 +47,11 @@ alsa-sys = "0.4"
# Pinned to v4 to share the transitive copy already pulled in by
# secret-service/souvlaki and avoid duplicate zbus compiles.
zbus = { version = "4", default-features = false, features = ["tokio"] }
# JACK native backend (#263 Tier 3): QBZ as a first-class JACK client with stable
# ports. Links libjack (provided by pipewire-jack on the rig). TODO(distribution):
# feature-gate for Flatpak/distro builds that may not ship libjack — not blocking
# while Tauri isn't being released.
jack = "0.13"
[target.'cfg(target_os = "macos")'.dependencies]
# CoreAudio for device probing, sample rate switching, and (future) hog mode / exclusive mode