doc-rst: linux_tv: Replace reference names to match ioctls
[deliverable/linux.git] / Documentation / linux_tv / media / v4l / tuner.rst
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>`
17 returned by the :ref:`VIDIOC_ENUMINPUT <VIDIOC_ENUMINPUT>` ioctl is
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
25 :ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>` and
26 :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` ioctls, respectively. The
27 struct :ref:`v4l2_tuner <v4l2-tuner>` returned by ``VIDIOC_G_TUNER``
28 also contains signal status information applicable when the tuner of the
29 current video or radio input is queried. Note that ``VIDIOC_S_TUNER``
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
34 :ref:`VIDIOC_QUERYCAP <VIDIOC_QUERYCAP>` ioctl when the device has
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
47 :ref:`VIDIOC_ENUMOUTPUT <VIDIOC_ENUMOUTPUT>` ioctl is set to
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
58 :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl where you
59 cannot specify whether the frequency is for a tuner or a modulator.
60
61 To query and change modulator properties applications use the
62 :ref:`VIDIOC_G_MODULATOR <VIDIOC_G_MODULATOR>` and
63 :ref:`VIDIOC_S_MODULATOR <VIDIOC_G_MODULATOR>` ioctl. Note that
64 ``VIDIOC_S_MODULATOR`` does not switch the current modulator, when there
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
69 :ref:`VIDIOC_QUERYCAP <VIDIOC_QUERYCAP>` ioctl when the device has
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
77 the :ref:`VIDIOC_G_FREQUENCY <VIDIOC_G_FREQUENCY>` and
78 :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl which both take
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 .. ------------------------------------------------------------------------------
This page took 0.031705 seconds and 5 git commands to generate.