(07-10-2021, 02:20 AM)kqlnut Wrote: I've tried all the firmware images you provided (by replacing the original af firmware in /lib/firmware), but unfortunately all of them failed to start. I haven't set any of the extra registers though because I don't know how to do that except for modifying the driver and rebuilding the kernel which I haven't had the time for (is there another way?). I will look for more firmware dumps too.
I've added another AF firmware image to my
small repository, which now contains a total of seven variants; already prepared images are, as always, available in the "
firmware" directory. With the driver improvements made by tomog, all firmware images should load correctly, so it would be highly advisable to test all available variants again, because it's highly possible that some of the available firmware images make the auto focus feature work better.
(07-20-2021, 09:33 PM)tomog Wrote: The dmesg log you see is a genuine failure to start the firmware. At the time this occurs, the firmware does fail to start, due to a bug in the driver.
When Megapixels is open, the driver is in a different state, and in this state the firmware is able to load. dmesg should then report that the firmware started successfully.
The fix will make sure the firmware loads successfully when it's meant to.
Awesome, great job!
As already discussed on the #pinephone IRC channel, I'd strongly suggest that you go toward merging these improvements into the Linux kernel mainline. Sure, some more work is required to reach the required quality of code, but that should be achievable.
As already discussed, loading the firmware image into the OV5640 MCU should be performed using the
i2c_transfer() function directly and writing the entire firmware image at once, or in a few segments if that turns out not to work reliably, instead of poking individual registers. That should speed up the firmware loading a bit, reducing the startup time of the Megapixels application.