The guard was missing, so EVERY backend change silently turned gapless off —
including switching to PipeWire, where it works perfectly. A user who did not
notice the toggle flip reads that as "alsa breaks gapless", which is exactly how
it was reported.
The reference is conditional: `settings.rs:1232-1237` disables it only for
`backend == AudioBackendType::Alsa`, and that in turn matches Tauri
(`SettingsView.svelte:3409-3416`, "not compatible with ALSA Direct"). Those two
are faithful to each other despite the different wording: in the engine's own
vocabulary `using_alsa_direct` IS `backend_type == Alsa`
(qbz-player/src/player/mod.rs:725-729). Only the Qt port dropped the `if`.
Investigated and RULED OUT while tracing this, recorded so it is not re-derived:
the audio thread's `thread_settings` and the Player's `audio_settings` are the
SAME `Arc<Mutex<AudioSettings>>` (created at mod.rs:1370, cloned into the thread
at :1371, stored on Self at :4067). `reload_settings` therefore does reach the
running audio thread, and no restart is needed for a settings change to land.
The apparent "restart makes gapless stick" is this cascade: the switch persisted
`gapless_enabled = false`, and turning it back on is what fixed it — the restart
was just when that happened.
Whether gapless SHOULD work on Alsa at all is a separate, deliberate rule
inherited from Tauri and left untouched here: the engine's `PlayNext` handler is
backend-agnostic and refuses only on a missing engine, a sample-rate/channel
mismatch or an active streaming source (mod.rs:3553-3586), so the blanket
exclusion may well be broader than the hardware demands. That is a product call
on the PROTECTED bit-perfect path and needs the owner's word plus real testing
on the DAC.
cc