question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Libcamera stack support (features, APIs and discussions)

See original GitHub issue

It’s been a while that the Raspicam camera stack has gone legacy. This means means the V4L2 drivers are not in place by default in the most recent versions of the Raspbian Operating System. In order to make our VideoDevice binding work, the legacy support must be set using raspi-config on the Raspberry PI. The complete overview on the camera support can be found here.

The new stack is called libcamera and is turned on by default in the OS. More info about libcamera:

The Raspberry foundation also published a new set of applications/tools replacing the legacy raspistill/raspivid. The source code can be found at the following link: https://github.com/raspberrypi/libcamera-apps/tree/main/apps

The libcamera documentation also talks about a compatibility layer, but it is unclear whether and how it can be activated to make applications using V4L2 work without turning on the legacy Raspicam model. The most interesting links on this subject are here:

In any case, it looks like libcamera is the future and it may be worth to build a new binding to fully exploit the potentials of the modern cameras connected to the Raspberry PI and similar devices.

Unfortunately, according the official libcamera account, they still do not provide a native C language API (but only C++), meaning that it makes far more difficult to create the interoperability code to provide a .NET binding. This would force the need to ship the binding with a certain amount of native code wrapping the official C++ interface. In turns this implies the need to ship nuget packages with different assemblies for each CPU architecture.

As a reminder, C++ does not provide a standard binary contract. This translates in the impossibility to guarantee the binary interop across different C++ compilers and often across different versions of the same C++ compiler.

I created this thread for a few reasons:

  • Telling the community why the current VideoDevice binding is not working (unless you manually turn on the legacy support)
  • Getting fresh ideas on the potential implementation of the libcamera binding (no promises)
  • Seeing who is interested in working/helping on this implementation
  • Eventually discussing the API to expose in the binding

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:47 (28 by maintainers)

github_iconTop GitHub Comments

2reactions
kbinghamcommented, Jun 18, 2022

https://bugs.libcamera.org/show_bug.cgi?id=133 added to highlight that this needs development.

1reaction
kbinghamcommented, Jun 18, 2022

I don’t know how you’re measuring performances, or what you’re facing. But you should certainly avoid any format conversions in software, and let the RPi use it’s hardware ISP… But it seems we might have to fix the format configuration for that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

STICKY: libcamera - open source camera stack - Page 7
A reprocessing API is on our roadmap, and will allow pushing captured raw Bayer images through the ISP. I'm afraid I can't provide...
Read more >
Camera software - Raspberry Pi Documentation
libcamera is a new software library aimed at supporting complex camera systems directly from the Linux operating system. In the case of the...
Read more >
Frequently Asked Questions
What is libcamera? libcamera is an open source camera stack for many platforms with a core userspace library, and support from the Linux...
Read more >
Libcamera v0.0.1
Imagine there is a time when libcamera supports all kinds of Soc ISPs (rockchip, ... For Linux, if your hardware was supported, a...
Read more >
Giving Linux a Camera Stack: libcamera's 3 Years Journey ...
Giving Linux a Camera Stack : libcamera's 3 Years Journey and Exciting Future - Laurent Pinchart, Ideas on Board.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found