projectM-visualizer / projectm

projectM - Cross-platform Music Visualization Library. Open-source and Milkdrop-compatible.
https://discord.gg/mMrxAqaa3W
GNU Lesser General Public License v2.1
3.22k stars 365 forks source link

Broken transition? #787

Open protyposis opened 3 months ago

protyposis commented 3 months ago

Describe the bug When switching presets with a soft cut, a certain type of transition seems to be broken. See the bottom area in the attached picture and video below.

Screenshots Screenshot_20240303_194814

https://github.com/projectM-visualizer/projectm/assets/189372/f61d8b90-fc2e-47f6-8f49-a545c7fdeba9

Desktop (please complete the following information): Using projectM 4.1 arm64 build on Android 11 (Nvidia Shield TV), but thought it may help to report it anyway. Please let me know if you need any other information.

ps: Thank you for this awesome piece of software!

Blaquewithaq commented 3 months ago

It would be very helpful if you could provide the name of the preset you're displaying here!

kblaschke commented 3 months ago

It looks like the "plasma" transition is only affecting the bottom part of the screen, in the shape of a triangle - which would make me think that the actual transition quad is not rendered correctly for some reason. I've tested it many times, and have never seen this behavior, so can't really tell what's going on there. If you can create a OpenGL API trace for a frame with a broken transition, that'd be very helpful. I've never tested on Android and also have no knowledge about how to debug or render there. It should work similarly to other OpenGL ES platforms though.

Are all transitions behaving this way, or only this particular one?

protyposis commented 3 months ago

It would be very helpful if you could provide the name of the preset you're displaying here!

Here are two example presets between which this issue happened (from the cream of the crop collection; issue doesn't seem related to presets, though):

Rozzor vs Esotic - Pixie Party Light (Party Down).milk
shifter - brain coral primaries.milk

If you can create a OpenGL API trace for a frame [...] I've never tested on Android and also have no knowledge

Haven't done this either, but I'm willing to try. Does this look like it could provide what you need?

Are all transitions behaving this way, or only this particular one?

Only the "plasma" transition.

protyposis commented 3 months ago

The Android GPU Inspector linked above only supports selected phones. Nvidia provides its own toolkit for Android, "CodeWorks for Android" containing "Nsight Graphics 2019.3.0" with a frame debugger, but I can't get it to work with my Shield (getting stuck in "Injecting library..." step). The latest toolkit was released with Android 9, but the Shield was later updated to Android 11 - maybe they're incompatible, and toolkit support was dropped in the meantime. So, unfortunately, I'm out of ideas.

kblaschke commented 3 months ago

Sadly I can't really give any advice regarding Android development, that's completely outside of my current knowledge range. The only thing I could work with and at least tell what's going wrong there is some OpenGL API validation output. There are different possibilities what causes this error, but the one I think is most probable is that the "plasma" transition shader can't be compiled and thus the draw call uses an invalid shader program, which will definitely cause undefined behavior, like the one seen in your video.

One thing you can try, if you have some way of getting STDOUT output (or using other means of Android-specific logging) out of libprojectM is that:

If the shader compilation fails, you'll hopefully get some output with the error message. It might well be that Android's GLSL compiler doesn't understand some parts of the plasma shader (note this file isn't the full program, just the "main" function).

If you actually get some output, I can see if I'm able to replace the offending parts with a more compatible syntax.

The next projectM release will focus on developers integrating it, specifically we'll add a proper logging API for errors and other debug messages, plus other things helpful for debugging the library from the application's side. You should subscribe to issue #732 to get updates on that particular feature, once we start/finish implementing it.

protyposis commented 3 months ago

Unfortunately, this doesn't help - there's no exception thrown here.