|
Edited by DoubleHP at 2019-4-23 03:52
I am getting somewhere with ubuntu_lxde_desktop_OrangePipc_v0_9_1.img.xz
I have tried to plug raw camera (without ribbon and adapter) 3 different ways: lens up, lens down, not connected at all. In all 3 cases, I get the same output:
- root@OrangePI:~# ls /dev/vid*
- ls: cannot access '/dev/vid*': No such file or directory
- root@OrangePI:~# modprobe gc2035 hres=0
- root@OrangePI:~# modprobe vfe_v4l2
- root@OrangePI:~# sleep 1
- root@OrangePI:~# ls /dev/vid*
- /dev/video0
- root@OrangePI:~# dmesg | grep -i -e csi -e 2035 -e isp
- [ 0.547947] [DISP]disp_module_init
- [ 0.548216] cmdline,init_disp=
- [ 0.548252] cmdline,disp=
- [ 0.554691] [DISP] Fb_map_kernel_logo,line:932:Fb_map_kernel_logo failed!
- [ 0.581312] [DISP]disp_module_init finish
- [ 4.554267] cmdline,disp=
- [ 5.200042] [DISP] disp_device_attached_and_enable,line:159:attched ok, mgr0<-->device0, type=4, mode=5
- [ 23.993592] [DISP] disp_ioctl,line:1584:para err in disp_ioctl, cmd = 0x0,screen id = 65536
- [ 66.420288] [VFE]dev->isp_sel = 0
- [ 66.433750] [ISP] isp platform_id = 5!
- [ 66.440116] [VFE]Find sensor name is "gc2035", i2c address is 78, type is "YUV" !
- [ 66.440126] [VFE]Sub device register "gc2035" i2c_addr = 0x78 start!
- [ 66.508237] [CSI_ERR][GC2035]sensor_read err at sensor_detect!
- [ 66.508245] [CSI_ERR][GC2035]chip found is not an target chip.
- [ 66.576134] [VFE]Sub device register "gc2035" failed!
- root@OrangePI:~# ls /dev/vid*
- /dev/video0
- root@OrangePI:~#
Copy code
=> This distribution accepts to load the driver and create the node, but, behave exactly the same way whether device is plugged or not.
- root@OrangePI:~# uname -a
- Linux OrangePI 3.4.112 #4 SMP PREEMPT Wed Dec 7 09:46:40 CST 2016 armv7l armv7l armv7l GNU/Linux
- root@OrangePI:~# cat /etc/lsb-release
- DISTRIB_ID=Ubuntu
- DISTRIB_RELEASE=16.04
- DISTRIB_CODENAME=xenial
- DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
Copy code
Now using adapter:
- root@OrangePI:~# i2cdetect -y 0
- 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:~# 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/vid*
- ls: cannot access '/dev/vid*': No such file or directory
- root@OrangePI:~# modprobe gc2035 hres=0
- root@OrangePI:~# modprobe vfe_v4l2
- root@OrangePI:~# sleep 1
- root@OrangePI:~# ls /dev/vid*
- /dev/video0
- root@OrangePI:~# dmesg | grep -i -e csi -e 2035 -e isp
- [ 95.723834] [VFE]dev->isp_sel = 0
- [ 95.737679] [ISP] isp platform_id = 5!
- [ 95.740138] [VFE]Find sensor name is "gc2035", i2c address is 78, type is "YUV" !
- [ 95.740148] [VFE]Sub device register "gc2035" i2c_addr = 0x78 start!
- [ 95.807757] [CSI][GC2035]V4L2_IDENT_SENSOR=2035[CSI][GC2035]disalbe oe!
- [ 96.255133] [VFE]Sub device register "gc2035" is OK!
- root@OrangePI:~# ls /dev/vid*
- /dev/video0
Copy code
=> at last, my hardware is fine.
- # v4l2-ctl -d /dev/video0 --list-formats | head -n 30
- ioctl: VIDIOC_ENUM_FMT
- Index : 0
- Type : Video Capture
- Pixel Format: '422P'
- Name : planar YUV 422
- Index : 1
- Type : Video Capture
- Pixel Format: 'YU12'
- Name : planar YUV 420
- Index : 2
- Type : Video Capture
- Pixel Format: 'YV12'
- Name : planar YVU 420
- Index : 3
- Type : Video Capture
- Pixel Format: 'NV16'
- Name : planar YUV 422 UV combined
- Index : 4
- Type : Video Capture
- Pixel Format: 'NV12'
- Name : planar YUV 420 UV combined
- Index : 5
- Type : Video Capture
- Pixel Format: 'NV61'
- Name : planar YUV 422 VU combined
- root@OrangePI:~# v4l2-ctl -d /dev/video0 --list-formats | wc
- 121 377 2512
- root@OrangePI:~# fswebcam -r 1600x1200 -p YUV420P - > /tmp/cam1600x1200.jpg
- --- Opening /dev/video0...
- Trying source module v4l2...
- /dev/video0 opened.
- No input was specified, using the first.
- --- Capturing frame...
- Captured frame in 0.00 seconds.
- --- Processing captured image...
- Writing JPEG image to '-'.
Copy code
The proper way to connect the ribbons depends on the exact hardware you buy. The idea is that the shiny face of ribbons usually go face down (not facing the lever)
Note that v4l2-ctl will produce this output as soon as modprobe is fine, even if the camera is not connected. So, this command is not reliable to check if hardware is working fine.
Here is a better check:
- root@OrangePI:~# fswebcam -r 1600x1200 -p YUV420P - > /tmp/cam1600x1200.jpg
- --- Opening /dev/video0...
- Trying source module v4l2...
- /dev/video0 opened.
- No input was specified, using the first.
- Unable to query input 0.
- VIDIOC_ENUMINPUT: Invalid argument
Copy code
It will fail two different ways if camera is not connected, and/or driver not loaded. And will produce a sane picture if it's all fine.
This bunch of commands can be run in one shot. ubuntu_lxde_desktop_OrangePipc_v0_9_1.img produces a lot of garbage in dmesg, so buffer is running out in 10 or 20s. The last command must be run less than 5s after modprobe, because later than 10s, it won't be able to find relevant lines.
- modprobe gc2035
- modprobe vfe_v4l2
- sleep 1
- ls /dev/vid*
- dmesg | grep -i -e csi -e 2035 -e isp | grep -q -e 'Sub device register "gc2035" is OK!' && echo OK
- dmesg | grep -i -e csi -e 2035 -e isp | grep -q -e 'Sub device register "gc2035" failed!' && echo BAD
- fswebcam -r 1600x1200 -p YUV420P - > /tmp/cam1600x1200.jpg
Copy code
|
|