I’ve got the same arducam B0165 MIPI camera with ov9281 chipset. You have helped me [1] get it working in the past using the arducam userspace library. I have since switched to using it via the v4l2 linux kernel subsystem on the RPi 3B, and now I want to switch to that on the balena as well.
The switch is accomplished via a single dtoverlay line in config.txt: dtoverlay=ov9281.
However, that does not work on the balena fin - for the same reason presumably, that the overlay is rpi-3b specific, and needs to be updated for the balena fin.
Has anyone done this already? i.e. gotten ov9281.dtbo working on balena fin?
Just to update, I tried on a limb to build the latest kernel from raspberrypi (5.10.33-v7+) because the reported error, “Unsupported sensor id” was similar to a report that ended up being fixed by it (a long shot that didn’t pan out).
So adding that running 96110e96f1a82e236afb9a248258f1ef917766e9 (git describe --tags gives raspberrypi-kernel_1.20210303-1-2218-g96110e96f1a8) from https://github.com/raspberrypi/linux.git still results in the error. (used default config, i.e. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfigper Kernel building - Raspberry Pi Documentation)
Additionally, repeatedly unloading and reloading the ov9281 module results in the same error, but with different read values from the I2C bus:
Just a small update, in case you are working on this - I’ve managed to get the I2C side working, but then when I try to stream I get no results. Turning on the verbosity on the bcm2835_unicam kernel module shows that the ISR routine is never called. I can share the dt-blob & the changes I’ve done to the dts files (I’ve not yet figured out how to use the overlays so I ended up changing the dts sources in the kernel tree).
I am looking at this now, and was wondering if you tried this using Raspbian on the balenaFin. You can find the release here : Releases · balena-os/pi-gen · GitHub
Also, if you have any shareable code for Raspbian on 3B+ that you know to work - it will help too.
Thanks for getting around to it. I would love to use v4l again, it is a standard interface, would make our code more portable, and has more tooling.
I have tested as I wrote above - have not touched it since. To recap: balena os works fine on rpi3b, but not on the balena fin. I have not tried raspbian on the balenaFin.
Apologies for the delay. There’s definitely something up as the same app on RPi3 running balenaOS gave me a different output, as compared to the balenaFin. I am going to discuss this internally and figure if it’s a software issue or a hardware - as there’s some additional overlay stuff for the balena-fin that’s in play.
Thanks for your efforts. When you say “gave me a different output” can you say if you managed to capture images with the balenaFin and the ov9281 using the kernel driver, i.e. v4l2 driver?
I tried v4l2-ctl --stream-mmap --stream-count=1 --stream-to=file.raw and then downloaded the image to my machine and used hexdump to see that the file wasn’t empty.
I am now trying ffmpeg along v4l2 to capture a stream in one of the supported formats
This output was from the RPi3 device, when I asked ffmpeg to tell me what all formats it supported. There’s some issue here because the device threw an error at the end of the log. But I atleast know now that raw greyscale output is supported. So that’s what I am targetting