INNO-MAKER / CAM-OV9281RAW-V2

Sersor OV9281, RAW-DATA, 2-LAN Output Module
19 stars 4 forks source link

Linux_6.1.0 Missing #8

Open juanmf opened 11 months ago

juanmf commented 11 months ago

Read here that Raspberry pi 4B should support it out of the box, after a few tweaks. but I get no camera detected


juanmf@raspberrypi:~ $ uname -a
Linux raspberrypi 6.1.0-rpi4-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.54-1+rpt2 (2023-10-05) aarch64 GNU/Linux

juanmf@raspberrypi:~/CAM-OV9281RAW-V2 $ ./autoinstall_driver.sh 

------INNO-MAKER cammipi_ov9281 driver install script  v1.0------
Enable i2c_vc in /boot/config.txt ...
count = 0
--- Add i2c_vc=on to /boot/config.txt
count2 = 0
--- Add dtoverlay=vc_mipi_ov9281 to /boot/config.txt
console=serial0,115200 console=tty1 root=PARTUUID=a9ece6e0-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles cfg80211.ieee80211_regdom=US
--- Add cma=128M to /boot/cmdline.txt
./autoinstall_driver.sh: line 81: warning: command substitution: ignored null byte in input
6.1.0-rpi4-rpi-v8
Raspberry Pi 4 Model B Rev 1.5
aarch64
@ Linux Version Not Match! Please contact support@inno-maker.com
System is 64 bit arch.
driverpath: ./0/arm64/pi3_4
@ Install Failed, Please contact support@inno-maker.com

juanmf@raspberrypi:~ $ libcamera-hello
Preview window unavailable
[0:00:49.715162321] [2584]  INFO Camera camera_manager.cpp:284 libcamera v0.1.0+52-a858d20b
ERROR: *** no cameras available ***

strangely enough I get some devices (not video0) listed.

$ ls /dev/video*
/dev/video10  /dev/video11  /dev/video12  /dev/video13  /dev/video14  /dev/video15  /dev/video16  /dev/video18  /dev/video19  /dev/video20  /dev/video21  /dev/video22  /dev/video23  /dev/video31

the parameters in config files the installer script wanted to add I have added manually already.

thanks!

luntik2012 commented 9 months ago

I've built the driver using CAM-OV9281RAW-V2/inno_ov9281_driver_source_code, but I don't have /dev/video0 too

I'm using rpi3 b+ with linux 6.1.21

I can even see current operation mode after running sudo make setmode9

$ cat /sys/module/inno_mipi_ov9281/parameters/sensor_mode 
9

I can also see some issues in dmesg:

[   17.370114] i2c i2c-11: Added multiplexed i2c bus 0
[   17.371595] i2c i2c-10: Failed to register i2c client ov9281 at 0x60 (-16)
[   17.371626] i2c i2c-10: of_i2c: Failure registering /soc/i2c0mux/i2c@1/ov9281@60
[   17.371706] i2c i2c-10: Failed to create I2C device for /soc/i2c0mux/i2c@1/ov9281@60
[   17.371809] i2c i2c-11: Added multiplexed i2c bus 10
...
[   21.646507] vc_mipi_ov9281: disagrees about version of symbol module_layout
...
[  220.123606] unicam 3f801000.csi: ep_node is /soc/csi@7e801000/port/endpoint
[  220.123726] unicam 3f801000.csi: found subdevice /soc/i2c0mux/i2c@1/vc_mipi_ov9281@60
[  220.123838] unicam 3f801000.csi: parsed local endpoint, bus_type 5
[  220.123858] unicam 3f801000.csi: subdevice /soc/i2c0mux/i2c@1/vc_mipi_ov9281@60: CSI-2 bus, 2 data lanes, flags=0x00000001
[  220.237215] inno_mipi_ov9281: loading out-of-tree module taints kernel.

I've also recompiled v4l2_capture_y8 to have aarch64 version, but it doesn't work because there is no /dev/video0

I've tried all remaining /dev/video* devices, it doesn't work also, strerr says Inappropriate ioctl for device

I was unable to use ./autoinstall_driver.sh, it gives me an error:

user@rpi:~/git/CAM-OV9281RAW-V2 $ ./autoinstall_driver.sh 
------INNO-MAKER cammipi_ov9281 driver install script  v1.0------
Enable i2c_vc in /boot/config.txt ...
count = 1
count2 = 1
--- Add dtoverlay=vc_mipi_ov9281 to /boot/config.txt
console=serial0,115200 console=tty1 root=PARTUUID=50a4b102-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles,cma=128M,inno_mipi_ov9281.sensor_mode=9
--- alread have cma=128M string
./autoinstall_driver.sh: line 82: warning: command substitution: ignored null byte in input
6.1.21-v8+
Raspberry Pi 3 Model B Plus Rev 1.3
aarch64
model is Raspberry Pi 3 Model B Plus Rev 1.3
System is 64 bit arch.
driverpath: ./Linux_6.1.21/arm64/pi3
PWD: /home/user/git/CAM-OV9281RAW-V2/Linux_6.1.21/arm64/pi3
-----make install----START:
sudo install -p -m 644 vc_mipi_ov9281/vc_mipi_ov9281.ko   /lib/modules/6.1.21-v8+/kernel/drivers/media/i2c/
sudo install -p -m 644 vc_mipi_ov9281.dtbo /boot/overlays/
sudo /sbin/depmod -a 6.1.21-v8+
sudo /sbin/modprobe vc_mipi_ov9281
modprobe: ERROR: could not insert 'vc_mipi_ov9281': Exec format error
make: *** [Makefile:35: install] Error 1

I've also tried to replace prebuilt driver with manually built (I hope they have the same purpose), successfully lodaded it using ./autoinstall_driver.sh, but I still have no /dev/video0 even after manually loading the driver using sudo make setmode9

user@rpi:~/git/CAM-OV9281RAW-V2 $ cp inno_ov9281_driver_source_code/sourcecode/inno_mipi_ov9281/inno_mipi_ov9281.ko Linux_6.1.21/arm64/pi3/vc_mipi_ov9281/vc_mipi_ov9281.ko 
user@rpi:~/git/CAM-OV9281RAW-V2 $ ./autoinstall_driver.sh 
------INNO-MAKER cammipi_ov9281 driver install script  v1.0------
Enable i2c_vc in /boot/config.txt ...
count = 1
count2 = 2
--- Add dtoverlay=vc_mipi_ov9281 to /boot/config.txt
console=serial0,115200 console=tty1 root=PARTUUID=50a4b102-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles,cma=128M,inno_mipi_ov9281.sensor_mode=9
--- alread have cma=128M string
./autoinstall_driver.sh: line 82: warning: command substitution: ignored null byte in input
6.1.21-v8+
Raspberry Pi 3 Model B Plus Rev 1.3
aarch64
model is Raspberry Pi 3 Model B Plus Rev 1.3
System is 64 bit arch.
driverpath: ./Linux_6.1.21/arm64/pi3
PWD: /home/user/git/CAM-OV9281RAW-V2/Linux_6.1.21/arm64/pi3
-----make install----START:
sudo install -p -m 644 vc_mipi_ov9281/vc_mipi_ov9281.ko   /lib/modules/6.1.21-v8+/kernel/drivers/media/i2c/
sudo install -p -m 644 vc_mipi_ov9281.dtbo /boot/overlays/
sudo /sbin/depmod -a 6.1.21-v8+
sudo /sbin/modprobe vc_mipi_ov9281
--------------------------------------

  ADD 'dtparam=i2c_vc=on' and 'dtoverlay=vc_mipi_ov9281' to your /boot/config.txt
  ADD 'disable_touchscreen=1' to your /boot/config.txt if a touchscreen is attached
  ADD 'cma=128M' to your /boot/cmdline.txt

--------------------------------------
-----make install----END.
INNO-MAKER: reboot now?(y/n):
y
reboot...
Connection to rpi closed by remote host.
Connection to rpi closed.

When starting without overlay and loading driver manually, v4l2_capture_y8 ./v4l2_capture_y8 -s 4135500 -g 0x88 -h 0 -v 0 -c 5 gives me this

cam_init:120, req.count: 3
cam_init:140, buffer.length: 307200
cam_init:141, buffer.m.offset: 0
cam_init:140, buffer.length: 307200
cam_init:141, buffer.m.offset: 307200
cam_init:140, buffer.length: 307200
cam_init:141, buffer.m.offset: 614400
cam_init:164, ioctl(VIDIOC_STREAMON) failed 22(Invalid argument)
error on main:414

And here is libcamera-hello output

$ libcamera-hello 
Preview window unavailable
[0:20:01.673722982] [3115]  INFO Camera camera_manager.cpp:297 libcamera v0.0.5+83-bde9b04f
[0:20:01.747299111] [3116]  WARN CameraSensorProperties camera_sensor_properties.cpp:261 No static properties available for 'ov9281'
[0:20:01.747463016] [3116]  WARN CameraSensorProperties camera_sensor_properties.cpp:263 Please consider updating the camera sensor properties database
[0:20:01.833457769] [3116]  INFO RPI vc4.cpp:437 Registered camera /base/soc/i2c0mux/i2c@1/ov9281@60 to Unicam device /dev/media3 and ISP device /dev/media0
[0:20:01.833663444] [3116]  INFO RPI pipeline_base.cpp:1101 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
[0:20:01.839232919] [3115]  INFO Camera camera.cpp:1033 configuring streams: (0) 640x400-YUV420
[0:20:01.841631592] [3116]  INFO RPI vc4.cpp:565 Sensor: /base/soc/i2c0mux/i2c@1/ov9281@60 - Selected sensor format: 640x400-Y10_1X10 - Selected unicam format: 640x400-Y10P
[0:20:01.867898982] [3119]  WARN IPARPI ipa_base.cpp:940 Could not set SHARPNESS - no sharpen algorithm
[0:20:02.974266367] [3116]  WARN V4L2 v4l2_videodevice.cpp:2007 /dev/video0[12:cap]: Dequeue timer of 1000000.00us has expired!
[0:20:02.974480010] [3116] ERROR RPI pipeline_base.cpp:1333 Camera frontend has timed out!
[0:20:02.974574697] [3116] ERROR RPI pipeline_base.cpp:1334 Please check that your camera sensor connector is attached securely.
[0:20:02.974669800] [3116] ERROR RPI pipeline_base.cpp:1335 Alternatively, try another cable and/or sensor.
ERROR: Device timeout detected, attempting a restart!!!
[0:20:02.991494421] [3121]  WARN IPARPI ipa_base.cpp:940 Could not set SHARPNESS - no sharpen algorithm
[0:20:04.079213309] [3116]  WARN V4L2 v4l2_videodevice.cpp:2007 /dev/video0[12:cap]: Dequeue timer of 1000000.00us has expired!
[0:20:04.079515754] [3116] ERROR RPI pipeline_base.cpp:1333 Camera frontend has timed out!
[0:20:04.079698356] [3116] ERROR RPI pipeline_base.cpp:1334 Please check that your camera sensor connector is attached securely.
[0:20:04.079877209] [3116] ERROR RPI pipeline_base.cpp:1335 Alternatively, try another cable and/or sensor.
ERROR: Device timeout detected, attempting a restart!!!
[0:20:04.096604487] [3123]  WARN IPARPI ipa_base.cpp:940 Could not set SHARPNESS - no sharpen algorithm
[0:20:05.184317398] [3116]  WARN V4L2 v4l2_videodevice.cpp:2007 /dev/video0[12:cap]: Dequeue timer of 1000000.00us has expired!
[0:20:05.184614218] [3116] ERROR RPI pipeline_base.cpp:1333 Camera frontend has timed out!
[0:20:05.184807653] [3116] ERROR RPI pipeline_base.cpp:1334 Please check that your camera sensor connector is attached securely.
[0:20:05.184988329] [3116] ERROR RPI pipeline_base.cpp:1335 Alternatively, try another cable and/or sensor.
ERROR: Device timeout detected, attempting a restart!!!
[0:20:05.201452589] [3125]  WARN IPARPI ipa_base.cpp:940 Could not set SHARPNESS - no sharpen algorithm
[0:20:06.290237742] [3116]  WARN V4L2 v4l2_videodevice.cpp:2007 /dev/video0[12:cap]: Dequeue timer of 1000000.00us has expired!
[0:20:06.290551436] [3116] ERROR RPI pipeline_base.cpp:1333 Camera frontend has timed out!
[0:20:06.290731591] [3116] ERROR RPI pipeline_base.cpp:1334 Please check that your camera sensor connector is attached securely.
[0:20:06.290923881] [3116] ERROR RPI pipeline_base.cpp:1335 Alternatively, try another cable and/or sensor.
ERROR: Device timeout detected, attempting a restart!!!
[0:20:06.308518807] [3127]  WARN IPARPI ipa_base.cpp:940 Could not set SHARPNESS - no sharpen algorithm
^@[0:20:07.396129817] [3116]  WARN V4L2 v4l2_videodevice.cpp:2007 /dev/video0[12:cap]: Dequeue timer of 1000000.00us has expired!
[0:20:07.396365127] [3116] ERROR RPI pipeline_base.cpp:1333 Camera frontend has timed out!
[0:20:07.396461845] [3116] ERROR RPI pipeline_base.cpp:1334 Please check that your camera sensor connector is attached securely.
[0:20:07.396555854] [3116] ERROR RPI pipeline_base.cpp:1335 Alternatively, try another cable and/or sensor.
ERROR: Device timeout detected, attempting a restart!!!
[0:20:07.413200634] [3129]  WARN IPARPI ipa_base.cpp:940 Could not set SHARPNESS - no sharpen algorithm
^C
anonymouslojz commented 9 months ago

hi, please follow attach guide for driver compiling if you use innomaker driver. We do not support precompiler for kernel above 5.15, we provide source code instead .

Another way, you can user raspebrry pi os driver by dtoverlay=ov9281 to enable, then you can use libcamera-hello -t 0 to preview. CAM-MIPI9281V2-Compile Driver Source Code.pdf

juanmf commented 9 months ago

Hi, thanks for your reply. I had to downgrade to a supported kernel. The suggested overlay on kernel 6.1 didn't work for me. Great camera otherwise but the setup time is tough.

Edit: my setup:

juanmf@raspberrypi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:    11
Codename:   bullseye
juanmf@raspberrypi:~ $ uname -a
Linux raspberrypi 5.15.32-v7l+ #1539 SMP Fri Apr 1 11:39:03 BST 2022 armv7l GNU/Linux
juanmf@raspberrypi:~ $ ls /dev/video*
/dev/video0  /dev/video10  /dev/video11  /dev/video12  /dev/video13  /dev/video14  /dev/video15  /dev/video16  /dev/video18  /dev/video20  /dev/video21  /dev/video22  /dev/video23  /dev/video31
# Note video0
juanmf@raspberrypi:~ $ libcamera-hello 
libcamera-hello: error while loading shared libraries: libcamera.so.0.0.3: cannot open shared object file: No such file or directory
# But from picamera I can use it.