IgZero Posted February 21, 2017 Share Posted February 21, 2017 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 1 Quote Link to comment Share on other sites More sharing options...
0 dmorse Posted July 19, 2017 Share Posted July 19, 2017 I'm hitting this same issue with the orangepi zero plus2 (h3). I'm trying to get the 5.20 version of Arbian built for my board now (which is pretty tricky because that is not a build option for my board) Robert, is the the camera breakout board you have? Could you send me a picture of what you had to do to make it work? 0 Quote Link to comment Share on other sites More sharing options...
0 olivluca Posted July 19, 2017 Share Posted July 19, 2017 I finally worked around the issue by modifying boot.cmd adding the lines gpio set PL10 gpio set PG11 at the beginning, right after the "DO NOT EDIT THIS FILE " comment. The I regenerated boot.scr mkimage -A arm -T script -O linux -d boot.cmd boot.scr And rebooted. Before that I tried sudo sunxi-pio -m PL10'<default><default<default><1>' sudo sunxi-pio -m PG11'<default><default<default><1>' but it didn't work 0 Quote Link to comment Share on other sites More sharing options...
0 olivluca Posted July 19, 2017 Share Posted July 19, 2017 (edited) On 8/7/2017 at 11:41 AM, Igor said: There were some changes / fixes in driver sources. I don't have this camera ... Can you check? Just switch to beta repository, upgrade and reboot. Using the beta repository at least solves the segmentation fault when trying to remove vfe_v4l2 but the gc2035 module doesn't accept the hres parameter anymore and the image is worse. Edit: I spoke too soon: the segmentation fault is still there. Edit 2: it seems the hres parameter isn't necessary, I just had to change motion config to get the same image as before. Maybe before the driver didn't respect the required picture size while now it does? Edited July 19, 2017 by olivluca 0 Quote Link to comment Share on other sites More sharing options...
0 dmorse Posted July 19, 2017 Share Posted July 19, 2017 I've given olivluca's solution a shot and that does not work for me. Taking a look at the orangepizeroplus2-h3.fex file in the kernel source I an see what appears to be a lot of different GPIO settings in there. Might setting these make a difference? 0 Quote Link to comment Share on other sites More sharing options...
0 olivluca Posted July 19, 2017 Share Posted July 19, 2017 1 minute ago, dmorse said: I've given olivluca's solution a shot and that does not work for me. Sorry, I forgot to say that mine is an orange pi pc. I got the gpios from the boot.cmd in 5.20 but it seems that's not an option in your case. 0 Quote Link to comment Share on other sites More sharing options...
0 Leonardo Lontra Posted July 19, 2017 Share Posted July 19, 2017 @olivluca Your Don't need more hres mode, now is a dynamic change. For example, If you want 1600x1200 with more image quality, sets resolution and fps to <=8, or 1600x1200 with higher fps, but less image resolution, sets fps to >= 20. Internally, change hres based on resolution or/and framerate. 0 Quote Link to comment Share on other sites More sharing options...
0 Leonardo Lontra Posted July 19, 2017 Share Posted July 19, 2017 @dmorse I have the same problem with armbian 5.24, just back to 5.20 and uses last kernel, works for me. It seems to me that there is something about u-boot, but I'm not sure about that. 0 Quote Link to comment Share on other sites More sharing options...
0 dmorse Posted July 19, 2017 Share Posted July 19, 2017 @Leonardo Lontra Asp previously mentioned, building 5.20 for the pi zero h3 is difficult because that board was not supported back then. 0 Quote Link to comment Share on other sites More sharing options...
0 Leonardo Lontra Posted July 19, 2017 Share Posted July 19, 2017 7 minutes ago, dmorse said: @Leonardo Lontra Asp previously mentioned, building 5.20 for the pi zero h3 is difficult because that board was not supported back then. I not have an orange pi zero for test, but you can try check: - If i2cdetect shows camera address: $ i2cdetect -y 1 (Paste the stdout for us) Maybe it's a wrong address in the fex file. 0 Quote Link to comment Share on other sites More sharing options...
0 dmorse Posted July 19, 2017 Share Posted July 19, 2017 @Leonardo Lontra I'm not sure how this utility works, but this looks pretty empty to me. root@orangepizeroplus2:~# i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- root@orangepizeroplus2:~# 0 Quote Link to comment Share on other sites More sharing options...
0 Leonardo Lontra Posted July 19, 2017 Share Posted July 19, 2017 45 minutes ago, dmorse said: @Leonardo Lontra I'm not sure how this utility works, but this looks pretty empty to me. root@orangepizeroplus2:~# i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- root@orangepizeroplus2:~# Can you write another image that is not armbian and check if the camera works? If works, it's a point to start investigating this. 0 Quote Link to comment Share on other sites More sharing options...
0 dmorse Posted July 20, 2017 Share Posted July 20, 2017 I get the same result using the standard ubuntu server build from the orangepi website, but at least with that one I can see /dev/video0. I haven't actually tried to use the device yet, will do that next. root@OrangePI:~# i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- root@OrangePI:~# ls /dev/video0 /dev/video0 root@OrangePI:~# 0 Quote Link to comment Share on other sites More sharing options...
0 olivluca Posted July 20, 2017 Share Posted July 20, 2017 4 hours ago, dmorse said: I get the same result using the standard ubuntu server build from the orangepi website, but at least with that one I can see /dev/video0. I haven't actually tried to use the device yet, will do that next. In that image it seems uboot activates PL10 and PA17. Try following my instructions but using PA17 instead of PG11. 0 Quote Link to comment Share on other sites More sharing options...
0 dmorse Posted July 20, 2017 Share Posted July 20, 2017 Quote In that image it seems uboot activates PL10 and PA17. Try following my instructions but using PA17 instead of PG11 I don't have a boot.cmd file in /media/boot in that build, only a boot.scr Do you know a way to turn the boot.scr into a boot.cmd for editing and then turn it back? 0 Quote Link to comment Share on other sites More sharing options...
0 olivluca Posted July 20, 2017 Share Posted July 20, 2017 No, I mean with the armbian image. 0 Quote Link to comment Share on other sites More sharing options...
0 dmorse Posted July 20, 2017 Share Posted July 20, 2017 I added this to the top of my /boot/boot.cmd on that build # DO NOT EDIT THIS FILE gpio set PL10 gpio set PA17 and then make a boot.scr out of it and started up from that. Sill can't see /dev/video0. Still getting this out of dmesg root@orangepizeroplus2:~# dmesg | grep -i gc2035 [ 4.539492] [CSI_ERR][GC2035]sensor_read err at sensor_detect! [ 4.539514] [CSI_ERR][GC2035]chip found is not an target chip. root@orangepizeroplus2:~# 0 Quote Link to comment Share on other sites More sharing options...
0 olivluca Posted July 23, 2017 Share Posted July 23, 2017 On 19/7/2017 at 7:17 PM, olivluca said: I finally worked around the issue by modifying boot.cmd adding the lines gpio set PL10 gpio set PG11 .... Before that I tried sudo sunxi-pio -m PL10'<default><default<default><1>' sudo sunxi-pio -m PG11'<default><default<default><1>' but it didn't work I wonder why setting the gpio with uboot works while setting them in userspace doesn't work. Maybe the syntax of sunxi-pio is wrong or something else is missing? 0 Quote Link to comment Share on other sites More sharing options...
0 thedon Posted August 5, 2017 Share Posted August 5, 2017 I got past the error [ISP] isp platform_id = 5![CSI_ERR][GC2035]sensor_read err at sensor_detect![CSI_ERR][GC2035]chip found is not an target chip. following is seen in dmesg output now [ 7.787818] [CSI][GC2035]V4L2_IDENT_SENSOR=2035 [ 8.210055] [CSI][GC2035]disalbe oe! but when I try capturing an image from the camera from a python script using pyimage, it crashes with the following error [ 2173.632135] [CSI][GC2035]enable oe! [ 2173.632583] [CSI][GC2035]V4L2_IDENT_SENSOR=2035 [ 2174.125239] [VFE_ERR]try rgb888 bus error when pix fmt is rgb888/prgb888 at try_fmt_internal! [ 2174.134937] [VFE_ERR]pixel format (0x33424752) width 640 height 480 invalid at vidioc_s_fmt_vid_cap. [ 2174.545886] [VFE_ERR]buffer count is invalid, set to 3 in video capture tried fswebcam also and same error occurs there as well; Have any of you encountered it before and can help? 0 Quote Link to comment Share on other sites More sharing options...
0 Orfait Posted August 6, 2017 Share Posted August 6, 2017 Hi, I don't know what command you use for taking a picture. Here is mine : fswebcam -r 1600x1200 -p YUV420P - > cam1600x1200.jpg Hope it may help you. 0 Quote Link to comment Share on other sites More sharing options...
0 kotc Posted August 12, 2017 Share Posted August 12, 2017 hi guys, it looks like mainline uboot doesnt set PG11 (CSI_EN) on opipc etc anymore. i was lucky to have it enabled on my opi0+2h3. so to make camera work on opipc/opipc+/opilite/opi1 you have to: sunxi-pio -m "PG11<1><0><1><1>" then load modules (or create uboot which enables it at boot time). and PA17 is CSI_PWR_EN which is already set correctly in fex as vip_dev0_power_en. (btw. on opi0+2 CSI_PWR_EN is PA08). 0 Quote Link to comment Share on other sites More sharing options...
0 zador.blood.stained Posted August 12, 2017 Share Posted August 12, 2017 5 minutes ago, kotc said: hi guys, it looks like mainline uboot doesnt set PG11 (CSI_EN) on opipc etc anymore. Why should it? Enabling CSI power it's not a job for the u-boot. As I said earlier in this thread, somebody needs to get their hands dirty and add a new option to the CSI driver, and the pin in question should be parsed from script.bin 0 Quote Link to comment Share on other sites More sharing options...
0 kotc Posted August 12, 2017 Share Posted August 12, 2017 now that i look at it, i enabled PG13 on opi0+2h3, which probably also supplied power and made camera powered. ho hum. funny those little boards, stealing power from any source they can ;). and yeah, i agree camera driver should handle all powering. not to mention it would be nice if it didnt segfault on rmmod 0 Quote Link to comment Share on other sites More sharing options...
0 kotc Posted August 12, 2017 Share Posted August 12, 2017 or not. if i understand schematics correctly, on opi0+2h3 both csi_en and csi_pwr_en are connected to pa08 0 Quote Link to comment Share on other sites More sharing options...
0 zador.blood.stained Posted August 12, 2017 Share Posted August 12, 2017 7 hours ago, kotc said: if i understand schematics correctly, on opi0+2h3 both csi_en and csi_pwr_en are connected to pa08 Yes, looks right, so it needs to be configurable per board (i.e. OPi One uses PA17 for CSI-PWR-EN and PG11 for CSI-EN) 7 hours ago, kotc said: i enabled PG13 on opi0+2h3, which probably also supplied power and made camera powered. Looks like PG13 is wired to the I2S/PCM interface of the AP6212 module. 0 Quote Link to comment Share on other sites More sharing options...
0 garlic Posted September 1, 2017 Share Posted September 1, 2017 I had solved this problem by my friend. Run this script sunxi-pio -m "PG11<1><0><1><1>" modprobe gc2035 modprobe vfe_v4l2 The most import is that don't load gc2035 & vfe_v4l2 before. So you had better remove it in /etc/modules This is my /etc/modules #w1-sunxi #w1-gpio #w1-therm #gc2035 #vfe_v4l2 #sunxi-cir #v4l2loopback you may see /dev/video0, but when you reboot, it lose again I add my scrip to /etc/rc.local this is my /etc/rc.local sunxi-pio -m "PG11<1><0><1><1>" modprobe gc2035 modprobe vfe_v4l2 sleep 5 modprobe v4l2loopback devices=2 /root/vidcopy/vidcopy -w 640 -h 480 -r 30 -i /dev/video0 -o /dev/video1 -f UYVY sleep 5 /root/vidcopy/vidcopy -w 640 -h 480 -r 30 -i /dev/video1 -o /dev/video2 -f UYVY exit 0 Thanks my friend: "虚耗" 0 Quote Link to comment Share on other sites More sharing options...
0 olivluca Posted September 11, 2017 Share Posted September 11, 2017 On 19/7/2017 at 8:06 PM, Leonardo Lontra said: @olivluca Your Don't need more hres mode, now is a dynamic change. For example, If you want 1600x1200 with more image quality, sets resolution and fps to <=8, or 1600x1200 with higher fps, but less image resolution, sets fps to >= 20. Internally, change hres based on resolution or/and framerate. I'm getting weird results with motion: If I set 800x600 the image is OK but flipped horizontally If I set 640x480 the image is OK if I set 1600x1200 this is what I get: 0 Quote Link to comment Share on other sites More sharing options...
0 g40 Posted September 11, 2017 Share Posted September 11, 2017 Ditto. See here: 0 Quote Link to comment Share on other sites More sharing options...
0 olivluca Posted September 21, 2017 Share Posted September 21, 2017 Today I tried mainline kernel but there's no gc2035 module there. Is it so or did I miss something? 0 Quote Link to comment Share on other sites More sharing options...
0 olivluca Posted September 21, 2017 Share Posted September 21, 2017 Found it, the csi interface isn't supported in mainline kernel 0 Quote Link to comment Share on other sites More sharing options...
0 olivluca Posted October 20, 2017 Share Posted October 20, 2017 It turns out that after a few hours of running motion the captured image have a green tint (not like the above sample at 1600x1200, just a normal image with almost no red-blue components). Since I'm using the beta repository I though it was a problem of the kernel of the day, in fact updating and rebooting solved the issue. It turns out that's enough to stop and start motion to get a normally coloured image. Do you think it's an hardware or driver issue? 0 Quote Link to comment Share on other sites More sharing options...
Question
IgZero
After update from armbian5.23 to armbian5.25 driver for gc2035 not work. The device isn't defined.
Under armbian5.23 the gc2035 driver works. The device is defined.
Link to comment
Share on other sites
121 answers to this question
Recommended Posts
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.