Apply inputboost ini setting for headless clients - #3841
Conversation
CClientSettings::ReadSettingsFromXML parsed client/inputboost into iInputBoost but never called CClient::SetInputBoost() outside the GUI dialog constructor (clientdlg.cpp:268), so headless clients silently ignored the setting. Follow-up to jamulussoftware#3834; flagged by pljones on that thread. Co-Authored-By: Claude <noreply@anthropic.com>
|
Is there a method to change this value - i.e. JSONRPC - without the GUI? If not, I think adding that first would be better. |
|
MY LLM WROTE: @pljones Good point, and I agree — right now this PR only fixes the ini-parse path, so a headless client can set I can add a |
Oh -- does the Advanced Settings value only apply on start up? I wonder why. If that's the case, it sounds like there's a bigger issue here.
If, indeed, there's a bigger issue, it might be better to close this PR and raise a new one covering the complete fix. Otherwise, yes - add the JSONRPC to match the Client UI first, then this one. I'd rather not introduce a hole. |
|
MY LLM WROTE: @pljones No bigger issue — my earlier wording was imprecise, sorry. The Advanced Settings value is not startup-only: Taking your other branch, then: the JSON-RPC setter is up first as #3843, tested live against a headless client. This PR is the second half and can wait on it. |
MY LLM WROTE:
Follow-up to #3834. While reproducing that bug I found a related, separate defect: a headless client silently ignores the
inputboostini setting. pljones agreed on that thread that it needs its own issue/PR ("Ugh, more 'business logic' in the GUI... Separate issue for this...").The bug
CClientSettings::ReadSettingsFromXMLparsesclient/inputboostintoiInputBoost(settings.cpp:419-422), but the only place that value is ever applied to the client isCClientDlg's constructor:That line only runs when the GUI dialog is built. A headless client (
-n/--nogui, or any JSON-RPC-only session) never constructsCClientDlg, soCClient::SetInputBoostis never called and the boost silently stays at its default (1x, no boost), regardless of what the ini file says.Verified
I checked whether this is a one-off or a pattern:
settings.cppmakes 17 otherpClient->Set*()calls from withinReadSettingsFromXMLitself (SetAudioInFader,SetReverbLevel,SetSndCrdDev,SetAudioQuality, etc.) — those all work in both GUI and headless mode.SetInputBoostis the only parsed setting with aSet*()method that is not called fromReadSettingsFromXML. Grep for confirmation:(that's on
upstream/mainbefore this fix — noSetInputBoostcall anywhere in the file outside the value parse. After this fix, line 422 adds it.)See Testing below for the end-to-end before/after measurement.
Fix
One line, mirroring the existing pattern used by the 17 correctly-wired settings in the same function — apply the value where it's parsed, not only from the dialog:
clientdlg.cpp:268is left as-is — it becomes a redundant re-application of the same value when the GUI is present (harmless, and keeps this diff to the minimum needed for the headless case).Testing
g++ -fsyntax-onlyclean.clang-format -i— no changes.qmake CONFIG+=headless && make,-DHEADLESS -DWITH_JACK): compiles and links clean under-Wall -Wextra.-n→ opus/UDP → real server-R→ server-side WAV), same method as that PR. Withinputboost=10in the ini and a −14 dBFS input: unfixedupstream/main(recorded during the Fix Input Boost wrapping around instead of clipping #3834 investigation) gives a peak of 6542 LSB, matching the unboosted level — the ini setting has no effect. The same rig run against this fix gives 32120 LSB, 0.964 correlation to the wrapped-boost model — the boost is now applied. Settings.cpp/clientdlg.cpp are unchanged between the two commits, so the two runs are directly comparable. This branch is off currentupstream/main, which doesn't yet include Fix Input Boost wrapping around instead of clipping #3834's clipping fix, so a 10x boost still wraps rather than clips here — that wraparound appearing is exactly the evidence thatSetInputBoostis now being called; once Fix Input Boost wrapping around instead of clipping #3834 lands, headless clients will get the clipped behavior for free.CHANGELOG: Bugfix: headless client now applies the
inputboostini setting (previously silently ignored outside the GUI).