tuner.rst 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2. .. c:namespace:: V4L
  3. .. _tuner:
  4. *********************
  5. Tuners and Modulators
  6. *********************
  7. Tuners
  8. ======
  9. Video input devices can have one or more tuners demodulating a RF
  10. signal. Each tuner is associated with one or more video inputs,
  11. depending on the number of RF connectors on the tuner. The ``type``
  12. field of the respective struct :c:type:`v4l2_input`
  13. returned by the :ref:`VIDIOC_ENUMINPUT` ioctl is
  14. set to ``V4L2_INPUT_TYPE_TUNER`` and its ``tuner`` field contains the
  15. index number of the tuner.
  16. Radio input devices have exactly one tuner with index zero, no video
  17. inputs.
  18. To query and change tuner properties applications use the
  19. :ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>` and
  20. :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` ioctls, respectively. The
  21. struct :c:type:`v4l2_tuner` returned by :ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>`
  22. also contains signal status information applicable when the tuner of the
  23. current video or radio input is queried.
  24. .. note::
  25. :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` does not switch the
  26. current tuner, when there is more than one. The tuner is solely
  27. determined by the current video input. Drivers must support both ioctls
  28. and set the ``V4L2_CAP_TUNER`` flag in the struct :c:type:`v4l2_capability`
  29. returned by the :ref:`VIDIOC_QUERYCAP` ioctl when the
  30. device has one or more tuners.
  31. Modulators
  32. ==========
  33. Video output devices can have one or more modulators, that modulate a
  34. video signal for radiation or connection to the antenna input of a TV
  35. set or video recorder. Each modulator is associated with one or more
  36. video outputs, depending on the number of RF connectors on the
  37. modulator. The ``type`` field of the respective struct
  38. :c:type:`v4l2_output` returned by the
  39. :ref:`VIDIOC_ENUMOUTPUT` ioctl is set to
  40. ``V4L2_OUTPUT_TYPE_MODULATOR`` and its ``modulator`` field contains the
  41. index number of the modulator.
  42. Radio output devices have exactly one modulator with index zero, no
  43. video outputs.
  44. A video or radio device cannot support both a tuner and a modulator. Two
  45. separate device nodes will have to be used for such hardware, one that
  46. supports the tuner functionality and one that supports the modulator
  47. functionality. The reason is a limitation with the
  48. :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl where you
  49. cannot specify whether the frequency is for a tuner or a modulator.
  50. To query and change modulator properties applications use the
  51. :ref:`VIDIOC_G_MODULATOR <VIDIOC_G_MODULATOR>` and
  52. :ref:`VIDIOC_S_MODULATOR <VIDIOC_G_MODULATOR>` ioctl. Note that
  53. :ref:`VIDIOC_S_MODULATOR <VIDIOC_G_MODULATOR>` does not switch the current modulator, when there
  54. is more than one at all. The modulator is solely determined by the
  55. current video output. Drivers must support both ioctls and set the
  56. ``V4L2_CAP_MODULATOR`` flag in the struct
  57. :c:type:`v4l2_capability` returned by the
  58. :ref:`VIDIOC_QUERYCAP` ioctl when the device has
  59. one or more modulators.
  60. Radio Frequency
  61. ===============
  62. To get and set the tuner or modulator radio frequency applications use
  63. the :ref:`VIDIOC_G_FREQUENCY <VIDIOC_G_FREQUENCY>` and
  64. :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl which both take
  65. a pointer to a struct :c:type:`v4l2_frequency`. These
  66. ioctls are used for TV and radio devices alike. Drivers must support
  67. both ioctls when the tuner or modulator ioctls are supported, or when
  68. the device is a radio device.