v0.73.1: opening DJ mode no longer crashes after enough openings

Each opening started a new audio thread, and Qt's PipeWire backend leaks
~24 file descriptors per thread that ends. At the desktop's 1024-fd limit
QAudioSink.start() failed ("Too many open files") and segfaulted in
pw_stream_connect. The thread now lives as long as the output: stop()
only silences the pump, shutdown() (window close / aboutToQuit) ends it.
This commit is contained in:
2026-10-20 21:16:26 -07:00
parent a52542750c
commit b76a69f504
7 changed files with 112 additions and 10 deletions
+6 -2
View File
@@ -401,8 +401,12 @@ persistence) → GUI (Qt widgets that read the manager and connect to its signal
1.8 s, a 33⅓ record; letting go is normal speed at once). The mixer is
constant-power crossfade × master (the volume slider through Qt's curve).
`dj/output.py` feeds a QAudioSink from **its own QThread** (100 ms
buffered), so GUI painting can't starve it; it must stop before Qt quits
(`aboutToQuit`, `closeEvent`), and **tests stub it** (conftest
buffered), so GUI painting can't starve it; it must end before Qt quits
(`shutdown()`: `aboutToQuit`, `closeEvent`). Closing DJ mode is only
`stop()` — **the thread is started once and kept** (Round 104): Qt's
PipeWire backend leaks ~24 fds per thread that ends, so a thread per
opening hit the 1024-fd limit and segfaulted in `pw_stream_connect`.
**Tests stub it** (conftest
`_no_dj_sound`) — the decks would otherwise play out loud. Sync ("Sync to
other track", per deck): tempo to the other deck's (the nearest octave);
if both are playing, then the shortest beat nudge (`phase_shift`, never