Konsl / spicetify-visualizer

Audio Visualizer for Spicetify
161 stars 13 forks source link

Performance issues #4

Closed Myuui closed 10 months ago

Myuui commented 1 year ago

very laggy animation

klassenserver7b commented 1 year ago

Please provide the following information:

UniFio2475 commented 1 year ago

Had same issue, I have latest version of spotify and spicetify, I use windows with RTX 3070 and ryzen 5 3600 so idk where the problem is from. But it's laggy on every song

But, if i reduce the size of the window it start to become smooth and clean, so the problem is maybe how the size of the visualizer work with rendering it ?

Konsl commented 1 year ago

I updated the code for calculating the resolution for rendering the visualizer to include factors like dpi, system-wide UI scaling, scaling using Ctrl+Plus / Ctrl+Minus, etc. The original version could have led to the visualizer being rendered at multiple times the screen resolution in some cases, which could have caused these performance problems.

Please check if the latest update resolves this issue, look at the README for instructions.

UniFio2475 commented 1 year ago

Nothing have changed for me 😓

UniFio2475 commented 1 year ago

even with maxed ctrl + plus it's still laggy (but a bit better than fullscreen), and still smooth when the windows is shrinked

Konsl commented 1 year ago

I'm really sorry, but I can't figure out what the problem might be in your case. Hardware is definitely not the problem (as I'm running it on a 10th GEN i7's iGPU and it works perfectly fine).

If you can, it would be great if you could check to see if hardware accelerated rendering is enabled for the Spotify UI process, and maybe even use the DevTools to find out what resolution the canvas is rendering at.

This would be really helpful to find out what is causing the low frame rate and hopefully fix it.

UniFio2475 commented 1 year ago

image idk if it's fine or if 1200px wide is too much to handle, tried to change that to 50% of size and it's smooth, so i just think the rendering size is too much to handle

Maybe is there a way to reduce the size of the rendering and then upscale it ? image Or also have a setting button to choose the wanted size 🤔

EDIT : actually a better way, i haven't touched the %scale but just changed the width and heigh and set them to 500 and it's smooth again, so uhh yup my pc don't want to handle smoothly above 1000

Myuui commented 1 year ago

Spotify for Windows 1.2.6.863.ge7902f05 Spicetify v2.16.2 Theme: Dribbblish / dracula Extensions: songstats.js, adblock.js, fullAppDisplayMod.js, featureshuffle.js, sortByPlayCount.js, spotifyGenres.js, playEnhancedSongs.js, imageOpener.js, beautiful-lyrics.js, theme.js Custom apps: marketplace, ncs-visualizer

Windows 10 22H2, Intel(R) Core(TM) i3-10110U CPU @ 2.10GHz 2.59 GHz, Intel® UHD Graphics 27.20.100.9664

Every songs

BigFlubba commented 1 year ago

Spotify: Spotify for Windows (64 bit) 1.2.20.1218.g02aff7a4 Spicetify v2.23.2 Theme: marketplace Extensions: QueueTime.js, group-session.js, volumePercentage.js, section-marker.js, noTrackingLinks.js, seekonscroll.js, friendlikes.js, queuePanel.js Custom apps: marketplace, new-releases, ncs-visualizer, lyrics-plus, reddit

OS: Edition Windows 11 Pro Version 22H2 Installed on ‎9/‎23/‎2023 OS build 22621.2361 Experience Windows Feature Experience Pack 1000.22674.1000.0

Hardware: Device name Big-Flubba-PC Processor AMD Ryzen 9 5900X 12-Core Processor 3.70 GHz Installed RAM 64.0 GB Nvidia GeForce RTX 3070 8GB GPU

Spotify is nowhere close to using the resources provided even with having hardware acceleration enabled. As mentioned above changing the resolution of it changes the framerate. I don't know if it's a limitation of Spotify as that gets laggy while using this mod or the actual mod. I've also noticed that it is out of sync. I understand a delay due to processing but I think that can be improved.

Konsl commented 1 year ago

The issue seems to be due to very poor programming on my end.

I have noticed that, first of all, my code is not great at using GPU resources, and secondly, the visualizer is doing heavy computation in JavaScript, which results in the rendering thread maxing out a single CPU core.

Just wanted to say that the current implementation is still to be seen as a prototype, and that I am planning to improve it soon.

Xeo23 commented 1 year ago

@Konsl i just wanted to thank you man for doing this.. thank youuuuuu soooooooo much..❤️ And I was thinking if you can make a kde plasma widget port of it or help me make one, it would be sooo nice to have it natively on plasma. and again thanks for making it. And actually I have the same issue but I am on fedora.

Roonil commented 1 year ago

@Konsl i just wanted to thank you man for doing this.. thank youuuuuu soooooooo much..❤️ And I was thinking if you can make a kde plasma widget port of it or help me make one, it would be sooo nice to have it natively on plasma. and again thanks for making it. And actually I have the same issue but I am on fedora.

Hello there, I've made the spectrum for Linux, X11 using GLava. You can check my GitHub and install it from there.

klassenserver7b commented 1 year ago

@Konsl i just wanted to thank you man for doing this.. thank youuuuuu soooooooo much..❤️ And I was thinking if you can make a kde plasma widget port of it or help me make one, it would be sooo nice to have it natively on plasma. and again thanks for making it. And actually I have the same issue but I am on fedora.

I'm currently working on implementing this shader as a theme for Panon. So hopefully it will be available as a Plasma widget soon.

Xeo23 commented 1 year ago

@Konsl i just wanted to thank you man for doing this.. thank youuuuuu soooooooo much..❤️ And I was thinking if you can make a kde plasma widget port of it or help me make one, it would be sooo nice to have it natively on plasma. and again thanks for making it. And actually I have the same issue but I am on fedora.

Hello there, I've made the spectrum for Linux, X11 using GLava. You can check my GitHub and install it from there.

Thats great I will give it a try.

Xeo23 commented 1 year ago

@Konsl i just wanted to thank you man for doing this.. thank youuuuuu soooooooo much..❤️ And I was thinking if you can make a kde plasma widget port of it or help me make one, it would be sooo nice to have it natively on plasma. and again thanks for making it. And actually I have the same issue but I am on fedora.

I'm currently working on implementing this shader as a theme for Panon. So hopefully it will be available as a Plasma widget soon.

That's so awsm, looking forward to it. Can you give the url so we can keep an eye on the development of it and try it asap.

Konsl commented 1 year ago

I just rewrote the renderer in WebGL. It can now make much better use of the available resources by doing most of the computationally heavy work on the GPU.

During my tests, it was always able to achieve the 60 FPS my monitor supports while using at most 50% of my Intel iGPUs resources. (about 20–30 FPS using the old renderer)

Because of the nature of WebGL, there might be problems which only occur in certain scenarios, depending on, for example, driver versions, device manufacturers or different versions of the Chromium engine. Please open an issue if you are experiencing crashes, visual glitches, etc.

Xeo23 commented 1 year ago

@Konsl It works very well now on my Linux box. Perfectly smooth. Thanks. I think this issue should be closed now.