Skip to content

background: fix desktop visualiser lag#1126

Open
AteebXYZ wants to merge 17 commits intocaelestia-dots:mainfrom
AteebXYZ:perf/visualiser-fix
Open

background: fix desktop visualiser lag#1126
AteebXYZ wants to merge 17 commits intocaelestia-dots:mainfrom
AteebXYZ:perf/visualiser-fix

Conversation

@AteebXYZ
Copy link

@AteebXYZ AteebXYZ commented Jan 28, 2026

Changes

  • Visualiser bars now render in a QQuickPaintedItem, which increases performance drastically

  • 2 new config options under visualiser in shell.json have been added, smoothing (0-1) and curvature (integer), smoothing defines the "slowness" of the bars, a higher value means it will react to audio changes slower and curvature smooths out the bars for less noise making them appear more rounded.

@AteebXYZ AteebXYZ marked this pull request as ready for review January 28, 2026 14:25
@soramanew
Copy link
Collaborator

Please use a QQuickPaintedItem and QPainter (make a C++ component for it) instead of a canvas. This should help reduce resource usage even more.

@AteebXYZ
Copy link
Author

AteebXYZ commented Feb 4, 2026

I switched to a QQuickPainter and it works pretty well so far, all i need to figure out now is how to get the blur to work and to fix the rounded bars aggressively snapping to pixels with no smoothing

@AteebXYZ
Copy link
Author

AteebXYZ commented Feb 4, 2026

okay I fixed the issue with the rounded edges being jagged by switching the render target of QQuickPaintedItem to Image instead of FrameBufferObject, this sacrifices a tiny amount of rendering performance for better anti aliasing.

@soramanew
Copy link
Collaborator

What's with the spatial smoothing? The cava module already has monstercat smoothing, so we shouldn't need more. Also, it bounces a lot more which is very noisy.

@AteebXYZ
Copy link
Author

AteebXYZ commented Feb 9, 2026

What's with the spatial smoothing? The cava module already has monstercat smoothing, so we shouldn't need more. Also, it bounces a lot more which is very noisy.

Did increasing the smoothing values make it feel less jumpy? Also I personally felt that the monstercat smoothing was still too noisy so I added an additional curvature smoothing modifier, but if you want it can be removed. Honestly I don't know how to make the new implementation match the original visualiser since the old implementation lagged so much on my PC.

@soramanew
Copy link
Collaborator

Does just using the values directly from the cava provider not match the original impl?

@AteebXYZ
Copy link
Author

Does just using the values directly from the cava provider not match the original impl?

The original impl had Anim with duration small on value change (height of bar), right now im trying to implement that. Setting the cava values directly would be too noisy right?

@soramanew
Copy link
Collaborator

Hmm, tbh it shouldn't really affect that much. If need be, you can use QPropertyAnimations to achieve the same thing afaik

@AteebXYZ
Copy link
Author

Hmm, tbh it shouldn't really affect that much. If need be, you can use QPropertyAnimations to achieve the same thing afaik

Oh i didn't see this when I was implementing the standard Anim curve 😭

@AteebXYZ
Copy link
Author

AteebXYZ commented Feb 11, 2026

I changed the smoothing function in the cpp to use the cubic bezier curve from the original impl, it should match the original pretty well now. When smoothness is 1 in the config, it should match the old impl smoothness, and if the user wants they can change this value if they dont want their visualiser to be tied to the animation scale set in the config.

Also in Visualiser.qml I made it so that it requests bar updates every 16 ms (60fps) so that the animation should remain consistent.

@AteebXYZ
Copy link
Author

With the spatial smoothing curvature thing, its your call whether it should remain in the visualiser or be removed.

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.

2 participants