Skip to content

Conversation

@xav-ie
Copy link
Contributor

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

This might fix #4244

The cava module bars always peak at maximum regardless of sensitivity settings.

data_format was changed from always being "ascii" to only being set when user-provided. Without an explicit value, cava defaults to "binary", which calculates height = pow(2, 16) - 1 = 65535 instead of ascii_range. This causes audio_raw_fetch() to scale bars incorrectly.

Default data_format to "ascii" while preserving user override capability. This mantains the previous default.


  • fix(cava): default data_format to ascii for correct bar scaling

    data_format was changed from always "ascii" to user-configurable,
    but without a default. This caused cava to use "binary", calculating
    height as 65535 instead of ascii_range, making bars always peak.

@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)

@xav-ie xav-ie force-pushed the fix-cava-audio-height-init branch from f31b78a to 048ad7e Compare December 29, 2025 00:27
@xav-ie
Copy link
Contributor Author

xav-ie commented Dec 29, 2025

Hey, @LukashonakV. Thank you for the quick response.

Your suggestion to put the change in cava led me to find out that I made a mistake.

Previously, data_format always defaulted to "ascii". Now, the new code does not default and cava defaults to "binary".

This would cause the height to now default to a large value.

We just need to restore the defaulting behavior. I updated the PR to add this back.

Happy new year!

@xav-ie xav-ie marked this pull request as draft December 29, 2025 00:54
@xav-ie xav-ie force-pushed the fix-cava-audio-height-init branch from 048ad7e to f5563f4 Compare December 29, 2025 00:55
@xav-ie xav-ie marked this pull request as ready for review December 29, 2025 01:03
@xav-ie xav-ie marked this pull request as draft December 29, 2025 01:05
@xav-ie xav-ie force-pushed the fix-cava-audio-height-init branch 2 times, most recently from dda5b73 to 436508c Compare December 29, 2025 01:08
data_format was changed from always "ascii" to user-configurable,
but without a default. This caused cava to use "binary", calculating
height as 65535 instead of ascii_range, making bars always peak.
@xav-ie xav-ie force-pushed the fix-cava-audio-height-init branch from 436508c to 19bb898 Compare December 29, 2025 01:09
@xav-ie xav-ie marked this pull request as ready for review December 29, 2025 01:18
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