Jump to content

[Armbian build PR] - kernel: sunxi: bring back autofocus support for ov5640 camera


RSS Bot

Recommended Posts

Description

We had autofocus patches for ov5640 camera in allwinner current and edge kernel that were disabled due to patch application failure. This PR fixes the patch application failure and re-enables the same

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.

  • [X] Checked that patches applies on 6.4 kernel
  • [X] Checked that patches applies on 6.4 kernel
  • [X] Tested that autofocus works with 6.1 kernel on NanoPi Duo2

The following procedure was used to test autofocus with 6.1 kernel

  1. Compiled and enabled device tree overlay for ov5640 camera taken from the forum post
  2. Took the ov5640_af_2.bin autofocus firmware and placed it in /lib/firmware directory with filename ov5640_af.bin
  3. Ran the following commands to start a camera stream
# v4l2-ctl --device /dev/video1 --set-fmt-video=width=640,height=480,pixelformat=YUYV
# media-ctl --device /dev/media1 --set-v4l2 '"ov5640 0-003c":0[fmt:YUYV8_2X8/640x480]'
# ffmpeg -i /dev/video1 -q 10 -pix_fmt yuv420p -video_size 640x480 -r 5 -listen 1 -f avi http://192.168.29.128:8080/stream&
# v4l2-ctl --device /dev/v4l-subdev0 -c auto_focus_start=1
  1. Verified that autofocus firmware loaded successfully from dmesg output
# dmesg | grep ov5640
[    8.022346] ov5640 0-003c: supply DOVDD not found, using dummy regulator
[    8.022698] ov5640 0-003c: supply AVDD not found, using dummy regulator
[    8.022928] ov5640 0-003c: supply DVDD not found, using dummy regulator
[ 2808.787047] ov5640 0-003c: firmware upload success
[ 2808.787609] ov5640 0-003c: fw started after 0 ms
  1. verified that camera lens moves to focus when moving the subject

Checklist:

  • [ ] My code follows the style guidelines of this project
  • [ ] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [X] My changes generate no new warnings
  • [ ] Any dependent changes have been merged and published in downstream modules

View the full article

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines