2016-06-30 15:18:56 +02:00
.. -*- coding: utf-8; mode: rst -*-
.. _tuner:
***** ***** ***** ***** *
Tuners and Modulators
***** ***** ***** ***** *
Tuners
======
Video input devices can have one or more tuners demodulating a RF
signal. Each tuner is associated with one or more video inputs,
depending on the number of RF connectors on the tuner. The `` type ``
2016-08-29 17:37:59 -03:00
field of the respective struct :c:type: `v4l2_input`
2016-07-01 13:58:44 -03:00
returned by the :ref: `VIDIOC_ENUMINPUT` ioctl is
2016-06-30 15:18:56 +02:00
set to `` V4L2_INPUT_TYPE_TUNER `` and its `` tuner `` field contains the
index number of the tuner.
Radio input devices have exactly one tuner with index zero, no video
inputs.
To query and change tuner properties applications use the
2016-07-03 10:02:29 -03:00
:ref: `VIDIOC_G_TUNER <VIDIOC_G_TUNER>` and
2016-07-01 13:42:29 -03:00
:ref: `VIDIOC_S_TUNER <VIDIOC_G_TUNER>` ioctls, respectively. The
2016-08-29 17:37:59 -03:00
struct :c:type: `v4l2_tuner` returned by :ref: `VIDIOC_G_TUNER <VIDIOC_G_TUNER>`
2016-06-30 15:18:56 +02:00
also contains signal status information applicable when the tuner of the
2016-07-10 11:57:43 -03:00
current video or radio input is queried.
2016-08-15 17:49:50 -03:00
.. note ::
:ref: `VIDIOC_S_TUNER <VIDIOC_G_TUNER>` does not switch the
2016-07-10 11:57:43 -03:00
current tuner, when there is more than one at all. The tuner is solely
determined by the current video input. Drivers must support both ioctls
[media] docs-rst: fix cross-references for videodev2.h
There are several broken references there, due to the conversion to
C domain. Fix them using this shell script and manually adjust what's
broken:
# funcs is a file with the broken functions/references
for i in $(cat funcs|sort|uniq|perl -ne 'print "$1\n" if (m/(\S+)$/)'); do
i=${i//-/_}
echo $i
j=${i//_/-}
for k in $(git grep -l "_$j:" Documentation/); do
sed s,\_$j\:,"c\:type\:\: $i", <$k >a && mv a $k
done
for k in $(git grep -l "$j" Documentation/media/*.exceptions); do
sed s,$j,":c\:type\:\`$i\`", <$k >a && mv a $k
done
for k in $(git grep -l "$j" Documentation/); do
sed "s,:ref:\`$i <$j>\`,:c:type:\`$i\`," <$k >a && mv a $k
sed "s,:ref:\`$j\`,:c:type:\`$i\`," <$k >a && mv a $k
sed -E "s,:ref:\`(.*)<$j>\`,:c:type:\`\1<$i>\`," <$k >a && mv a $k
done
for k in $(git grep -l "<$j>" include/media); do
sed -E "s,:ref:\`(.*)<$j>\`,enum \&$i," <$k >a && mv a $k
done
done
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-08 06:41:26 -03:00
and set the `` V4L2_CAP_TUNER `` flag in the struct :c:type: `v4l2_capability`
returned by the :ref: `VIDIOC_QUERYCAP` ioctl when the
2016-07-10 11:57:43 -03:00
device has one or more tuners.
2016-06-30 15:18:56 +02:00
Modulators
==========
Video output devices can have one or more modulators, uh, modulating a
video signal for radiation or connection to the antenna input of a TV
set or video recorder. Each modulator is associated with one or more
video outputs, depending on the number of RF connectors on the
modulator. The `` type `` field of the respective struct
2016-08-29 17:37:59 -03:00
:c:type: `v4l2_output` returned by the
2016-07-01 13:58:44 -03:00
:ref: `VIDIOC_ENUMOUTPUT` ioctl is set to
2016-06-30 15:18:56 +02:00
`` V4L2_OUTPUT_TYPE_MODULATOR `` and its `` modulator `` field contains the
index number of the modulator.
Radio output devices have exactly one modulator with index zero, no
video outputs.
A video or radio device cannot support both a tuner and a modulator. Two
separate device nodes will have to be used for such hardware, one that
supports the tuner functionality and one that supports the modulator
functionality. The reason is a limitation with the
2016-07-01 13:42:29 -03:00
:ref: `VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl where you
2016-06-30 15:18:56 +02:00
cannot specify whether the frequency is for a tuner or a modulator.
To query and change modulator properties applications use the
2016-07-03 10:02:29 -03:00
:ref: `VIDIOC_G_MODULATOR <VIDIOC_G_MODULATOR>` and
2016-07-01 13:42:29 -03:00
:ref: `VIDIOC_S_MODULATOR <VIDIOC_G_MODULATOR>` ioctl. Note that
2016-07-01 14:33:56 -03:00
:ref: `VIDIOC_S_MODULATOR <VIDIOC_G_MODULATOR>` does not switch the current modulator, when there
2016-06-30 15:18:56 +02:00
is more than one at all. The modulator is solely determined by the
current video output. Drivers must support both ioctls and set the
`` V4L2_CAP_MODULATOR `` flag in the struct
2016-08-29 17:37:59 -03:00
:c:type: `v4l2_capability` returned by the
2016-07-01 13:58:44 -03:00
:ref: `VIDIOC_QUERYCAP` ioctl when the device has
2016-06-30 15:18:56 +02:00
one or more modulators.
Radio Frequency
===============
To get and set the tuner or modulator radio frequency applications use
2016-07-03 10:02:29 -03:00
the :ref: `VIDIOC_G_FREQUENCY <VIDIOC_G_FREQUENCY>` and
2016-07-01 13:42:29 -03:00
:ref: `VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl which both take
2016-08-29 17:37:59 -03:00
a pointer to a struct :c:type: `v4l2_frequency` . These
2016-06-30 15:18:56 +02:00
ioctls are used for TV and radio devices alike. Drivers must support
both ioctls when the tuner or modulator ioctls are supported, or when
the device is a radio device.