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