1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2
3.. _media-controller-intro:
4
5Introduction
6============
7
8Media devices increasingly handle multiple related functions. Many USB
9cameras include microphones, video capture hardware can also output
10video, or SoC camera interfaces also perform memory-to-memory operations
11similar to video codecs.
12
13Independent functions, even when implemented in the same hardware, can
14be modelled as separate devices. A USB camera with a microphone will be
15presented to userspace applications as V4L2 and ALSA capture devices.
16The devices' relationships (when using a webcam, end-users shouldn't
17have to manually select the associated USB microphone), while not made
18available directly to applications by the drivers, can usually be
19retrieved from sysfs.
20
21With more and more advanced SoC devices being introduced, the current
22approach will not scale. Device topologies are getting increasingly
23complex and can't always be represented by a tree structure. Hardware
24blocks are shared between different functions, creating dependencies
25between seemingly unrelated devices.
26
27Kernel abstraction APIs such as V4L2 and ALSA provide means for
28applications to access hardware parameters. As newer hardware expose an
29increasingly high number of those parameters, drivers need to guess what
30applications really require based on limited information, thereby
31implementing policies that belong to userspace.
32
33The media controller API aims at solving those problems.
34