1 .. -*- coding: utf-8; mode: rst -*-
3 .. _VIDIOC_S_HW_FREQ_SEEK:
5 ***************************
6 ioctl VIDIOC_S_HW_FREQ_SEEK
7 ***************************
12 VIDIOC_S_HW_FREQ_SEEK - Perform a hardware frequency seek
18 .. c:function:: int ioctl( int fd, VIDIOC_S_HW_FREQ_SEEK, struct v4l2_hw_freq_seek *argp )
19 :name: VIDIOC_S_HW_FREQ_SEEK
26 File descriptor returned by :ref:`open() <func-open>`.
34 Start a hardware frequency seek from the current frequency. To do this
35 applications initialize the ``tuner``, ``type``, ``seek_upward``,
36 ``wrap_around``, ``spacing``, ``rangelow`` and ``rangehigh`` fields, and
37 zero out the ``reserved`` array of a struct
38 :c:type:`v4l2_hw_freq_seek` and call the
39 ``VIDIOC_S_HW_FREQ_SEEK`` ioctl with a pointer to this structure.
41 The ``rangelow`` and ``rangehigh`` fields can be set to a non-zero value
42 to tell the driver to search a specific band. If the struct
43 :c:type:`v4l2_tuner` ``capability`` field has the
44 ``V4L2_TUNER_CAP_HWSEEK_PROG_LIM`` flag set, these values must fall
45 within one of the bands returned by
46 :ref:`VIDIOC_ENUM_FREQ_BANDS`. If the
47 ``V4L2_TUNER_CAP_HWSEEK_PROG_LIM`` flag is not set, then these values
48 must exactly match those of one of the bands returned by
49 :ref:`VIDIOC_ENUM_FREQ_BANDS`. If the
50 current frequency of the tuner does not fall within the selected band it
51 will be clamped to fit in the band before the seek is started.
53 If an error is returned, then the original frequency will be restored.
55 This ioctl is supported if the ``V4L2_CAP_HW_FREQ_SEEK`` capability is
58 If this ioctl is called from a non-blocking filehandle, then ``EAGAIN``
59 error code is returned and no seek takes place.
62 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
64 .. c:type:: v4l2_hw_freq_seek
66 .. flat-table:: struct v4l2_hw_freq_seek
73 - The tuner index number. This is the same value as in the struct
74 :c:type:`v4l2_input` ``tuner`` field and the struct
75 :c:type:`v4l2_tuner` ``index`` field.
78 - The tuner type. This is the same value as in the struct
79 :c:type:`v4l2_tuner` ``type`` field. See
80 :c:type:`v4l2_tuner_type`
83 - If non-zero, seek upward from the current frequency, else seek
87 - If non-zero, wrap around when at the end of the frequency range,
88 else stop seeking. The struct :c:type:`v4l2_tuner`
89 ``capability`` field will tell you what the hardware supports.
92 - If non-zero, defines the hardware seek resolution in Hz. The
93 driver selects the nearest value that is supported by the device.
94 If spacing is zero a reasonable default value is used.
97 - If non-zero, the lowest tunable frequency of the band to search in
98 units of 62.5 kHz, or if the struct
99 :c:type:`v4l2_tuner` ``capability`` field has the
100 ``V4L2_TUNER_CAP_LOW`` flag set, in units of 62.5 Hz or if the
101 struct :c:type:`v4l2_tuner` ``capability`` field has
102 the ``V4L2_TUNER_CAP_1HZ`` flag set, in units of 1 Hz. If
103 ``rangelow`` is zero a reasonable default value is used.
106 - If non-zero, the highest tunable frequency of the band to search
107 in units of 62.5 kHz, or if the struct
108 :c:type:`v4l2_tuner` ``capability`` field has the
109 ``V4L2_TUNER_CAP_LOW`` flag set, in units of 62.5 Hz or if the
110 struct :c:type:`v4l2_tuner` ``capability`` field has
111 the ``V4L2_TUNER_CAP_1HZ`` flag set, in units of 1 Hz. If
112 ``rangehigh`` is zero a reasonable default value is used.
115 - Reserved for future extensions. Applications must set the array to
122 On success 0 is returned, on error -1 and the ``errno`` variable is set
123 appropriately. The generic error codes are described at the
124 :ref:`Generic Error Codes <gen-errors>` chapter.
127 The ``tuner`` index is out of bounds, the ``wrap_around`` value is
128 not supported or one of the values in the ``type``, ``rangelow`` or
129 ``rangehigh`` fields is wrong.
132 Attempted to call ``VIDIOC_S_HW_FREQ_SEEK`` with the filehandle in
136 The hardware seek found no channels.
139 Another hardware seek is already in progress.