Thu Jun 16, 2016 12:06 pm
Many thanks for doing the legwork - it means I can just look at the code rather than having to try reproducing problems.
From the images I reckon that it's 120 pixels off.
Readout should be 2592 x (2592/16*9) = 2592x1458, and then 2x2 binned to 1296x729. Odd numbers don't work, so we make it 1460 before binning, or 730 after.
That's 1944-1460 = 484 lines to lose. Centre crop and I'd expect 242 lines off top and bottom. The driver claims 240 lines (before binning) off the top, and 244 lines off the bottom which is a little odd.
In the register settings it looks like Y_START has been set to 120, except that is meant to be before binning value, so should be 240 - ah, out by 120 lines. Smoking gun!
(I'll skip using git blame so I don't self-incriminate!)
I will just check with Pi Towers for their view, but I think this should be fixed in the firmware. It is blatantly wrong, and anyone doing an upgrade should test again afterwards.
How much of a hacker are you? I wouldn't recommend this normally, but it's the easiest way to test.
If you use a hex editor (I use wxHexEditor under x86 Linux) on start_x.elf, search for the hex sequence 02387800 and there should be one instance. Amend that to 0238F000 (just change the one byte) and try it in the Pi. I'd hope that should give the correct FOV, or possibly those 2 pixels off mentioned earlier.
It may be that two changes of 02387800 to 0238F200, and 42 bytes later change 0738b300 to 0738b500 should shift down by those 2 lines and more accurately match.
It goes without saying DON'T DO THIS ON A CRITICAL PI!
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.