tuner.rst 3.3 KB

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