-
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
dispmanx snapshot and dispmanx full screen layers #295
Comments
Perhaps I should add some context to this, otherwise it may appear to be fairly esoteric. A number of people who use TFT displays attached to the Raspberry Pi via the GPIO pins use a program called rpi-fbcp (https://github.com/tasanakorn/rpi-fbcp/blob/master/main.c) so that they can see videos etc on their little TFT screens. The rpi-fbcp program calls vc_dispmanx_snapshot() / vc_dispmanx_resource_read_data() with the width and height of the TFT so that the GPU scales the image that it to be displayed on the screen. The rpi-fbcp program is affected by this bug. |
Okay I can see an issue here. Can you try this test firmware build. It is a fixed memory split build (256M/256M). |
Let me know if you spot any regressions with this firmware, but otherwise the fix will be in next rpi-update firmware. |
kernel: conifg: Add CONFIG_DEVPTS_MULTIPLE_INSTANCES See: raspberrypi/linux#603 firmware: dispmanx: Fix snapshot scaling when a fullscreen dest rect is used See: #295 firmware: dispmanx: allow rotations into 24-bit memory displays See: #267 firmware: Add MMAL parameter for render stats See: #287 firmware: image_decode: Move decode thread to second core This improves jpeg decode time a little firmware: imagefx: Separate out the fast 1080i deinterlace algorithm As the 1080i deinterlace doesn't require the 3 frames of context we can save ~6MB by requesting it explicitly
kernel: conifg: Add CONFIG_DEVPTS_MULTIPLE_INSTANCES See: raspberrypi/linux#603 firmware: dispmanx: Fix snapshot scaling when a fullscreen dest rect is used See: raspberrypi/firmware#295 firmware: dispmanx: allow rotations into 24-bit memory displays See: raspberrypi/firmware#267 firmware: Add MMAL parameter for render stats See: raspberrypi/firmware#287 firmware: image_decode: Move decode thread to second core This improves jpeg decode time a little firmware: imagefx: Separate out the fast 1080i deinterlace algorithm As the 1080i deinterlace doesn't require the 3 frames of context we can save ~6MB by requesting it explicitly
Now pushed in official update. |
Thanks! Everything I can test works well. Thanks for all the help! |
@popcornmix, it appears that this issue has re-appeared. I can see this issue both in the current master and next branches of the firmware. I have not had a chance to narrow down the firmware commit that re-introduced this issue. tested using composite output with a Pi2 and a 512Mb Pi B. Easiest way to reproduce is omxplayer -b /opt/vc/src/hello_pi/hello_video/test.h264 (as long as test.h264 doesn't fill the screen). |
Appears to be fixed again. Must have been a temporary regression. |
kernel: conifg: Add CONFIG_DEVPTS_MULTIPLE_INSTANCES See: raspberrypi/linux#603 firmware: dispmanx: Fix snapshot scaling when a fullscreen dest rect is used See: raspberrypi#295 firmware: dispmanx: allow rotations into 24-bit memory displays See: raspberrypi#267 firmware: Add MMAL parameter for render stats See: raspberrypi#287 firmware: image_decode: Move decode thread to second core This improves jpeg decode time a little firmware: imagefx: Separate out the fast 1080i deinterlace algorithm As the 1080i deinterlace doesn't require the 3 frames of context we can save ~6MB by requesting it explicitly
When vc_dispmanx_snapshot() is called and the data is read with a VC_RECT_T that is smaller than screen size, dispmanx layers that have been stretched full screen by using a zeroed out destination rectangle when calling vc_dispmanx_element_add() do not fill the resulting snapshot.
As an example. omxplayer has a command line option -b / --blank (set background to black). In the omxplayer code the method blank_background() is called to create a 1x1 pixel dispmanx layer in the background that is stretched full screen. The screen dimensions are not used in the destination rectangle when vc_dispmanx_element_add() is called, rather the destination rectangle is set with x, y, width and height all set to zero.
If I call vc_dispmanx_snapshot() and retrieve a snapshot using the screen dimensions. These stretched layers appear as they do on the screen. However, if I call vc_dispmanx_snapshot() with width and height that is smaller than the screens dimensions the stretched layer only takes up a fraction of the screen (in the top left hand corner).
Here is an example:
Running omxplayer
Using a 720x576 display
Taking a 400x300 snapshot (using raspi2png https://github.com/AndrewFromMelbourne/raspi2png)
The background layer only takes up the top right hand corner of the screen.
I can reproduce this problem on two different Raspberry Pis (a Model A and Model B). I can also reproduce the problem when the Raspberry Pi is plugged into an HDMI TV.
I have a small test program that demonstrates the problem (https://gist.github.com/AndrewFromMelbourne/dd193fe0d7e6ac5c5343).
Let me know if you need any more information.
The text was updated successfully, but these errors were encountered: