^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) ===================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) Building support for a media device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) ===================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) The first step is to download the Kernel's source code, either via a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) distribution-specific source file or via the Kernel's main git tree\ [1]_.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Please notice, however, that, if:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) - you're a braveheart and want to experiment with new stuff;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) - if you want to report a bug;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) - if you're developing new patches
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) you should use the main media development tree ``master`` branch:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) https://git.linuxtv.org/media_tree.git/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) In this case, you may find some useful information at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) `LinuxTv wiki pages <https://linuxtv.org/wiki>`_:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) https://linuxtv.org/wiki/index.php/How_to_Obtain,_Build_and_Install_V4L-DVB_Device_Drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) .. [1] The upstream Linux Kernel development tree is located at
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) https://git.kernel.org/pub/scm/li nux/kernel/git/torvalds/linux.git/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) Configuring the Linux Kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) ============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) You can access a menu of Kernel building options with::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) $ make menuconfig
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) Then, select all desired options and exit it, saving the configuration.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) The changed configuration will be at the ``.config`` file. It would
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) look like::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) # CONFIG_RC_CORE is not set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) # CONFIG_CEC_CORE is not set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) CONFIG_MEDIA_SUPPORT=m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) CONFIG_MEDIA_SUPPORT_FILTER=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) The media subsystem is controlled by those menu configuration options::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) Device Drivers --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) <M> Remote Controller support --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) [ ] HDMI CEC RC integration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) [ ] Enable CEC error injection support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) [*] HDMI CEC drivers --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) <*> Multimedia support --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) The ``Remote Controller support`` option enables the core support for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) remote controllers\ [2]_.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) The ``HDMI CEC RC integration`` option enables integration of HDMI CEC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) with Linux, allowing to receive data via HDMI CEC as if it were produced
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) by a remote controller directly connected to the machine.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) The ``HDMI CEC drivers`` option allow selecting platform and USB drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) that receives and/or transmits CEC codes via HDMI interfaces\ [3]_.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) The last option (``Multimedia support``) enables support for cameras,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) audio/video grabbers and TV.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) The media subsystem support can either be built together with the main
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) Kernel or as a module. For most use cases, it is preferred to have it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) built as modules.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) .. note::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) Instead of using a menu, the Kernel provides a script with allows
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) enabling configuration options directly. To enable media support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) and remote controller support using Kernel modules, you could use::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) $ scripts/config -m RC_CORE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) $ scripts/config -m MEDIA_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) .. [2] ``Remote Controller support`` should also be enabled if you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) want to use some TV card drivers that may depend on the remote
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) controller core support.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) .. [3] Please notice that the DRM subsystem also have drivers for GPUs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) that use the media HDMI CEC support.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) Those GPU-specific drivers are selected via the ``Graphics support``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) menu, under ``Device Drivers``.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) When a GPU driver supports HDMI CEC, it will automatically
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) enable the CEC core support at the media subsystem.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) Media dependencies
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) ------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) It should be noticed that enabling the above from a clean config is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) usually not enough. The media subsystem depends on several other Linux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) core support in order to work.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) For example, most media devices use a serial communication bus in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) order to talk with some peripherals. Such bus is called I²C
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) (Inter-Integrated Circuit). In order to be able to build support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) for such hardware, the I²C bus support should be enabled, either via
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) menu or with::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) ./scripts/config -m I2C
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) Another example: the remote controller core requires support for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) input devices, with can be enabled with::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) ./scripts/config -m INPUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) Other core functionality may also be needed (like PCI and/or USB support),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) depending on the specific driver(s) you would like to enable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) Enabling Remote Controller Support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) ----------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) The remote controller menu allows selecting drivers for specific devices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) It's menu looks like this::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) --- Remote Controller support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) <M> Compile Remote Controller keymap modules
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) [*] LIRC user interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) [*] Support for eBPF programs attached to lirc devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) [*] Remote controller decoders --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) [*] Remote Controller devices --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) The ``Compile Remote Controller keymap modules`` option creates key maps for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) several popular remote controllers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) The ``LIRC user interface`` option adds enhanced functionality when using the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) ``lirc`` program, by enabling an API that allows userspace to receive raw data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) from remote controllers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) The ``Support for eBPF programs attached to lirc devices`` option allows
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) the usage of special programs (called eBPF) that would allow aplications
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) to add extra remote controller decoding functionality to the Linux Kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) The ``Remote controller decoders`` option allows selecting the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) protocols that will be recognized by the Linux Kernel. Except if you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) want to disable some specific decoder, it is suggested to keep all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) sub-options enabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) The ``Remote Controller devices`` allows you to select the drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) that would be needed to support your device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) The same configuration can also be set via the ``script/config``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) script. So, for instance, in order to support the ITE remote controller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) driver (found on Intel NUCs and on some ASUS x86 desktops), you could do::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) $ scripts/config -e INPUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) $ scripts/config -e ACPI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) $ scripts/config -e MODULES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) $ scripts/config -m RC_CORE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) $ scripts/config -e RC_DEVICES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) $ scripts/config -e RC_DECODERS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) $ scripts/config -m IR_RC5_DECODER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) $ scripts/config -m IR_ITE_CIR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) Enabling HDMI CEC Support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) -------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) The HDMI CEC support is set automatically when a driver requires it. So,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) all you need to do is to enable support either for a graphics card
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) that needs it or by one of the existing HDMI drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) The HDMI-specific drivers are available at the ``HDMI CEC drivers``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) menu\ [4]_::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) --- HDMI CEC drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) < > ChromeOS EC CEC driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) < > Amlogic Meson AO CEC driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) < > Amlogic Meson G12A AO CEC driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) < > Generic GPIO-based CEC driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) < > Samsung S5P CEC driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) < > STMicroelectronics STiH4xx HDMI CEC driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) < > STMicroelectronics STM32 HDMI CEC driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) < > Tegra HDMI CEC driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) < > SECO Boards HDMI CEC driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) [ ] SECO Boards IR RC5 support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) < > Pulse Eight HDMI CEC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) < > RainShadow Tech HDMI CEC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) .. [4] The above contents is just an example. The actual options for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) HDMI devices depends on the system's architecture and may vary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) on new Kernels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) Enabling Media Support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) ----------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) The Media menu has a lot more options than the remote controller menu.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) Once selected, you should see the following options::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) --- Media support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) [ ] Filter media drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) [*] Autoselect ancillary drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) Media device types --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) Media core support --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) Video4Linux options --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) Media controller options --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) Digital TV options --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) HDMI CEC options --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) Media drivers --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) Media ancillary drivers --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) Except if you know exactly what you're doing, or if you want to build
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) a driver for a SoC platform, it is strongly recommended to keep the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) ``Autoselect ancillary drivers`` option turned on, as it will auto-select
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) the needed I²C ancillary drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) There are now two ways to select media device drivers, as described
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) ``Filter media drivers`` menu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) This menu is meant to easy setup for PC and Laptop hardware. It works
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) by letting the user to specify what kind of media drivers are desired,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) with those options::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) [ ] Cameras and video grabbers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) [ ] Analog TV
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) [ ] Digital TV
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) [ ] AM/FM radio receivers/transmitters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) [ ] Software defined radio
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) [ ] Platform-specific devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) [ ] Test drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) So, if you want to add support to a camera or video grabber only,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) select just the first option. Multiple options are allowed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) Once the options on this menu are selected, the building system will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) auto-select the needed core drivers in order to support the selected
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) functionality.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) .. note::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) Most TV cards are hybrid: they support both Analog TV and Digital TV.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) If you have an hybrid card, you may need to enable both ``Analog TV``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) and ``Digital TV`` at the menu.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) When using this option, the defaults for the media support core
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) functionality are usually good enough to provide the basic functionality
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) for the driver. Yet, you could manually enable some desired extra (optional)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) functionality using the settings under each of the following
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) ``Media support`` sub-menus::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) Media core support --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) Video4Linux options --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) Media controller options --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) Digital TV options --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) HDMI CEC options --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) Once you select the desired filters, the drivers that matches the filtering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) criteria will be available at the ``Media support->Media drivers`` sub-menu.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) ``Media Core Support`` menu without filtering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) If you disable the ``Filter media drivers`` menu, all drivers available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) for your system whose dependencies are met should be shown at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) ``Media drivers`` menu.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) Please notice, however, that you should first ensure that the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) ``Media Core Support`` menu has all the core functionality your drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) would need, as otherwise the corresponding device drivers won't be shown.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) Example
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) -------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) In order to enable modular support for one of the boards listed on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) :doc:`this table <cx231xx-cardlist>`, with modular media core modules, the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) ``.config`` file should contain those lines::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) CONFIG_MODULES=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) CONFIG_USB=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) CONFIG_I2C=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) CONFIG_INPUT=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) CONFIG_RC_CORE=m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) CONFIG_MEDIA_SUPPORT=m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) CONFIG_MEDIA_SUPPORT_FILTER=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) CONFIG_MEDIA_USB_SUPPORT=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) CONFIG_VIDEO_CX231XX=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) CONFIG_VIDEO_CX231XX_DVB=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) Building and installing a new Kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) ====================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) Once the ``.config`` file has everything needed, all it takes to build
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) is to run the ``make`` command::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) $ make
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) And then install the new Kernel and its modules::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) $ sudo make modules_install
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) $ sudo make install
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) Building just the new media drivers and core
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) ============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) Running a new development Kernel from the development tree is usually risky,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) because it may have experimental changes that may have bugs. So, there are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) some ways to build just the new drivers, using alternative trees.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) There is the `Linux Kernel backports project
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) <https://backports.wiki.kernel.org/index.php/Main_Page>`_, with contains
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) newer drivers meant to be compiled against stable Kernels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) The LinuxTV developers, with are responsible for maintaining the media
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) subsystem also maintains a backport tree, with just the media drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) daily updated from the newest kernel. Such tree is available at:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) https://git.linuxtv.org/media_build.git/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) It should be noticed that, while it should be relatively safe to use the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) ``media_build`` tree for testing purposes, there are not warranties that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) it would work (or even build) on a random Kernel. This tree is maintained
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) using a "best-efforts" principle, as time permits us to fix issues there.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) If you notice anything wrong on it, feel free to submit patches at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) Linux media subsystem's mailing list: media@vger.kernel.org. Please
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) add ``[PATCH media-build]`` at the e-mail's subject if you submit a new
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) patch for the media-build.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) Before using it, you should run::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) $ ./build
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) .. note::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 1) you may need to run it twice if the ``media-build`` tree gets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) updated;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 2) you may need to do a ``make distclean`` if you had built it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) in the past for a different Kernel version than the one you're
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) currently using;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) 3) by default, it will use the same config options for media as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) the ones defined on the Kernel you're running.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) In order to select different drivers or different config options,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) use::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) $ make menuconfig
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) Then, you can build and install the new drivers::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) $ make && sudo make install
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) This will override the previous media drivers that your Kernel were
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) using.