Skip to content

Conversation

@xav-ie
Copy link

@xav-ie xav-ie commented Dec 27, 2025

This might fix #4244

The cava module bars always peak at maximum regardless of sensitivity settings. This is caused by audio_raw_init() overwriting audio_raw_.height with an incorrect value.

After PR #4682 refactored cava into frontend/backend architecture, audio_raw_.height is set to prm_.ascii_range (the number of format-icons minus 1), but then audio_raw_init() overwrites it. This causes audio_raw_fetch() to scale bars incorrectly, resulting in values like 20000+ instead of the expected 0-7 range.

Simply set audio_raw_.height = prm_.ascii_range after calling audio_raw_init() to preserve the correct height value.


  • fix(cava): restore ascii_range height after audio_raw_init

    audio_raw_init() overwrites audio_raw_.height, causing bars to display
    incorrect values. Set height to prm_.ascii_range after init to ensure
    proper bar scaling within the configured format-icons range.

audio_raw_init() overwrites audio_raw_.height, causing bars to display
incorrect values. Set height to prm_.ascii_range after init to ensure
proper bar scaling within the configured format-icons range.
@LukashonakV
Copy link
Contributor

LukashonakV commented Dec 28, 2025

Hi @xav-ie , for now I'm not able to check. Will do , once have a time. It might possible original bug can be issued in the original cava project or libcava. If the issue is brought by the waybar cava module implementation, then I'm ok. Otherwise it should be managed by the cava/libcava. Actually I don't remember for now, what the purpose to set max height in the waybar cava.

BTW: thank you for investigation and happy new year)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cava module always peaking

2 participants