Jump to content

gc2035 driver update - 320x240|640x480 ~20 fps


@lex

Recommended Posts

Hi,

 

I updated the gc2035 driver, kernel 3.4.x.

 

The driver can be loaded with parameter, so you can choose to have different window size and/or image quality on the fly (well, kind of).

 

Parameter: hres=[0,1,2]

 

hres=0 (default without parameter)

640x480, 15 fps, good quality (fps with good light condition)

1280x720, 13 fps, poor quality (fps with good light condition)

1600x1200, 10 fps, poor quality (fps with good light condition)

 

hres=1

800x600, 12 fps, good quality (fps with good light condition)

1600x1200, 8 fps, medium quality (fps with good light condition)

 

hres=2

320x240, 20 fps, poor quality (fps with good light condition)

640x480, 18 fps, medium quality (fps with good light condition)

800x600, 18 fps, medium quality (fps with good light condition)

 

Loading the driver (manually):
modprobe gc2035 hres=1
modprobe vfe_v4l2
 
or add it to /etc/modules
 
Unloading the driver:
modprobe -r -v vfe_v4l2
modprobe -r -v gc2035
 
and loading with other window size and performance:
modprobe gc2035 hres=2
modprobe vfe_v4l2
 
PS: Light condition does affect fps performance!
 
 
Cheers,
 
@lex
 
Link to comment
Share on other sites

I did not try it, but i don't see any reason to fail or break it.

 

I am not aware of any work done on gc2035 by phelum, can you point to the patches?

I does incorporate the work done by Leonardo Lontra in order to get ~20 fps.

Just checked loboris' kernel and it is 6 months old, untouched. I don't use Loboris' kernel.

 

If you would like to conduct some benchmarking you could use v4l2loopback (http://www.sistemasembarcados.org/2016/04/orange-pi-camera-with-v4l2loopback-vidcopy.html) as a base, just for fun.

Link to comment
Share on other sites

Hmm... I thought in the kernel sources we use some basic adjustments are missing (see phelum's work/comments). Now http://phelum.net/temp/gc2035/is empty... O my... just tried it using web.archive.org:

 

http://web.archive.org/web/20150928225142/http://phelum.net/temp/gc2035

http://web.archive.org/web/20150928225220/http://phelum.net/temp/include

 

And this here is most probably all the stuff that's missing: http://web.archive.org/save/_embed/http://phelum.net/temp/gc2035patch or as an archive (at least in Armbian's sun8i kernel sources there is no drivers/media/video/sun4i_csi/ at all which is most probably taken from linux-sunxi sources).

 

What do you think? Or does it work for you with Armbian's kernel already?

Link to comment
Share on other sites

You are right, he worked on linux-sunxi 3.4.103. We need those patch and see if it will work. Some work is required, the include headers must reflect the sun4i csi headers. Can you try it?

Link to comment
Share on other sites

We need those patch and see if it will work. Some work is required, the include headers must reflect the sun4i csi headers. Can you try it?

 

Nope, especially not now since it seems Igor's busy exchanging our sun8i legacy kernel sources ;)

 

The only ressources I scheduled on the camera issue is testing (especially if we can simply use GC2035 also together with BPi M2+ -- I ordered 2 camera modules and am willing to see one of them and/or M2+ passing away ;) )

Link to comment
Share on other sites

OK.

 

I just tried against armbian legacy kernel 3.4.111 without any modifications and have build the driver and kernel with some warnings and errors (fixed).

Unless sunxi-vfe (sunxi video front end) is not working yet on this kernel version, you can just create a patch as you did before.

 

I got the following Warning / Errors with my eabihf: arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

 
  CC      drivers/base/firmware_class.o
drivers/base/firmware_class.c: In function ‘firmware_data_read’:
drivers/base/firmware_class.c:631:9: error: implicit declaration of function ‘kobj_to_dev’ [-Werror=implicit-function-declaration]
drivers/base/firmware_class.c:631:23: warning: initialization makes pointer from integer without a cast [enabled by default]
drivers/base/firmware_class.c: In function ‘firmware_data_write’:
drivers/base/firmware_class.c:726:23: warning: initialization makes pointer from integer without a cast [enabled by default]
cc1: some warnings being treated as errors
make[2]: *** [drivers/base/firmware_class.o] Error 1
make[1]: *** [drivers/base] Error 2
make: *** [drivers] Error 2
make: *** Waiting for unfinished jobs....
 

 

 

Fix:

 

/*
 * firmware_class.c - Multi purpose firmware loading support
 *
 * Copyright © 2003 Manuel Estrada Sainz
 *
 * Please see Documentation/firmware_class/ for more information.
 *
 */
 
#include <linux/capability.h>
#include <linux/device.h>
#include <linux/genhd.h> <= missing header
#include <linux/module.h>

 

 

And the final warning:

 

WARNING: could not find drivers/media/video/sunxi-vfe/lib/.libisp.cmd for drivers/media/video/sunxi-vfe/lib/libisp
WARNING: modpost: Found 5 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
  AS      arch/arm/boot/compressed/piggy.gzip.o
  LD      arch/arm/boot/compressed/vmlinux
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
  UIMAGE  arch/arm/boot/uImage
Image Name:   Linux-3.4.111+
Created:      Thu Apr 14 13:49:26 2016
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    4479224 Bytes = 4374.24 kB = 4.27 MB
Load Address: 40008000
Entry Point:  40008000
  Image arch/arm/boot/uImage is ready

 

 

libisp is pre-built somewhere?
 
vfe_v4l2-y += lib/libisp
 

If sunxi video front end is not working, i think Igor should drop this and i can try to apply phelum's work.

Link to comment
Share on other sites

Update:

 

* little fix to hres=0

* added hres=3 (320x240|352x288|640x480 with low quality cropped image) - CIF image size

 

Best performance/quality you can get is 640x480 ~25* fps (hres=0).

load driver with this parameters: modprobe gc2035 hres=0 mclk=34

 

* good ambient light

Link to comment
Share on other sites

Hmm... I thought in the kernel sources we use some basic adjustments are missing (see phelum's work/comments). Now http://phelum.net/temp/gc2035/is empty... O my... just tried it using web.archive.org:

 

 

Hi,

 

I just checked and the link http://phelum.net/temp/gc2035/ is still valid. I did get the gc2035 working with my 3.4.103+ kernel on my OPi A20. There was a problem with frame queueing that I fixed. But it sounds like the new driver mentioned here is better. I reported my changes on the Orange Pi forum but no-one seemed interested so I lost interest.

 

Cheers,

Steven

Link to comment
Share on other sites

I reported my changes on the Orange Pi forum but no-one seemed interested so I lost interest.

 

Thx for the feedback. I was really interested but got my OPi PC with camera module in Dec 2015 so you weren't active any longer (same with me now -- last login as 'bronco' in orphaned Orange Pi forums might've been in 2015 or early 2016).

 

At the moment I've no access to my H3 boards to check the current driver situation. But we clearly need to add this stuff to our basic Armbian builds.

Link to comment
Share on other sites

I remember you wrote some very good posts on that forum. I worked on the gc2035 driver while I was overseas last June. I still have my OPi A20 board and it has some nice features (e.g. pads for RTC battery, good screen printing on board, onboard Wi-Fi). But it is extinct now which is a shame. I gave up on their first H3 board although sooner or later I'm going to have to upgrade from A20s and wheezy.

 

I do hope someone can get some value from the gc2035 driver.

 

Cheers,

Steven

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines