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