Open-source Allwinner V3 ISP driver to enable blob-free camera support in mainline Linux

Bootlin has just submitted the first patchset for the Allwinner V3 image signal processor (ISP) driver in mainline Linux which should pave the way for a completely open-source, blob-free camera support in Linux using V4L2.

There are several blocks in an SoC for camera support including a camera input interface such as MIPI CSI 2 and an ISP to process the raw data into a usable image. Add to this the need to implement the code for sensors, and there’s quite a lot of work to get it all working.

Allwinner SDK comes with several binary blobs, aka closed-source binary, but Bootlin is working on making those obsolete, having first worked on Allwinner A31, V3s/V3/S3, and A83T MIPI CSI-2 support for the camera interface driver in the V4L2 framework (and Rockchip PX30, RK1808, RK3128 and RK3288 processors), as well as implemented support for Omnivision OV8865 and OV5648 image sensors earlier this year.

Allwinner V3 ISP Linux driver

Paul Kocialkowski has just published a blog post announcing initial support for Allwinner V3 “Hawkview” ISP in mainline Linux, and in combination with the earlier work we’ve just mentioned, the company was able to implement a proper V4L2 driver for the Allwinner V3’s ISP that is completely open-source, with no binary blob involved. You can check out the patchset submission thread for additional information. What may be missing is H.264 video encoding, since the company only got funding for developing H.264 and H.265 decoding on Allwinner processors, when the initiative for an open-source Allwinner VPU driver was introduced over three years ago.

Paul notes that the currently proposed Allwinner ISP driver only supports debayering with coefficients and 2D noise filtering, which represent only a subset of the 8M Hawkview ISP which, according to Allwinner V3 datasheet, supports spatial de-noise, chrominance de-noise, zone-based AE/AF/AWB statistics, black level correction, lens shading correction, color correction, and anti-flick detection statistics.

Nevertheless, the currently implemented features were sufficient for Bootlin use case, and they consider adding statistics support in order to implement 3A algorithms (auto-focus, auto-exposition, and auto-white-balance) needed for automatic configuration of scene-specific parameters. Support for these may eventually end up in libcamera open-source library.

Paul also happens to have given a talk about “Advanced Camera Support on Allwinner SoCs with Mainline Linux” at the Embedded Linux Conference 2021 earlier this week, so you may want to check out the presentation slides if you are interested in the details. The ISP-specific part starts on page 35.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX Rockchip RK3588 mini-ITX motherboard
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
18 Comments
oldest
newest
David Willmore
David Willmore
3 years ago

This is very impressive work by bootlin. I am glad to see it being contributed. If other SoCs would start to fall in line, this could be a very useful shift in open source for these chips.

willy
willy
3 years ago

I was about to say the same. It’s fortunate that there are companies like bootlin taking the lead on such painful tasks. Even if they do it in a crowdfunding way to limit the costs, it’s still great that at least someone engages on this road.

Marco
Marco
3 years ago

What I really don’t understand is, since they have to develop a working driver for their customers and pay someone to do it, why Allwinner don’t hire bootlin or someone else with their expertise and publish an open source driver from start. I think that a mainline driver is the best choice in the long term since usually their modified kernels obsolete quite quickly.

Theguyuk
Theguyuk
3 years ago

I agree with you. Companies license stock hardware IP, so why not standard drivers for such hardware. aRM claim there is no demand for such drivers, yet companies produce the drivers mentioned here.

Would you buy a Windows 10,11 motherboard if the company never provided bios or drivers for the motherboard ?

dgp
dgp
3 years ago

AFAIK ARM claimed there was no demand for drivers for *their gpus*. I doubt they give a crap about how a vendor supports junk IP they added to the cores they licensed from ARM as long as they pay for the ARM bits. If they did they wouldn’t have started licensing their stuff to anyone but the NXPs etc of the world in the first place. We don’t know what company paid bootlin to do this. It could be a just for fun effort. Doing these sorts of things looks good for bootlin when scouting for customers that want similar… Read more »

willy
willy
3 years ago

And even if ARM participates it’s very likely that they do not want it to be officially known. They probably make a lot of revenue from SDKs, training etc and do not want their customers to start to think “let’s not buy the new IP and wait for someone else to port it to mainline first, then we’ll save a lot of money”. The current situation makes it much less certain that this day ever happens so it’s easier for them to sell their sauce. It’s quite sad for end users, but most hardware vendors have no care at all… Read more »

dgp
dgp
3 years ago

I think ARM cares a bit about OSS. I wonder if the GPU driver change of heart was because they realised having a driver setup that only really works with Android was hurting them.

I don’t think that means they care about drivers for 3rd party IPs though. I suspect a lot of the reason for ATF existing is to hide closed drivers there and have the OSS part of the driver in the kernel just be a shim. A sort of remix of the shim module scheme nvidia uses.

Theguyuk
Theguyuk
3 years ago

Then why not customers fund bootlin, to write non blob GPU drivers. Free to funders, royalty fee to companies. Make the devils pay 😀😋

dgp
dgp
3 years ago

That’s not how the GPL works. As soon as you distribute binaries you need to start giving people sources too. If not the drivers are no better than the blobs from vendors.

And what you’re saying one of my biggest complaints with OSS; People thinking they decide what other people should do with their time.

“I want X and you should do it for me because you’re an OSS guy right?”. If you personally want opensource GPU drivers then either get on it or pay bootlin or someone to do it for you.

dgp
dgp
3 years ago

>why Allwinner don’t hire bootlin or someone else with their >expertise and publish an open source driver from start. In a lot of cases Allwinner didn’t come up with the IP in the first place. They bought the IP from somewhere and it had a reference Linux driver with it, someone at AW hacked it up to remove the original source of the IP from it etc, and then they shipped that with their 4.x series kernel. The only way to make AW care about mainlining is to get a big customer like google on their books and have that… Read more »

Jon Smirl
3 years ago

This never ending problem is rooted in these fabless SOC companies being run by ‘chipheads’. Chipheads are the hardware engineering managers that run these companies. Their background is “ship and forget”. Get a chip out of the door, address the errata, and move onto the next chip. Software is a necessary nuisance that gets in the way of shipping chips. They put the software people into the chip design teams causing the software people to also practice “ship and forget”. “Ship and forget” makes perfect sense form the hardware view point. And it is totally screwed up from the software… Read more »

Ignas Kiela
Ignas Kiela
3 years ago

Would be nice if their “ship and forget” started shipping to mainline Linux rather than a single fork of their own. A lot more people would be fine with that. I imagine the GPU driver situation could place some limits though on what the chipheads can use though.

Theguyuk
Theguyuk
3 years ago

Would you pay a 1 penny or 2 penny more for the device you buy? ( We know TAX & Revenue is complicated ). If Chip maker sold 500,000 SoC, Chips that would be 500,000 before TAX. So how much software support, could that buy for a SoC ? How much for Armbian to support that SoC ( as long as Armbian is given Document and hardware details..)

Jon Smirl
3 years ago

It’s not a money problem, it is a proliferation and management problem. Once the ‘chiphead’ manager ships the SOC he pulls all of the software people off from it and reassigns them to the next SOC design. The results in close to zero work being done on the code from the first SOC after it ships. Allwinner is an example of a company that is on the path to self destruction over “ship and forget”. They are proliferating new SOC designs far faster than their pitiful software effort can keep up with. The end game of “chiphead” management is Broadcom.… Read more »

geokon
3 years ago

I’m curious about this space, but I’m a bit confused with the wording “spatial de-noise, chrominance de-noise, zone-based AE/AF/AWB statistics, black level correction, lens shading correction, color correction, and anti-flick detection statistics.” These all don’t seem particularly computationally intensive. Is the idea that these chips have dedicated in-hardware circuitry to do these steps? Or that the binary blobs provided by Allwinner were doing this in software? “in order to implement 3A algorithms (auto-focus, auto-exposition, and auto-white-balance) needed for automatic configuration of scene-specific parameters. Support for these may eventually end up in libcamera open-source library.” Is this saying that support will… Read more »

Paul Kocialkowski
Paul Kocialkowski
3 years ago

These all don’t seem particularly computationally intensive. Doing this on frames with high dimensions and high frame rates is actually very intensive and definitely cannot be done in software. This is why the ISP does this in hardware. To give you an idea, you can try https://github.com/cruxopen/openISP which is a purely software implementation and see how long it takes to process one frame 😉 Is this saying that support will just be re-implemented in software? (surely that already exists) The implementations of 3A algorithms are typically hardware-specific because the way statistics are collected and how configuration parameters are applied are… Read more »

geokon
3 years ago

Ah okay, yeah .. I’m not used to thinking in full-res. But yeah, at 1080p@60fps that’s a lot of pixels to crunch. The CPU wouldn’t have time for anything else 🙂

Thanks for the info and the reality check :)). And thank you for your work on this

Boardcon Rockchip RK3588S SBC with 8K, WiFI 6, 4G LTE, NVME SSD, HDMI 2.1...