-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--fade_time setting ignored by PictureFrame2020.py? #48
Comments
I suppose the first thing to do is check what FPS you're actually getting. That will be useful when checking out the 'jerkiness' issue too. You could do that by doing something like num_run_through = 0
f_num = 0 # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
f_tm = time.time() #<<<<<<<<<<<<<<<<<<<<<
while DISPLAY.loop_running():
tm = time.time()
if f_num >= 100: #<<<<<<<<<<<<<<<<<<<<<
print("FPS={:.1f}".format(f_num / (tm - f_tm)))
f_num = 0
f_tm = tm
f_num += 1 #<<<<<<<<<<<<<<<<<<<<<<<<<<<
if (tm > nexttm and not paused) or (tm - nexttm) >= 86400.0: # this must run first iteration of loop If the achieved FPS is less than the target FPS then I would expect the fade_time to be longer than you had set, but I would expect it to be proportional - in the same way that it seems to be proportional to the target FPS in your example. i.e if you set: This is because the script works out the delta_alpha for each frame as
or, for the first example If you want to get a reliable transition time of 2s and display can only run at 4FPS then you need to have delta_alpha of 0.125 so you should |
Here are the FPS results I found with 3840 x 2160 images: with --fps = 20:
with --fps = 30
So, this would seem to explain the observed "jerkiness" and timing issues, but why is the performance so different with the display in 4k mode? By the way, the display is 4k @ 30Hz; I've had difficulty enabling 4k @ 60Hz; would that make a difference? Is there anything to do to "speed up" the actual FPS in 4k mode? |
I just tried measuring FPS at 4k resolution with images which were down-sized to 1920 x 1080. Results were about the same as with the 3840 x 2160 images, so image size seems to have no effect on observed FPS. |
Sorry, been out today. The issue is really that the GL driver on the RPi (or possibly the GPU itself) struggles to get through the fragments (approximately pixels) The old broadcom driver didn't seem to be quite as slow but there are nearly four times as many pixels to process hence the 23 to 6 speed difference. As the fragment shader is the bottleneck nothing else will make any difference. The only option is to make shader faster, I will have a look into that but it's fairly simple so I doubt I can get much. The refresh rate will probably effect video playback but that operates in quite a different way so not really relevant. Will let you know what I find. |
I had another thought. Have you considered computing delta_alpha using actual (i.e. computed) FPS instead of the --Jeff |
I actually thought about using the time, that's what happens with the fading text, but (without actually testing it) I thought it might be more visible if there was uneven FPS due to background tasks. I might try it out and see what it looks like. Is the fading very steppy at 6FPS? |
I'm using a --fade_time=6 with --fps=20 and --time_delay=30. With those parameters, it's not too bad. The text fading itself is a little steppy, though. |
The --fade_time parameter seems to be ignored, whether set in the config file, on the command line when invoking PictureFrame2020.py or via mqtt. The transition between images seems to last for about 10 seconds when --fps=20.0 (and about 15 seconds when --fps=30.0).
I added a little logging code to PictureFrame2020.py at the top of the
while DISPLAY.loop_running()
loop to check the value of fade_time, and the logging shows that the expected value each time through, but the transition time doesn't reflect that value. I've used values of 2.0, 4.0, and 8.0. I'm using 4k/16:9 images (3840 x 2160) on a rPi 4 (8gb).--Jeff
The text was updated successfully, but these errors were encountered: