Add exponential volume curve with configurable dB range#231
Open
W-Floyd wants to merge 3 commits into
Open
Conversation
Author
|
Tests failed, my bad. I'll review and update. |
Maps slider position [0,1] to amplitude using y = a·exp(b·x) where a = 10^(-dB_range/20), giving perceptually linear loudness. Default range is 60 dB (SNAPCLIENT_VOLUME_CURVE_DB_RANGE in menuconfig). When db_range = 0 the curve is bypassed entirely (linear passthrough, y = x). Above zero a linear roll-off to ROLLOFF_THRESHOLD (0.1) ensures true silence at slider = 0% with a smooth join. The dB range is persisted in NVS via dsp_processor_settings and exposed through the JSON settings API. dsp_processor carries no dependency on dsp_processor_settings — persistence is the settings layer's responsibility (in dsp_settings_set_from_json). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a Volume Curve slider (0–90 dB) to the DSP settings page and wires it end-to-end: getter on dsp_processor, always-present field in the capabilities JSON, URL_t key buffer grown to 32 bytes to fit the param name, and a queue handler in http_server_task that routes the value through dsp_settings_set_from_json for apply + NVS persistence. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CONFIG_SNAPCLIENT_VOLUME_CURVE_DB_RANGE depends on USE_DSP_PROCESSOR in Kconfig, so it is undefined in the default build. Gate the log message that references it behind CONFIG_SNAPCLIENT_USE_SOFT_VOL, matching the pattern already used in dsp_processor.c. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
75e2002 to
c6cb985
Compare
Author
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.

Used https://www.dr-lex.be/info-stuff/volumecontrols.html for reference. For my cheap passive speakers I find a value of 40dB to be good.