Inno-maker ov9281

Raspberry Pi cameras (V1, V2, wide angle etc), HDMI capture modules etc.
Post Reply
kjjohnsen
Posts: 3
Joined: Wed Nov 25, 2020 12:12 pm

Inno-maker ov9281

Post by kjjohnsen »

I'm trying to use the board with two ov9281 cameras from inno-maker. It's not going well. I can't even make one work, which I find very odd. The stereopi board works fine with the v2 camera. Also, both ov9281 cameras work fine with a raspberry pi 4 and pi-zero. So, I'm thinking that the issue comes down to something going on at the device-tree level. I'm digging, but hope that someone here has some experience with the cameras already: The camera is here: https://www.inno-maker.com/product/cam-mipiov9281/

I've already tried both camera drivers. I've tried with and without the dt-blob.bin. The cameras respond to i2cdetect -y 0 , so I at least think that the i2c lines are correctly connected, but they don't show up under /dev/video* Thanks!

[Edit] By enabling i2c0, one camera works, but only when using the ov9281 dtoverlay that's built into Linux 5.4 and the camera2 port.

kjjohnsen
Posts: 3
Joined: Wed Nov 25, 2020 12:12 pm

Re: Inno-maker ov9281

Post by kjjohnsen »

I found a software solution! :D

Took a long time trying to figure out what the heck device trees actually do (and sorta understand them now).

The root issue is that both cameras use i2c port 0x60, which can't be changed, so they clash. Also, the stereopi i2c lines for both cameras are, by default, set to i2c0. Now, this isn't an issue, from what I can tell, for the stock cameras. But, it is an issue for the ov9281.

But, I discovered that it is possible to set up a software i2c, i.e. bit-banging, and change one of the cameras to use that. Here's the process:

1) recompile the source dt-blob.dts from stereopi, changing the i2c address for camera 0 to 3
2) There is an overlay called i2c-gpio in /boot/overlays. This is compiled from the file in rpi linux github /arch/arm/boot/dts/overlays/ . I ripped out the guts of this and appended it to the overlay for the ov9281 also at /arch/arm/boot/dts/overlays . I also had to swap in values for preprocessor directives, which dtc can't work with. In this overlay, I tell this ov9281 to use the i2c-gpio instead of i2c0.
3) I had to rename some things in the ov9281 overlay so they didn't clash. I could have also probably included the 2nd camera in the above file.
4) I include both overlays in my config.txt, and force the i2c-gpio to be 3

Source is at: https://github.com/kjjohnsen/stereopi_ov9281

Note, the stereopi2 looks like it won't need this solution (at least all of it) because it will allow using i2c1 for the other camera.

Post Reply