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