camera firmware problems
#21
(07-20-2021, 08:28 AM)tomog Wrote: I have a fix for the firmware loading, and will tidy it up for release.

For now, I have a workaround to enable autofocus:
* Open Megapixels
* Touch your screen.

This should trigger the firmware loading (check dmesg) and you should observe Megapixels doing continuous autofocus. Sometimes it might be update the autofocus. Position your autofocus in the middle of your display, and touch the screen to trigger a autofocus.
Holy shit you are right. It works! That's amazingly simple, I just never tried it since I figured 'autofocus' means focussing by itself. I still wonder why dmesg reports a failure to start the firmware. Maybe it's just wrong debugging information and the firmware is only supposed to start upon touch input in the first place.
Thank you so much!
  Reply
#22
Quote:Holy shit you are right. It works!

Great, I'm glad it works. That gives me confidence that the fix I'm working on will solve this issue for others.

Quote:That's amazingly simple, I just never tried it since I figured 'autofocus' means focussing by itself.

Autofocus is meant to focus by itself, and it does, but only once the firmware successfully loads. The driver has a bug that means the firmware only manages to load once Megapixels has started and the screen has been touched. The fix I'm working on should mean autofocus starts on camera launch, and camera launch should be faster too.

Quote:I still wonder why dmesg reports a failure to start the firmware. Maybe it's just wrong debugging information and the firmware is only supposed to start upon touch input in the first place.

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.
  Reply
#23
(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! Smile  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.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  3/32 upgrade board, Arrived Without Firmware, Troubleshooting Steps to SOLVED biketool 0 341 06-22-2021, 10:03 AM
Last Post: biketool
  camera + megaixel and strange behavior streak 0 305 06-02-2021, 06:45 AM
Last Post: streak
  Pinephone camera thread ryo 9 2,169 05-29-2021, 03:21 AM
Last Post: ryo
  Camera clicking sound unsatisfactory212 2 517 05-07-2021, 02:57 PM
Last Post: megous
  Fail safe way to update ANX7688 firmware scholbert 24 6,247 04-01-2021, 01:28 PM
Last Post: zborgerd
  Strange SD Card Problems anhilde 7 1,098 02-21-2021, 07:52 AM
Last Post: Zebulon Walton
  New motherboard - ANX firmware won't flash. --- 17 3,579 12-26-2020, 01:53 PM
Last Post: p1x3l3d
  Main Board Swap: Camera connector problems tyha 5 1,673 11-19-2020, 06:25 PM
Last Post: pajux
  Camera with stange colors zykran 0 667 09-18-2020, 10:05 AM
Last Post: zykran
  camera question xinyiman 3 1,788 08-31-2020, 05:50 AM
Last Post: Veraendert

Forum Jump:


Users browsing this thread: 1 Guest(s)