Complex Cameras (were) complex Jacopo Mondi FOSDEM 2019 Jacopo - - PowerPoint PPT Presentation

complex cameras were complex
SMART_READER_LITE
LIVE PREVIEW

Complex Cameras (were) complex Jacopo Mondi FOSDEM 2019 Jacopo - - PowerPoint PPT Presentation

Complex Cameras (were) complex Jacopo Mondi FOSDEM 2019 Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (1/ 23) Hello, Im Jacopo Embedded Linux software engineer I mostly work on integrating cameras and multimedia devices


slide-1
SLIDE 1

Complex Cameras (were) complex

Jacopo Mondi FOSDEM 2019

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (1/ 23)

slide-2
SLIDE 2

Hello, I’m Jacopo Embedded Linux software engineer I mostly work on integrating cameras and multimedia devices jacopo@jmondi.org irc: jmondi freenode.net

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (1/ 23)

slide-3
SLIDE 3

Motivations

Rapidly increasing complexity of image capture process is moving from the embedded and mobile space to the more canonical personal computing space (say, laptops and tablets). Are Linux systems ready for this?

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (2/ 23)

slide-4
SLIDE 4

Motivations

Rapidly increasing complexity of image capture process is moving from the embedded and mobile space to the more canonical personal computing space (say... laptops). Are Linux systems ready for this? No they’re not

(I wouldn’t be giving this presentation otherwise :p ) Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (3/ 23)

slide-5
SLIDE 5

Image Capture

Digital imaging is a computational expensive process! complexity in the acquisition de-bayering, enanching, pixel encoding complexity in quality tuning 3A, calibrations, general tuning

  • big- buffers

1080p in YUYV format is 4MB of data

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (4/ 23)

slide-6
SLIDE 6

Smarter ISPs

Today: Smarter ISPs

SoC (fat) CPUs ISP Sensor RAM DMA I2c control image data

CSI-2

(fat) CPUs

CSI-2

DRM

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (5/ 23)

slide-7
SLIDE 7

Smart(er) ISPs

Image Signal Processor system peripheral that operates on digital images composed by configurable processing blocks

DMA and memory interfacing resizing, scaling, cropping, composing format conversion advanced image processing (3A and reprocessing)

very efficient: high speed interconnections, high

  • perating frequency

the design is very platform specific

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (6/ 23)

slide-8
SLIDE 8

Smart sensors

10 years ago: smart sensors

SoC (not so fat) CPU

scaler

Sensor RAM DMA I2c control image data

parallel

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (7/ 23)

slide-9
SLIDE 9

Media Controller

The V4L2 APIs are designed for ’simple’ device The single device node abstraction

i2c receiver sensor HARDWARE pixel data i2c messages KERNEL receiver driver sensor driver V4L2 /dev/video0 system memory

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (8/ 23)

slide-10
SLIDE 10

Media Controller

Support for more complex devices, as ISPs the media controller exposes ISP processing blocks to userspace

i2c receiver sensor HARDWARE pixel data i2c messages resizer converter formatter /dev/v4l-subdev-1 /dev/video0 /dev/v4l-subdev-2 /dev/v4l-subdev-4 /dev/v4l-subdev-5 system memory receiver driver isp driver pixel formatter KERNEL

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (9/ 23)

slide-11
SLIDE 11

Media Controller

Nice, but.... the system boots in unusable state applications are requested to know a lot of details

  • n the underlying hardware

triggering capture operations requires precise setup of the whole pipeline

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (10/ 23)

slide-12
SLIDE 12

Media Controller - now on laptops!

Nice, but.... the system boots in unusable state applications are requested to know a lot of details

  • n the underlying hardware

triggering capture operations requires setup of the whole pipeline This is (sort of) acceptable for embedded systems Is it for consumer devices?

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (11/ 23)

slide-13
SLIDE 13

Media Controller - now on laptops!

Until today, cameras in laptop have usually been USB cameras smart sensor: they talk USB! fit well in the single device node abstraction well supported by libv4l2

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (12/ 23)

slide-14
SLIDE 14

Media Controller - now on laptops!

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (13/ 23)

slide-15
SLIDE 15

Media Controller - now on laptops!

”Re: Webcams not recognized on a Dell Latitude 5285 laptop”

https://www.spinics.net/lists/linux-media/msg131388.html

This laptop embeds one of these new ”complex” cameras from Intel. They requires IPU3 driver. Though, unlike traditional webcam, you need special userspace to use it (there is no embedded firmware to manage focus, whitebalance, etc, userspace code need to read the stats and manage that). As of now, there is no good plan on how to support this in userspace.

  • N. Dufresne, April 1st 2018

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (14/ 23)

slide-16
SLIDE 16

Media Controller - now on laptops!

Intel IPU3 Intel is now shipping processors with powerful ISPs (some) KabyLake and (some) SkyLake platforms have IPU3 ISP patches on linux-media and now in staging to mainline: yey!

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (15/ 23)

slide-17
SLIDE 17

Media Controller - now on laptops!

(simplified) IPU3 media graph

CSI-2 CSI-2 capture media0 media1 input params

viewfinder

  • utput

stat imgu

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (16/ 23)

slide-18
SLIDE 18

Media Controller - now on laptops!

(simplified) IPU3 media graph

CSI-2 CSI-2 capture media0 media1 input params

viewfinder

  • utput

stat imgu RAW

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (17/ 23)

slide-19
SLIDE 19

Media Controller - now on laptops!

(simplified) IPU3 media graph

CSI-2 CSI-2 capture media0 media1 input params

viewfinder

  • utput

stat imgu RAW RAW

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (18/ 23)

slide-20
SLIDE 20

Media Controller - now on laptops!

(simplified) IPU3 media graph

CSI-2 CSI-2 capture media0 media1 input params

viewfinder

  • utput

stat imgu RAW RAW

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (19/ 23)

slide-21
SLIDE 21

Media Controller - now on laptops!

(simplified) IPU3 media graph

CSI-2 CSI-2 capture media0 media1 input params

viewfinder

  • utput

stat imgu RAW

RAW

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (20/ 23)

slide-22
SLIDE 22

Media Controller - now on laptops!

(simplified) IPU3 media graph

CSI-2 CSI-2 capture media0 media1 input params

viewfinder

  • utput

stat imgu RAW

RAW

YUV

YUV meta

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (21/ 23)

slide-23
SLIDE 23

Media Controller - now on laptops!

(simplified) IPU3 media graph

CSI-2 CSI-2 capture media0 media1 input params

viewfinder

  • utput

stat imgu RAW 3A - tuning meta

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (22/ 23)

slide-24
SLIDE 24

Complex Cameras are debated

Meeting notes on the Tokyo complex cameras workshop

https://linuxtv.org/news.php?entry=2018-07-13.mchehab Complex Cameras on Linux Mauro Carvalho Chehab, Samsung

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (23/ 23)

slide-25
SLIDE 25

Libcamera!

Libcamera is a complete user space camera stack Abstract away from application all interfacing with V4L2 and Media-Controller Aims to be compatible with Linux V4L2-based applications, Android and ChromeOs Why Embedded Cameras are Difficult, and How to Make Them Easy Laurent Pinchart, Ideas on Board

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (24/ 23)

slide-26
SLIDE 26

Libcamera!

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (25/ 23)

slide-27
SLIDE 27

Libcamera!

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (26/ 23)

slide-28
SLIDE 28

Libcamera: how do we do that

git://linuxtv.org/libcamera.git mail based development: mailing list + patchwork we use Meson and Ninja, and they’re great we enforce a coding style: OCD vs C++ we love picky reviews! we (try to) be serious at documentation and testing

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (27/ 23)

slide-29
SLIDE 29

Libcamera: where are we

we support UVC and Intel IPU3 we can list (hot-pluggable) cameras we can capture frames !

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (28/ 23)

slide-30
SLIDE 30

Libcamera: where do we want to go

support more ISPs (-all- ISPs :) support Android HALv3 with per-frame control have third-party contributions from vendors

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (29/ 23)

slide-31
SLIDE 31

Libcamera!

Please join! read the doc: http://libcamera.org/docs.htm read patches: git://linuxtv.org/libcamera.git have a chat: #libcamera on freenode we welcome inputs from anyone working with cameras!

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (30/ 23)

slide-32
SLIDE 32

Complex Cameras

Thanks! Questions?

Jacopo Mondi - FOSDEM 2019 Updates from libcamera project (31/ 23)