Armbian 5.25 on OrangePI PC: The gc2035 video camera doesn't work


Recommended Posts

After update from armbian5.23 to armbian5.25 driver for gc2035 not work. The device isn't defined.

=========== Armbian 5.25 ==============
root@orangepipc:~# ls /dev/video*
/dev/video0  /dev/video1
 
Where: /dev/video0 and /dev/video1 - v4l2loopback
 
root@orangepipc:~# cat /etc/modules
#8189es
#rfcomm
#w1-sunxi
#w1-gpio
#w1-therm
gc2035
vfe_v4l2
#sunxi-cir
v4l2loopback
 
root@orangepipc:~# modinfo vfe_v4l2
filename:       /lib/modules/3.4.113-sun8i/kernel/drivers/media/video/sunxi-vfe/vfe_v4l2.ko
description:    Video front end driver for sunxi
license:        Dual BSD/GPL
author:         raymonxiu
depends:        videobuf-core,vfe_os,vfe_subdev,videobuf-dma-contig,cci
intree:         Y
vermagic:       3.4.113-sun8i SMP preempt mod_unload modversions ARMv7 p2v8
parm:           ccm:string
parm:           i2c_addr:uint
parm:           act_name:string
parm:           act_slave:uint
parm:           define_sensor_list:uint
parm:           vfe_i2c_dbg:uint
parm:           isp_log:uint
parm:           vips:uint
root@orangepipc:~# modinfo gc2035
filename:       /lib/modules/3.4.113-sun8i/kernel/drivers/media/video/sunxi-vfe/device/gc2035.ko
license:        GPL
description:    A low-level driver for GalaxyCore gc2035 sensors
author:         @lex
author:         leonardo lontra
author:         raymonxiu
alias:          i2c:gc2035
depends:        cci,vfe_subdev
intree:         Y
vermagic:       3.4.113-sun8i SMP preempt mod_unload modversions ARMv7 p2v8
parm:           hres:hres=0 (640x480|1280x720|1600x1200 - 15 FPS), hres=1 (800x600|1600x1200 - 10 FPS), hres=2 (320x240|640x480|800x600 - 20 FPS), hres=3 (320x240|352x288|640x480 - 15 FPS) (default=0) (uint)
parm:           mclk:mclk override (default=0) (uint)
parm:           frate:frate override (default=0) (uint)
root@orangepipc:~# dmesg | grep GC2035
[    5.938267] [CSI_ERR][GC2035]sensor_read err at sensor_detect!
[    5.938289] [CSI_ERR][GC2035]chip found is not an target chip.
root@orangepipc:~# uname -a
Linux orangepipc 3.4.113-sun8i #28 SMP PREEMPT Thu Feb 2 02:01:28 CET 2017 armv7l armv7l armv7l GNU/Linux
root@orangepipc:~# cat /etc/armbian-release
# PLEASE DO NOT EDIT THIS FILE
BOARD=orangepipc
BOARD_NAME="Orange Pi PC"
VERSION=5.25
LINUXFAMILY=sun8i
BRANCH=default
ARCH=arm
IMAGE_TYPE=stable
 
root@orangepipc:~#
================================
 

Under armbian5.23 the gc2035 driver works. The device is defined.

=========== Armbian 5.23 ==============
root@orangepipc:~# ls /dev/video*
/dev/video0  /dev/video1  /dev/video2
 
Where: /dev/video0 and /dev/video1 - v4l2loopback, /dev/video2 - gc2035
 
root@orangepipc:~# cat /etc/modules
#8189es
#gpio_sunxi
#w1-sunxi
#w1-gpio
#w1-therm
gc2035
vfe_v4l2
#sunxi-cir
v4l2loopback
 
root@orangepipc:~# modinfo vfe_v4l2
filename:       /lib/modules/3.4.112-sun8i/kernel/drivers/media/video/sunxi-vfe/vfe_v4l2.ko
description:    Video front end driver for sunxi
license:        Dual BSD/GPL
author:         raymonxiu
depends:        videobuf-core,vfe_os,vfe_subdev,videobuf-dma-contig,cci
intree:         Y
vermagic:       3.4.112-sun8i SMP preempt mod_unload modversions ARMv7 p2v8
parm:           ccm:string
parm:           i2c_addr:uint
parm:           act_name:string
parm:           act_slave:uint
parm:           define_sensor_list:uint
parm:           vfe_i2c_dbg:uint
parm:           isp_log:uint
parm:           vips:uint
root@orangepipc:~# modinfo gc2035
filename:       /lib/modules/3.4.112-sun8i/kernel/drivers/media/video/sunxi-vfe/device/gc2035.ko
license:        GPL
description:    A low-level driver for GalaxyCore gc2035 sensors
author:         @lex
author:         leonardo lontra
author:         raymonxiu
alias:          i2c:gc2035
depends:        cci,vfe_subdev
intree:         Y
vermagic:       3.4.112-sun8i SMP preempt mod_unload modversions ARMv7 p2v8
parm:           hres:hres=0 (640x480|1280x720|1600x1200 - 15 FPS), hres=1 (800x600|1600x1200 - 10 FPS), hres=2 (320x240|640x480|800x600 - 20 FPS), hres=3 (320x240|352x288|640x480 - 15 FPS) (default=0) (uint)
parm:           mclk:mclk override (default=0) (uint)
parm:           frate:frate override (default=0) (uint)
root@orangepipc:~# dmesg | grep GC2035
[    5.353480] [CSI][GC2035]V4L2_IDENT_SENSOR=2035
[    5.780057] [CSI][GC2035]disalbe oe!
root@orangepipc:~# uname -a
Linux orangepipc 3.4.112-sun8i #10 SMP PREEMPT Sun Oct 23 16:06:55 CEST 2016 armv7l GNU/Linux
root@orangepipc:~# cat /etc/armbian-release
# PLEASE DO NOT EDIT THIS FILE
BOARD=orangepipc
BOARD_NAME="Orange Pi PC"
VERSION=5.23
LINUXFAMILY=sun8i
BRANCH=default
ARCH=arm
 
root@orangepipc:~#
================================
 
P.S.: Settings of parameters in section [csi0] are identical in both versions of the orangepipc.fex file
Link to post
Share on other sites
Armbian is a community driven open source project. Do you like to contribute your code?

twi2 not used

 

[twi2]

twi_used = 0
 
Link to post
Share on other sites

hmmm, ok.

 

[    5.938267] [CSI_ERR][GC2035]sensor_read err at sensor_detect!

 

Is still a i2c issue, may be i2c has been updated on 5.25?

Please, double check your fex, decompile fex from 5.23 and 5.25 and see if there are other changes.

Has double-checked orangepipc.fex, hasn't found fundamental differences. The file is attached.
My personal opinion that a problem in the vfe_v4l2 module.
 
When loading the gc2035 module no error messages arise.
 

 

root@orangepipc:~# modprobe gc2035

root@orangepipc:~# dmesg

...SKIP...

[   18.819559] [drm] Initialized mali_drm 2.1.1 20101111 on minor 1
[   20.825372] vmouse_input_dev_open
[   23.340048] eth0: no IPv6 routers present
[   23.867915] Bluetooth: Core ver 2.16
[   23.868004] NET: Registered protocol family 31
[   23.868014] Bluetooth: HCI device and connection manager initialized
[   23.868026] Bluetooth: HCI socket layer initialized
[   23.868036] Bluetooth: L2CAP socket layer initialized
[   23.868062] Bluetooth: SCO socket layer initialized
root@orangepipc:~#
 

 

 

When loading the vfe_v4l2 module error messages appear.

 

root@orangepipc:~# modprobe vfe_v4l2

root@orangepipc:~# dmesg

...SKIP...

[   18.819559] [drm] Initialized mali_drm 2.1.1 20101111 on minor 1
[   20.825372] vmouse_input_dev_open
[   23.340048] eth0: no IPv6 routers present
[   23.867915] Bluetooth: Core ver 2.16
[   23.868004] NET: Registered protocol family 31
[   23.868014] Bluetooth: HCI device and connection manager initialized
[   23.868026] Bluetooth: HCI socket layer initialized
[   23.868036] Bluetooth: L2CAP socket layer initialized
[   23.868062] Bluetooth: SCO socket layer initialized
[ 2078.177814] [iSP] isp platform_id = 5!
[ 2078.248173] [CSI_ERR][GC2035]sensor_read err at sensor_detect!
[ 2078.248195] [CSI_ERR][GC2035]chip found is not an target chip.
root@orangepipc:~#
 

 

In attempt to unload the vfe_v4l2 module

 

root@orangepipc:~# modprobe -r -v vfe_v4l2

rmmod vfe_v4l2
Segmentation fault
root@orangepipc:~#
 
Link to post
Share on other sites

I am still on 5.23 on my board and this works.

I would suggest to @Igor / @zador.blood.stained to build a dev image with all CSI / VFE debugging enabled , this could help to track down possible errors.

 

I can't think anything else to try. I have searched for the commits that could possible break the CSI / VFE, but have not seen anything relevant.

Don't know if a change on kernel defconfig could break it.

Link to post
Share on other sites

Problem is solved.

1) I make Armbian5.20 image from source code ( https://github.com/igorpecovnik/lib/archive/v2016.09.tar.gz )

2) Write image to SD card
3) Boot from SD card
4) After initial initialization of system it is necessary to execute:

sudo apt-get update

sudo apt-get upgrade

sudo reboot

5) Boot orangepi and login

sudo modprobe gc2035

sudo modprobe vfe_v4l2

 

 

The camera /dev/video0 present

 

root@orangepipc:~# dmesg

...SKIP...
[  414.935853] [iSP] isp platform_id = 5!
[  415.007804] [CSI][GC2035]V4L2_IDENT_SENSOR=2035[CSI][GC2035]disalbe oe!
 

root@orangepipc:~# ls /dev/vid*

/dev/video0
root@orangepipc:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.7 (jessie)
Release:        8.7
Codename:       jessie
root@orangepipc:~# uname -a
Linux orangepipc 3.4.113-sun8i #10 SMP PREEMPT Thu Feb 23 19:55:00 CET 2017 armv7l GNU/Linux
root@orangepipc:~# cat /etc/armbian-release
# PLEASE DO NOT EDIT THIS FILE
BOARD=orangepipc
BOARD_NAME="Orange Pi PC"
VERSION=5.25
LINUXFAMILY=sun8i
BRANCH=default
ARCH=arm
IMAGE_TYPE=stable
 
Link to post
Share on other sites

Thanks IgZero. After failing in every other direction I went, I accepted my fate, downgraded and followed your instructions. For the first time, my camera is visible to linux.  Now I can finally start playing with the project I bought the damn orange for.. :-)

Link to post
Share on other sites

Ok pinned the problem : it is the boot.cmd/boot.scr which is NOT updated with a straight upgrade from 5.20 to >=5.25. 

Let's resume this :

- if you load the original boot.cmd from 5.20, gc2035/vfe_v4l4 simply work.

- if you load the updated boot.cmd from 5.25/5.26/5.27 gc2035/vfe_v4l2 stop to work (croaking about CSI not able to detect a target chip).

 

That's all folks!

Now should someone versed in u-boot parameters arcanes invest some time to see what's the real difference which impacts gc2035/vfe_v4l2, and eventually corrects/documents it to everybody potentially banging their head about this in the future ?

 

Regards,

Link to post
Share on other sites
1 hour ago, graki said:

Now should someone versed in u-boot parameters arcanes invest some time to see what's the real difference which impacts gc2035/vfe_v4l2, and eventually corrects/documents it to everybody potentially banging their head about this in the future ?

Previously in the boot script there was a command to enable CSI related regulator by setting a GPIO pin. This was removed some time ago since this is not a good way to deal with this, it has to be solved by a kernel driver modification that uses FEX configuration.

Link to post
Share on other sites

Hello, tried what you suggested like that:

freshly booted into:  (lsb_release -a)

 

Distributor ID:    Debian
Description:    Debian GNU/Linux 8.8 (jessie)
Release:    8.8
Codename:    jessie
 

with kernel: 3.4.113-sun8i

 

modprobe gc_2035

modprobe vfe_v4l2

 

and dmesg after that looked like:

 

[ISP] isp platform_id = 5!
[CSI_ERR][GC2035]sensor_read err at sensor_detect!
[CSI_ERR][GC2035]chip found is not an target chip.
 

and I got a orange PI with H3 and 1GB 

 

any help would be supergreat. 

all the best

 

Link to post
Share on other sites
9 minutes ago, armbinator said:

orange PI with H3 and 1GB

Can be either Plus or PC and IIRC both use different GPIO pins for CSI. I was asking for the following but that is only save on an OPi PC:

sudo modprobe -r vfe_v4l2
sudo modprobe -r gc_2035
sudo sunxi-pio -m PG11'<default><default<default><1>'
sudo modprobe gc_2035 hres=1
sudo modprove vfe_v4l2

 

Link to post
Share on other sites

Hi, it is not Plus, just a https://linux-sunxi.org/Orange_Pi_PC to make sure we talk about the same.  

Just tried it and it didn't do anything different as before...

 

[ISP] isp platform_id = 5!
[CSI_ERR][GC2035]sensor_read err at sensor_detect!
[CSI_ERR][GC2035]chip found is not an target chip.

 

and if I try to remove the drivers, vfe_v4l2 then crash and burn:

....

[ 2395.772436] [<c03b5688>] (device_del+0x120/0x184) from [<c03b9f10>] (platform_device_del+0x28/0x5c)
[ 2395.772436] [<c03b9f10>] (platform_device_del+0x28/0x5c) from [<c03b9f60>] (platform_device_unregister+0x1c/0x28)
[ 2395.772436] [<c03b9f60>] (platform_device_unregister+0x1c/0x28) from [<bf3902c4>] (vfe_exit+0x88/0x174 [vfe_v4l2])
[ 2395.772436] [<bf3902c4>] (vfe_exit+0x88/0x174 [vfe_v4l2]) from [<c007fab0>] (sys_delete_module+0x1ac/0x24c)
[ 2395.772436] [<c007fab0>] (sys_delete_module+0x1ac/0x24c) from [<c000df60>] (ret_fast_syscall+0x0/0x30)
[ 2395.772436] Code: eb345031 e594313c e284101c e59f0064 (e5932034) 
[ 2397.972548] ---[ end trace 8d60e35500ae2068 ]---

 

Link to post
Share on other sites
On 19/6/2017 at 6:02 PM, tkaiser said:

Can be either Plus or PC and IIRC both use different GPIO pins for CSI. I was asking for the following but that is only save on an OPi PC:


sudo modprobe -r vfe_v4l2
sudo modprobe -r gc_2035
sudo sunxi-pio -m PG11'<default><default<default><1>'
sudo modprobe gc_2035 hres=1
sudo modprove vfe_v4l2

 

 

Nope, it didn't work (just imaged and booted), will try with 5.20 now.

 

root@orangepipc:~# sunxi-pio -m PG11'<default><default<default><1>'
root@orangepipc:~# modprobe gc2035 hres=1
root@orangepipc:~# modprobe vfe_v4l2
root@orangepipc:~# tail /var/log/syslog
Jul  8 08:42:39 localhost systemd[1]: Starting User Manager for UID 0...
Jul  8 08:42:40 localhost systemd[1890]: user@0.service: Failed at step PAM spawning /lib/systemd/systemd: Operation not permitted
Jul  8 08:42:40 localhost systemd[1]: Started User Manager for UID 0.
Jul  8 08:42:41 localhost systemd[1]: Started Session 1 of user root.
Jul  8 08:42:58 localhost rsyslogd-2007: action 'action 9' suspended, next retry is Sat Jul  8 08:43:28 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
Jul  8 08:45:01 localhost rsyslogd-2007: action 'action 9' suspended, next retry is Sat Jul  8 08:45:31 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
Jul  8 08:45:01 localhost CRON[2163]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jul  8 08:45:04 localhost kernel: [  730.871462] [ISP] isp platform_id = 5!
Jul  8 08:45:04 localhost kernel: [  730.948212] [CSI_ERR][GC2035]sensor_read err at sensor_detect!
Jul  8 08:45:04 localhost kernel: [  730.948229] [CSI_ERR][GC2035]chip found is not an target chip.

 

Link to post
Share on other sites
  • Igor pinned this topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...