Repository navigation
Desktop: apply EQ and normalisation changes to the native engine live - #240
Merged
Merged
Conversation
Core::apply_audio_to_backend sent gapless, output device and exclusive to the backend one by one, and had a no-op placeholder where the DSP chain should have been updated: on desktop, changing EQ bands, EQ preamp or normalisation only took effect after a restart, because the native engine got its DspSettings solely at construction (NativeBackend::set_audio_settings existed but only tests called it). Give the PlaybackBackend seam a set_audio_settings method carrying the full update: the DSP chain plus gapless and exclusive. The default forwards to set_gapless/set_exclusive, so the external (Android) and null backends behave exactly as before; NativeBackend delegates to its inherent method, which sends Cmd::SetDsp (the chain retunes mid-stream with the existing smoothing) and forwards to the preview player. LoggedBackend forwards the call so the wrapper can't swallow it, and ScriptedBackend records it so core tests can observe the wiring. apply_audio_to_backend now sends the combined update (keeping the separate set_output_device) instead of the piecewise gapless/exclusive calls. ReplayGain/preamp keep reaching playback through the per-item gain as before. Fixes #227. Co-authored-by: GLM-5.3-Flash <opencode-agent[bot]@users.noreply.github.com>
ingoau
force-pushed
the
t3/eq-normalisation-live
branch
from
November 10, 2026 11:58
0631975 to
ab5522a
Compare
Settings applied mid-crossfade reached only the incoming deck's chain; seeking back before the handover restored A's stale chain. Also set the output device before exclusive mode, so exclusive opens the new device. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #227.
Problem
On desktop, changing EQ bands, EQ preamp or normalisation had no effect on playback until the app restarted.
Core::apply_audio_to_backendsent gapless, output device and exclusive to the backend piecewise and had a no-op placeholder (let _ = &self.audio;under#[cfg(feature = "native-audio")]) where the DSP chain should have been updated.NativeBackend::set_audio_settings(which sendsCmd::SetDsp) existed but was only called from tests, so the engine's DSP chain was fixed at construction. ReplayGain/preamp kept working because they travel with the per-item gain.Change
PlaybackBackendgains aset_audio_settingsmethod carrying the full update (DSP chain + gapless + exclusive). The default forwards toset_gapless/set_exclusive, so the external (Android) and null backends behave exactly as before.NativeBackendoverrides it, delegating to the inherent method:Cmd::SetDspretunes the chain mid-stream with the existing smoothing, and the preview player is updated too.LoggedBackendforwards the call (the core always wraps its backend in it — without the override the DSP update would be swallowed) and logs one summary line.ScriptedBackendrecords the call (ScriptedCall::SetAudioSettings), andRecordingBackendin test support forwards it, so core tests can observe the wiring.apply_audio_to_backendnow sends the combined update (keeping the separateset_output_device) instead of the piecewise gapless/exclusive calls.Tests
an_audio_settings_change_reaches_the_backend_while_playing(fails onmainbefore the fix, passes here).LoggedBackendpass-through test extended to cover the new method.set_audio_settingsthrough the trait (the route the core takes) rather than the inherent method.Verified:
cargo fmt --all -- --check,cargo clippy --workspace --all-features -- -D warnings, andcargo test --workspace --all-features(43 suites, all green).Generated by GLM-5.3-Flash in OpenCode