kockie69 / Visualizer

VCV Rack Visualizer based on ProjectM
GNU General Public License v3.0
5 stars 2 forks source link

LFMEmbedded outputs occasionally black frames #41

Closed docb closed 1 year ago

docb commented 1 year ago

VCVRack 2.2 Linux Ubuntu

https://user-images.githubusercontent.com/1134412/210166457-058f06a7-df65-485f-bfbf-c0c65eb989e8.mp4

in this video the frame 180 and 644 is black.

This occurs in many of the presets - so this could be a bug.

kockie69 commented 1 year ago

Thanks for raising. Do you mean the flashes that happen? I don't have access to my computer, but are you saying in other presets the black frames are exactly the same ones, 180 and 644?

docb commented 1 year ago

i meant that the flashes occur often, i only checked the frame number for this preset.

docb commented 1 year ago

Even with this simple preset i get flashes:

[preset00]
per_frame_1000=// just a double box
per_frame_1001=//

fDecay=1
zoom=0
rot=0.0
warp=1
ob_size=0.2
ob_r=0.0
ob_g=0.0
ob_b=0.0
ob_a=0.0
ib_size=0.1
ib_r=1.0
ib_g=0.0
ib_b=0.0
ib_a=1.0

so i become suspicious that this is a general problem and only unseen because of almost hectic presets.

kockie69 commented 1 year ago

This is with all visuals I think.

I am able to reproduce on my Linux and spent the whole morning trying to fix this. Till now, I can't reproduce on my windows machine. I am not able to test on Mac. So I am thinking this might be a linux/mac specific issue. Any help appreciated... What are your specs of your machine? I'am using nvidia. How about you?

docb commented 1 year ago

nvdia gforce gt710 - nothing special, linux ubuntu 20 on my old mac book pro all is good, not seen any issue. so it reduces the problem to linux ...

docb commented 1 year ago

On thing may be of interest: If the title is displayed, then there is drawn a white line on the left border (may be due to overlap) in the case of the black frame.

docb commented 1 year ago

i managed to workaround this as i have found out that the reason for the black frame is that https://github.com/kockie69/Visualizer/blob/bff78b8be0599c5fc6159a9f439d49bf24048ce2/src/Module.cpp#L547 returned 0 exactly in those spots. So as a workaround i stored a variable lastX2 with the last x2 and used it if x2 == 0. However to find out why the https://github.com/kockie69/Visualizer/blob/bff78b8be0599c5fc6159a9f439d49bf24048ce2/src/Renderer.hpp#L84 is occasionally zero is another task ...

kockie69 commented 1 year ago

Ok, great finding. I will work on it tonight when I am back from work, but actually this x2 isn't needed. I spotted that over the weekend and was thinking of removing it. But I didn't know it sometimes being 0 did cause this issue. In theory replacing x2 by x in line 564 should also fix the issue. Although I added that weird construction for a reason, I think it caused crashes on Mac or something. Need to check and test. But this is getting me in the right direction, thanks again

docb commented 1 year ago

so far all good after replacing x2 with x.

kockie69 commented 1 year ago

Yes, same here. Are you able to check on a Mac if it is crashing with this change?

docb commented 1 year ago

no because building mac with rack-plugin-toolchain fails.

kockie69 commented 1 year ago

I am building a version at the moment that I can upload to google drive.

kockie69 commented 1 year ago

It is building here: https://github.com/kockie69/Visualizer/actions/runs/3943281372

docb commented 1 year ago

ok i can try then, do you know which action caused the crash on mac?

kockie69 commented 1 year ago

I crashed when starting.

kockie69 commented 1 year ago

Can you access it from github or do I have to upload to Google drive?

docb commented 1 year ago

if you can tell me where the artifacts are after build.

btw: renderer->getBuffer() returns null on startup may be this should also be checked (simply return from drawLayer)

kockie69 commented 1 year ago

If you follow this linkhttps://github.com/kockie69/Visualizer/actions/runs/3943281372 jou can download them when you scroll to the bottom

docb commented 1 year ago

yes found it already and downloading it.

kockie69 commented 1 year ago

I added the check on null. So I am thinking, maybe by adding this check that if in the line before it can be removed for Mac. Maybe the crash on Mac was also caused by this null that is dealt with differently on Mac than on windows and Linux.

docb commented 1 year ago

however 2.1.9 did not crash on mac - is running

docb commented 1 year ago

btw: do you know any resource where i can learn to understand making presets? i only have this old milkdrop html from Geiss and i am still wondering how these presets work exactly (i.e. which setting causes what).

kockie69 commented 1 year ago

The projectm discord might help, I think there are some people that can get you in the right direction

kockie69 commented 1 year ago

So if I build another one with the check on null and removing the if (x == (b1/380/4)) { would you be able to test it on mac?

docb commented 1 year ago

ok thanks.

docb commented 1 year ago

yes i can check another build

kockie69 commented 1 year ago

New builds are available here: https://github.com/kockie69/Visualizer/actions/runs/3943596180

docb commented 1 year ago

ok, running on mac. no issues found.

kockie69 commented 1 year ago

Great! I will test a bit more on Windows and if successful I think I will upload a new version for Andrew to deploy. Thanks for your help!

kockie69 commented 1 year ago

Latest version 2.1.9 has been released that fixed this issue