-
Notifications
You must be signed in to change notification settings - Fork 5k
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
media: bcm2835-unicam: Fix bug in buffer swapping logic #4189
Conversation
If multiple sets of interrupts occur simultaneously, it may be unsafe to swap buffers, as the hardware may already be re-using the current buffers. In such cases, avoid swapping buffers, and wait for the next opportunity at the Frame End interrupt to signal completion. Additionally, check the packet compare status when watching for frame end for buffers swaps, as this could also signify a frame end event. Signed-off-by: Naushir Patuck <[email protected]>
@mdevaev and @JakubVanek here is a candidate fix for #4128. Please let me know if you have any issues with this fix. |
Attached as a patch file for your convenience. 0001-media-bcm2835-unicam-Fix-bug-in-buffer-swapping-logi.zip |
FYI, clicking on any commit and adding |
Useful shortcut, thanks! |
Testing... |
It looks good here - with this patch I can't reproduce any of the problems using JPEG or H264 modes of ustreamer. Before applying this, the NULL dereference occurred the second time I plugged in the cable. Thank you! |
I don't see the problem anymore either. Apparently this is fixed. Thanks! |
Thanks! @6by9 this looks like it has fixed this problem. |
Your commit text would be frowned upon as it describes two things.
But I'm happy enough with it. |
kernel: drm/vc4: crtc: Reduce PV fifo threshold on hvs4 See: raspberrypi/linux#4207 kernel: vc4/drm: Adjustments to hdmi audio dma to reduce glitches See: raspberrypi/linux#4208 kernel: overlays: gpio-led: new overlay See: raspberrypi/linux#4206 kernel: bcm2835-codec tweaks See: raspberrypi/linux#4113 kernel: Assign crypto aliases to different AES implementation modules See: raspberrypi/linux#4198 kernel: media: bcm2835-unicam: Fix bug in buffer swapping logic See: raspberrypi/linux#4189 kernel: configs: Add CONFIG_RTS_HCTOSYS=y See: raspberrypi/linux#4205 kernel: overlays: Improve the i2c-rtc,i2c_csi_dsi option firmware: video_decode: For VC1/WMV with no signalled header bytes, use start of 1st buffer See: raspberrypi/linux#4113
kernel: drm/vc4: crtc: Reduce PV fifo threshold on hvs4 See: raspberrypi/linux#4207 kernel: vc4/drm: Adjustments to hdmi audio dma to reduce glitches See: raspberrypi/linux#4208 kernel: overlays: gpio-led: new overlay See: raspberrypi/linux#4206 kernel: bcm2835-codec tweaks See: raspberrypi/linux#4113 kernel: Assign crypto aliases to different AES implementation modules See: raspberrypi/linux#4198 kernel: media: bcm2835-unicam: Fix bug in buffer swapping logic See: raspberrypi/linux#4189 kernel: configs: Add CONFIG_RTS_HCTOSYS=y See: raspberrypi/linux#4205 kernel: overlays: Improve the i2c-rtc,i2c_csi_dsi option firmware: video_decode: For VC1/WMV with no signalled header bytes, use start of 1st buffer See: raspberrypi/linux#4113
If multiple sets of interrupts occur simultaneously, it may be unsafe
to swap buffers, as the hardware may already be re-using the current
buffers. In such cases, avoid swapping buffers, and wait for the next
opportunity at the Frame End interrupt to signal completion.
Additionally, check the packet compare status when watching for frame
end for buffers swaps, as this could also signify a frame end event.
Signed-off-by: Naushir Patuck [email protected]