Don't get confused between stride (sometimes called pitch), and active image width.cpetku wrote: ↑Wed Jun 10, 2020 8:48 pmI know this is an old thread, but the issue described in 2016 is still relevant.
Was there ever a workaround when using the CSI input and video formats such as 480p/576p whereby the width of the image is not divisible by 32? The only possible solution I have found in this thread would appear to be to change the width to 1440 then attempt to scale the resultant image back to its native format for display on the HDMI Output of the PI.
My focus is to use the PI to control a TI HDMI/LVDS bridge (like samsonx) as a method to prove out all functions of the TI Bridge. I have created a custom HAT for the PI using the UH940 and verified functionality at 1920x1080@25 and 720P. However I can't demonstrate the lower resolutions due to what I believe has been stated as a Hardware limitation of the GPU (e.g., fixed stride length). Can this be confirmed (HW limitation) or is it a driver issue that requires me to recompile the kernel?
Stride MUST be a multiple of 16 bytes for the CSI2 receiver, and 32 bytes for the ISP input. Hardware restriction.
The active image within that buffer can be almost any width you like, although subsampled YUV formats such as YUV 4:2:2 and 4:2:0 get a bit odd if it's not an even number of pixels.
V4L2 allows you to specify the stride via the bytesperline field of the format, vs the width in width.
MMAL allows you to specify the stride via the width field, with the active width being crop.width.
720x576 would need bytesperline set to 736 if using V4L2 and V4L2_PIX_FMT_YUV420. (bcm2835-unicam would at one point allow you to select 720 as it only wants a multiple of 16 bytes, but that's been increased to 32 to match the ISP and avoid a world of pain in having to set it manually).
Within MMAL you normally use the template
Code: Select all
output->format->es->video.crop.width = WIDTH; output->format->es->video.crop.height = HEIGHT; output->format->es->video.width = VCOS_ALIGN_UP(WIDTH, 32); output->format->es->video.height = HEIGHT;