Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 1 | .. -*- coding: utf-8; mode: rst -*- |
| 2 | |
| 3 | .. _tuner: |
| 4 | |
| 5 | ********************* |
| 6 | Tuners and Modulators |
| 7 | ********************* |
| 8 | |
| 9 | |
| 10 | Tuners |
| 11 | ====== |
| 12 | |
| 13 | Video input devices can have one or more tuners demodulating a RF |
| 14 | signal. Each tuner is associated with one or more video inputs, |
| 15 | depending on the number of RF connectors on the tuner. The ``type`` |
| 16 | field of the respective struct :ref:`v4l2_input <v4l2-input>` |
Mauro Carvalho Chehab | 7347081 | 2016-07-01 13:58:44 -0300 | [diff] [blame] | 17 | returned by the :ref:`VIDIOC_ENUMINPUT` ioctl is |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 18 | set to ``V4L2_INPUT_TYPE_TUNER`` and its ``tuner`` field contains the |
| 19 | index number of the tuner. |
| 20 | |
| 21 | Radio input devices have exactly one tuner with index zero, no video |
| 22 | inputs. |
| 23 | |
| 24 | To query and change tuner properties applications use the |
Mauro Carvalho Chehab | 4e03cb7 | 2016-07-03 10:02:29 -0300 | [diff] [blame] | 25 | :ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>` and |
Mauro Carvalho Chehab | af4a4d0 | 2016-07-01 13:42:29 -0300 | [diff] [blame] | 26 | :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` ioctls, respectively. The |
Mauro Carvalho Chehab | 4e03cb7 | 2016-07-03 10:02:29 -0300 | [diff] [blame] | 27 | struct :ref:`v4l2_tuner <v4l2-tuner>` returned by :ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 28 | also contains signal status information applicable when the tuner of the |
Mauro Carvalho Chehab | 2212ff2 | 2016-07-01 14:33:56 -0300 | [diff] [blame] | 29 | current video or radio input is queried. Note that :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 30 | does not switch the current tuner, when there is more than one at all. |
| 31 | The tuner is solely determined by the current video input. Drivers must |
| 32 | support both ioctls and set the ``V4L2_CAP_TUNER`` flag in the struct |
| 33 | :ref:`v4l2_capability <v4l2-capability>` returned by the |
Mauro Carvalho Chehab | 7347081 | 2016-07-01 13:58:44 -0300 | [diff] [blame] | 34 | :ref:`VIDIOC_QUERYCAP` ioctl when the device has |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 35 | one or more tuners. |
| 36 | |
| 37 | |
| 38 | Modulators |
| 39 | ========== |
| 40 | |
| 41 | Video output devices can have one or more modulators, uh, modulating a |
| 42 | video signal for radiation or connection to the antenna input of a TV |
| 43 | set or video recorder. Each modulator is associated with one or more |
| 44 | video outputs, depending on the number of RF connectors on the |
| 45 | modulator. The ``type`` field of the respective struct |
| 46 | :ref:`v4l2_output <v4l2-output>` returned by the |
Mauro Carvalho Chehab | 7347081 | 2016-07-01 13:58:44 -0300 | [diff] [blame] | 47 | :ref:`VIDIOC_ENUMOUTPUT` ioctl is set to |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 48 | ``V4L2_OUTPUT_TYPE_MODULATOR`` and its ``modulator`` field contains the |
| 49 | index number of the modulator. |
| 50 | |
| 51 | Radio output devices have exactly one modulator with index zero, no |
| 52 | video outputs. |
| 53 | |
| 54 | A video or radio device cannot support both a tuner and a modulator. Two |
| 55 | separate device nodes will have to be used for such hardware, one that |
| 56 | supports the tuner functionality and one that supports the modulator |
| 57 | functionality. The reason is a limitation with the |
Mauro Carvalho Chehab | af4a4d0 | 2016-07-01 13:42:29 -0300 | [diff] [blame] | 58 | :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl where you |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 59 | cannot specify whether the frequency is for a tuner or a modulator. |
| 60 | |
| 61 | To query and change modulator properties applications use the |
Mauro Carvalho Chehab | 4e03cb7 | 2016-07-03 10:02:29 -0300 | [diff] [blame] | 62 | :ref:`VIDIOC_G_MODULATOR <VIDIOC_G_MODULATOR>` and |
Mauro Carvalho Chehab | af4a4d0 | 2016-07-01 13:42:29 -0300 | [diff] [blame] | 63 | :ref:`VIDIOC_S_MODULATOR <VIDIOC_G_MODULATOR>` ioctl. Note that |
Mauro Carvalho Chehab | 2212ff2 | 2016-07-01 14:33:56 -0300 | [diff] [blame] | 64 | :ref:`VIDIOC_S_MODULATOR <VIDIOC_G_MODULATOR>` does not switch the current modulator, when there |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 65 | is more than one at all. The modulator is solely determined by the |
| 66 | current video output. Drivers must support both ioctls and set the |
| 67 | ``V4L2_CAP_MODULATOR`` flag in the struct |
| 68 | :ref:`v4l2_capability <v4l2-capability>` returned by the |
Mauro Carvalho Chehab | 7347081 | 2016-07-01 13:58:44 -0300 | [diff] [blame] | 69 | :ref:`VIDIOC_QUERYCAP` ioctl when the device has |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 70 | one or more modulators. |
| 71 | |
| 72 | |
| 73 | Radio Frequency |
| 74 | =============== |
| 75 | |
| 76 | To get and set the tuner or modulator radio frequency applications use |
Mauro Carvalho Chehab | 4e03cb7 | 2016-07-03 10:02:29 -0300 | [diff] [blame] | 77 | the :ref:`VIDIOC_G_FREQUENCY <VIDIOC_G_FREQUENCY>` and |
Mauro Carvalho Chehab | af4a4d0 | 2016-07-01 13:42:29 -0300 | [diff] [blame] | 78 | :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl which both take |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 79 | a pointer to a struct :ref:`v4l2_frequency <v4l2-frequency>`. These |
| 80 | ioctls are used for TV and radio devices alike. Drivers must support |
| 81 | both ioctls when the tuner or modulator ioctls are supported, or when |
| 82 | the device is a radio device. |
| 83 | |
| 84 | |
| 85 | .. ------------------------------------------------------------------------------ |
| 86 | .. This file was automatically converted from DocBook-XML with the dbxml |
| 87 | .. library (https://github.com/return42/sphkerneldoc). The origin XML comes |
| 88 | .. from the linux kernel, refer to: |
| 89 | .. |
| 90 | .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook |
| 91 | .. ------------------------------------------------------------------------------ |