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`` |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 16 | field of the respective struct :c:type:`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 | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 27 | struct :c:type:`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 | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 29 | current video or radio input is queried. |
| 30 | |
Mauro Carvalho Chehab | b6b6e67 | 2016-08-15 17:49:50 -0300 | [diff] [blame] | 31 | .. note:: |
| 32 | |
| 33 | :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` does not switch the |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 34 | current tuner, when there is more than one at all. The tuner is solely |
| 35 | determined by the current video input. Drivers must support both ioctls |
Mauro Carvalho Chehab | 56683d7 | 2016-09-08 06:41:26 -0300 | [diff] [blame] | 36 | and set the ``V4L2_CAP_TUNER`` flag in the struct :c:type:`v4l2_capability` |
| 37 | returned by the :ref:`VIDIOC_QUERYCAP` ioctl when the |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 38 | device has one or more tuners. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 39 | |
| 40 | |
| 41 | Modulators |
| 42 | ========== |
| 43 | |
| 44 | Video output devices can have one or more modulators, uh, modulating a |
| 45 | video signal for radiation or connection to the antenna input of a TV |
| 46 | set or video recorder. Each modulator is associated with one or more |
| 47 | video outputs, depending on the number of RF connectors on the |
| 48 | modulator. The ``type`` field of the respective struct |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 49 | :c:type:`v4l2_output` returned by the |
Mauro Carvalho Chehab | 7347081 | 2016-07-01 13:58:44 -0300 | [diff] [blame] | 50 | :ref:`VIDIOC_ENUMOUTPUT` ioctl is set to |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 51 | ``V4L2_OUTPUT_TYPE_MODULATOR`` and its ``modulator`` field contains the |
| 52 | index number of the modulator. |
| 53 | |
| 54 | Radio output devices have exactly one modulator with index zero, no |
| 55 | video outputs. |
| 56 | |
| 57 | A video or radio device cannot support both a tuner and a modulator. Two |
| 58 | separate device nodes will have to be used for such hardware, one that |
| 59 | supports the tuner functionality and one that supports the modulator |
| 60 | functionality. The reason is a limitation with the |
Mauro Carvalho Chehab | af4a4d0 | 2016-07-01 13:42:29 -0300 | [diff] [blame] | 61 | :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl where you |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 62 | cannot specify whether the frequency is for a tuner or a modulator. |
| 63 | |
| 64 | To query and change modulator properties applications use the |
Mauro Carvalho Chehab | 4e03cb7 | 2016-07-03 10:02:29 -0300 | [diff] [blame] | 65 | :ref:`VIDIOC_G_MODULATOR <VIDIOC_G_MODULATOR>` and |
Mauro Carvalho Chehab | af4a4d0 | 2016-07-01 13:42:29 -0300 | [diff] [blame] | 66 | :ref:`VIDIOC_S_MODULATOR <VIDIOC_G_MODULATOR>` ioctl. Note that |
Mauro Carvalho Chehab | 2212ff2 | 2016-07-01 14:33:56 -0300 | [diff] [blame] | 67 | :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] | 68 | is more than one at all. The modulator is solely determined by the |
| 69 | current video output. Drivers must support both ioctls and set the |
| 70 | ``V4L2_CAP_MODULATOR`` flag in the struct |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 71 | :c:type:`v4l2_capability` returned by the |
Mauro Carvalho Chehab | 7347081 | 2016-07-01 13:58:44 -0300 | [diff] [blame] | 72 | :ref:`VIDIOC_QUERYCAP` ioctl when the device has |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 73 | one or more modulators. |
| 74 | |
| 75 | |
| 76 | Radio Frequency |
| 77 | =============== |
| 78 | |
| 79 | 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] | 80 | the :ref:`VIDIOC_G_FREQUENCY <VIDIOC_G_FREQUENCY>` and |
Mauro Carvalho Chehab | af4a4d0 | 2016-07-01 13:42:29 -0300 | [diff] [blame] | 81 | :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl which both take |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 82 | a pointer to a struct :c:type:`v4l2_frequency`. These |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 83 | ioctls are used for TV and radio devices alike. Drivers must support |
| 84 | both ioctls when the tuner or modulator ioctls are supported, or when |
| 85 | the device is a radio device. |