-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
vc_dispmanx_update_submit: callback function is execute immediately, not on completion #355
Comments
It may be a threading / buffering artefact of printf. If the callback is really occurring immediately the assert will fail as flag will be zero. |
Yes, I did just what you said, and the assert fails. |
It seems Chips from the Raspberry Pi forums has found a possible candidate commit that started causing this: So, has the callback function behaviour been modified somehow? How should it be used now? |
Are you calling vc_dispmanx_vsync_callback? |
Nope, I am not. I've seen it in /opt/vc/include/interface/vmcs_host/vc_dispmanx.h with the new firmware. |
No you shouldn't be calling vc_dispmanx_vsync_callback, but the commit you indicated was vc_dispmanx_vsync_callback related which was why I asked. |
Ok, so is there an issue here or it's me missing some detail? |
Can you post your test code? |
Of course. This is the callback function:
And this is how I call submit sync and assert on var, which is a global variable:
Assert fails. |
Do you have a complete test program? |
Yes. There it is: |
You were passing:
which is the return value of void function which is evaluating as zero. Try
|
If I do that, I get:
and the callback is never called... |
The callback functions needs to look like:
to fix the warning. There is still another bug... |
Yes, doing that fixes the warning, but the callback function is never called. |
@popcornmix: Do you mean there's still a bug on my test program or there is a bug on the API? This really doesn't work as expected. |
Probably a firmware bug - @pelwell is just investigating. |
Great. I hope to hear from him, then 👍 |
Before the userland commit mentioned above, the callback was called correctly but the handle callback parameter would always have been zero. The commit made that error more serious, because it had the effect of interpreting all of those update notifications as vsync notifications. I've pushed a patch to userland that fixes the immediate problem and makes the callbacks work again. There is still a problem with vsyncs multiplying with each run, but that will require a firmware change. |
I've now finished a companion patch for the firmware that cancels vsync callbacks when the client disconnects. That should be released soon, along with rebuilt userland libraries, provided they pass the rigorous QA process. |
Please run rpi-update and test. |
kernel: fiq_fsm: Falling out of the state machine isn't fatal See: raspberrypi/linux#739 kernel: rtl8192cu: Add PID for D-Link DWA 131 See: raspberrypi/linux#818 firmware: vc_dispmanx: Fix update/vsync callbacks See: #355 firmware: dispserv: Clean up vsync requests on client disconnection See: raspberrypi/userland#218 firmware: [hdmi] Work around an issue with Toshiba TV See: http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=62155 firmware: Allow Pi1/Pi2 and EDID device id specific config options See: #361 See: #320
kernel: fiq_fsm: Falling out of the state machine isn't fatal See: raspberrypi/linux#739 kernel: rtl8192cu: Add PID for D-Link DWA 131 See: raspberrypi/linux#818 firmware: vc_dispmanx: Fix update/vsync callbacks See: raspberrypi/firmware#355 firmware: dispserv: Clean up vsync requests on client disconnection See: raspberrypi/userland#218 firmware: [hdmi] Work around an issue with Toshiba TV See: http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=62155 firmware: Allow Pi1/Pi2 and EDID device id specific config options See: raspberrypi/firmware#361 See: raspberrypi/firmware#320
pelwell & popcornmix: Seems to work as expected now! |
kernel: fiq_fsm: Falling out of the state machine isn't fatal See: raspberrypi/linux#739 kernel: rtl8192cu: Add PID for D-Link DWA 131 See: raspberrypi/linux#818 firmware: vc_dispmanx: Fix update/vsync callbacks See: raspberrypi#355 firmware: dispserv: Clean up vsync requests on client disconnection See: raspberrypi/userland#218 firmware: [hdmi] Work around an issue with Toshiba TV See: http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=62155 firmware: Allow Pi1/Pi2 and EDID device id specific config options See: raspberrypi#361 See: raspberrypi#320
Hi,
vc_dispmanx_update_submit() takes a callback function that is supossed to be called on completion. So if, for example, I do:
where the callback function is simply:
then I get this output:
...but I should get "**Next call" first, since the update won't be "completed" until the next vsync arrives. I allways get the wrong order (just in case one could think we could be VERY near to an vsync when the pageflip is issue and that could be confusing).
What am I missing here?
thanks
The text was updated successfully, but these errors were encountered: