1*4882a593Smuzhiyun.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 2*4882a593Smuzhiyun.. c:namespace:: V4L 3*4882a593Smuzhiyun 4*4882a593Smuzhiyun.. _VIDIOC_G_TUNER: 5*4882a593Smuzhiyun 6*4882a593Smuzhiyun************************************ 7*4882a593Smuzhiyunioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER 8*4882a593Smuzhiyun************************************ 9*4882a593Smuzhiyun 10*4882a593SmuzhiyunName 11*4882a593Smuzhiyun==== 12*4882a593Smuzhiyun 13*4882a593SmuzhiyunVIDIOC_G_TUNER - VIDIOC_S_TUNER - Get or set tuner attributes 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunSynopsis 16*4882a593Smuzhiyun======== 17*4882a593Smuzhiyun 18*4882a593Smuzhiyun.. c:macro:: VIDIOC_G_TUNER 19*4882a593Smuzhiyun 20*4882a593Smuzhiyun``int ioctl(int fd, VIDIOC_G_TUNER, struct v4l2_tuner *argp)`` 21*4882a593Smuzhiyun 22*4882a593Smuzhiyun.. c:macro:: VIDIOC_S_TUNER 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun``int ioctl(int fd, VIDIOC_S_TUNER, const struct v4l2_tuner *argp)`` 25*4882a593Smuzhiyun 26*4882a593SmuzhiyunArguments 27*4882a593Smuzhiyun========= 28*4882a593Smuzhiyun 29*4882a593Smuzhiyun``fd`` 30*4882a593Smuzhiyun File descriptor returned by :c:func:`open()`. 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun``argp`` 33*4882a593Smuzhiyun Pointer to struct :c:type:`v4l2_tuner`. 34*4882a593Smuzhiyun 35*4882a593SmuzhiyunDescription 36*4882a593Smuzhiyun=========== 37*4882a593Smuzhiyun 38*4882a593SmuzhiyunTo query the attributes of a tuner applications initialize the ``index`` 39*4882a593Smuzhiyunfield and zero out the ``reserved`` array of a struct 40*4882a593Smuzhiyun:c:type:`v4l2_tuner` and call the ``VIDIOC_G_TUNER`` ioctl 41*4882a593Smuzhiyunwith a pointer to this structure. Drivers fill the rest of the structure 42*4882a593Smuzhiyunor return an ``EINVAL`` error code when the index is out of bounds. To 43*4882a593Smuzhiyunenumerate all tuners applications shall begin at index zero, 44*4882a593Smuzhiyunincrementing by one until the driver returns ``EINVAL``. 45*4882a593Smuzhiyun 46*4882a593SmuzhiyunTuners have two writable properties, the audio mode and the radio 47*4882a593Smuzhiyunfrequency. To change the audio mode, applications initialize the 48*4882a593Smuzhiyun``index``, ``audmode`` and ``reserved`` fields and call the 49*4882a593Smuzhiyun``VIDIOC_S_TUNER`` ioctl. This will *not* change the current tuner, 50*4882a593Smuzhiyunwhich is determined by the current video input. Drivers may choose a 51*4882a593Smuzhiyundifferent audio mode if the requested mode is invalid or unsupported. 52*4882a593SmuzhiyunSince this is a write-only ioctl, it does not return the actually 53*4882a593Smuzhiyunselected audio mode. 54*4882a593Smuzhiyun 55*4882a593Smuzhiyun:ref:`SDR <sdr>` specific tuner types are ``V4L2_TUNER_SDR`` and 56*4882a593Smuzhiyun``V4L2_TUNER_RF``. For SDR devices ``audmode`` field must be initialized 57*4882a593Smuzhiyunto zero. The term 'tuner' means SDR receiver in this context. 58*4882a593Smuzhiyun 59*4882a593SmuzhiyunTo change the radio frequency the 60*4882a593Smuzhiyun:ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl is available. 61*4882a593Smuzhiyun 62*4882a593Smuzhiyun .. tabularcolumns:: |p{1.3cm}|p{3.0cm}|p{6.6cm}|p{6.6cm}| 63*4882a593Smuzhiyun 64*4882a593Smuzhiyun.. c:type:: v4l2_tuner 65*4882a593Smuzhiyun 66*4882a593Smuzhiyun.. cssclass:: longtable 67*4882a593Smuzhiyun 68*4882a593Smuzhiyun.. flat-table:: struct v4l2_tuner 69*4882a593Smuzhiyun :header-rows: 0 70*4882a593Smuzhiyun :stub-columns: 0 71*4882a593Smuzhiyun 72*4882a593Smuzhiyun * - __u32 73*4882a593Smuzhiyun - ``index`` 74*4882a593Smuzhiyun - :cspan:`1` Identifies the tuner, set by the application. 75*4882a593Smuzhiyun * - __u8 76*4882a593Smuzhiyun - ``name``\ [32] 77*4882a593Smuzhiyun - :cspan:`1` 78*4882a593Smuzhiyun 79*4882a593Smuzhiyun Name of the tuner, a NUL-terminated ASCII string. 80*4882a593Smuzhiyun 81*4882a593Smuzhiyun This information is intended for the user. 82*4882a593Smuzhiyun * - __u32 83*4882a593Smuzhiyun - ``type`` 84*4882a593Smuzhiyun - :cspan:`1` Type of the tuner, see :c:type:`v4l2_tuner_type`. 85*4882a593Smuzhiyun * - __u32 86*4882a593Smuzhiyun - ``capability`` 87*4882a593Smuzhiyun - :cspan:`1` 88*4882a593Smuzhiyun 89*4882a593Smuzhiyun Tuner capability flags, see :ref:`tuner-capability`. Audio flags 90*4882a593Smuzhiyun indicate the ability to decode audio subprograms. They will *not* 91*4882a593Smuzhiyun change, for example with the current video standard. 92*4882a593Smuzhiyun 93*4882a593Smuzhiyun When the structure refers to a radio tuner the 94*4882a593Smuzhiyun ``V4L2_TUNER_CAP_LANG1``, ``V4L2_TUNER_CAP_LANG2`` and 95*4882a593Smuzhiyun ``V4L2_TUNER_CAP_NORM`` flags can't be used. 96*4882a593Smuzhiyun 97*4882a593Smuzhiyun If multiple frequency bands are supported, then ``capability`` is 98*4882a593Smuzhiyun the union of all ``capability`` fields of each struct 99*4882a593Smuzhiyun :c:type:`v4l2_frequency_band`. 100*4882a593Smuzhiyun * - __u32 101*4882a593Smuzhiyun - ``rangelow`` 102*4882a593Smuzhiyun - :cspan:`1` The lowest tunable frequency in units of 62.5 kHz, or 103*4882a593Smuzhiyun if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in units 104*4882a593Smuzhiyun of 62.5 Hz, or if the ``capability`` flag ``V4L2_TUNER_CAP_1HZ`` 105*4882a593Smuzhiyun is set, in units of 1 Hz. If multiple frequency bands are 106*4882a593Smuzhiyun supported, then ``rangelow`` is the lowest frequency of all the 107*4882a593Smuzhiyun frequency bands. 108*4882a593Smuzhiyun * - __u32 109*4882a593Smuzhiyun - ``rangehigh`` 110*4882a593Smuzhiyun - :cspan:`1` The highest tunable frequency in units of 62.5 kHz, 111*4882a593Smuzhiyun or if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in 112*4882a593Smuzhiyun units of 62.5 Hz, or if the ``capability`` flag 113*4882a593Smuzhiyun ``V4L2_TUNER_CAP_1HZ`` is set, in units of 1 Hz. If multiple 114*4882a593Smuzhiyun frequency bands are supported, then ``rangehigh`` is the highest 115*4882a593Smuzhiyun frequency of all the frequency bands. 116*4882a593Smuzhiyun * - __u32 117*4882a593Smuzhiyun - ``rxsubchans`` 118*4882a593Smuzhiyun - :cspan:`1` 119*4882a593Smuzhiyun 120*4882a593Smuzhiyun Some tuners or audio decoders can determine the received audio 121*4882a593Smuzhiyun subprograms by analyzing audio carriers, pilot tones or other 122*4882a593Smuzhiyun indicators. To pass this information drivers set flags defined in 123*4882a593Smuzhiyun :ref:`tuner-rxsubchans` in this field. For example: 124*4882a593Smuzhiyun * - 125*4882a593Smuzhiyun - 126*4882a593Smuzhiyun - ``V4L2_TUNER_SUB_MONO`` 127*4882a593Smuzhiyun - receiving mono audio 128*4882a593Smuzhiyun * - 129*4882a593Smuzhiyun - 130*4882a593Smuzhiyun - ``STEREO | SAP`` 131*4882a593Smuzhiyun - receiving stereo audio and a secondary audio program 132*4882a593Smuzhiyun * - 133*4882a593Smuzhiyun - 134*4882a593Smuzhiyun - ``MONO | STEREO`` 135*4882a593Smuzhiyun - receiving mono or stereo audio, the hardware cannot distinguish 136*4882a593Smuzhiyun * - 137*4882a593Smuzhiyun - 138*4882a593Smuzhiyun - ``LANG1 | LANG2`` 139*4882a593Smuzhiyun - receiving bilingual audio 140*4882a593Smuzhiyun * - 141*4882a593Smuzhiyun - 142*4882a593Smuzhiyun - ``MONO | STEREO | LANG1 | LANG2`` 143*4882a593Smuzhiyun - receiving mono, stereo or bilingual audio 144*4882a593Smuzhiyun * - 145*4882a593Smuzhiyun - 146*4882a593Smuzhiyun - :cspan:`1` 147*4882a593Smuzhiyun 148*4882a593Smuzhiyun When the ``V4L2_TUNER_CAP_STEREO``, ``_LANG1``, ``_LANG2`` or 149*4882a593Smuzhiyun ``_SAP`` flag is cleared in the ``capability`` field, the 150*4882a593Smuzhiyun corresponding ``V4L2_TUNER_SUB_`` flag must not be set here. 151*4882a593Smuzhiyun 152*4882a593Smuzhiyun This field is valid only if this is the tuner of the current video 153*4882a593Smuzhiyun input, or when the structure refers to a radio tuner. 154*4882a593Smuzhiyun * - __u32 155*4882a593Smuzhiyun - ``audmode`` 156*4882a593Smuzhiyun - :cspan:`1` 157*4882a593Smuzhiyun 158*4882a593Smuzhiyun The selected audio mode, see :ref:`tuner-audmode` for valid 159*4882a593Smuzhiyun values. The audio mode does not affect audio subprogram detection, 160*4882a593Smuzhiyun and like a :ref:`control` it does not automatically 161*4882a593Smuzhiyun change unless the requested mode is invalid or unsupported. See 162*4882a593Smuzhiyun :ref:`tuner-matrix` for possible results when the selected and 163*4882a593Smuzhiyun received audio programs do not match. 164*4882a593Smuzhiyun 165*4882a593Smuzhiyun Currently this is the only field of struct 166*4882a593Smuzhiyun struct :c:type:`v4l2_tuner` applications can change. 167*4882a593Smuzhiyun * - __u32 168*4882a593Smuzhiyun - ``signal`` 169*4882a593Smuzhiyun - :cspan:`1` The signal strength if known. 170*4882a593Smuzhiyun 171*4882a593Smuzhiyun Ranging from 0 to 65535. Higher values indicate a better signal. 172*4882a593Smuzhiyun * - __s32 173*4882a593Smuzhiyun - ``afc`` 174*4882a593Smuzhiyun - :cspan:`1` Automatic frequency control. 175*4882a593Smuzhiyun 176*4882a593Smuzhiyun When the ``afc`` value is negative, the frequency is too 177*4882a593Smuzhiyun low, when positive too high. 178*4882a593Smuzhiyun * - __u32 179*4882a593Smuzhiyun - ``reserved``\ [4] 180*4882a593Smuzhiyun - :cspan:`1` Reserved for future extensions. 181*4882a593Smuzhiyun 182*4882a593Smuzhiyun Drivers and applications must set the array to zero. 183*4882a593Smuzhiyun 184*4882a593Smuzhiyun 185*4882a593Smuzhiyun.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| 186*4882a593Smuzhiyun 187*4882a593Smuzhiyun.. c:type:: v4l2_tuner_type 188*4882a593Smuzhiyun 189*4882a593Smuzhiyun.. flat-table:: enum v4l2_tuner_type 190*4882a593Smuzhiyun :header-rows: 0 191*4882a593Smuzhiyun :stub-columns: 0 192*4882a593Smuzhiyun :widths: 3 1 6 193*4882a593Smuzhiyun 194*4882a593Smuzhiyun * - ``V4L2_TUNER_RADIO`` 195*4882a593Smuzhiyun - 1 196*4882a593Smuzhiyun - Tuner supports radio 197*4882a593Smuzhiyun * - ``V4L2_TUNER_ANALOG_TV`` 198*4882a593Smuzhiyun - 2 199*4882a593Smuzhiyun - Tuner supports analog TV 200*4882a593Smuzhiyun * - ``V4L2_TUNER_SDR`` 201*4882a593Smuzhiyun - 4 202*4882a593Smuzhiyun - Tuner controls the A/D and/or D/A block of a 203*4882a593Smuzhiyun Software Digital Radio (SDR) 204*4882a593Smuzhiyun * - ``V4L2_TUNER_RF`` 205*4882a593Smuzhiyun - 5 206*4882a593Smuzhiyun - Tuner controls the RF part of a Software Digital Radio (SDR) 207*4882a593Smuzhiyun 208*4882a593Smuzhiyun.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| 209*4882a593Smuzhiyun 210*4882a593Smuzhiyun.. _tuner-capability: 211*4882a593Smuzhiyun 212*4882a593Smuzhiyun.. cssclass:: longtable 213*4882a593Smuzhiyun 214*4882a593Smuzhiyun.. flat-table:: Tuner and Modulator Capability Flags 215*4882a593Smuzhiyun :header-rows: 0 216*4882a593Smuzhiyun :stub-columns: 0 217*4882a593Smuzhiyun :widths: 3 1 4 218*4882a593Smuzhiyun 219*4882a593Smuzhiyun * - ``V4L2_TUNER_CAP_LOW`` 220*4882a593Smuzhiyun - 0x0001 221*4882a593Smuzhiyun - When set, tuning frequencies are expressed in units of 62.5 Hz 222*4882a593Smuzhiyun instead of 62.5 kHz. 223*4882a593Smuzhiyun * - ``V4L2_TUNER_CAP_NORM`` 224*4882a593Smuzhiyun - 0x0002 225*4882a593Smuzhiyun - This is a multi-standard tuner; the video standard can or must be 226*4882a593Smuzhiyun switched. (B/G PAL tuners for example are typically not considered 227*4882a593Smuzhiyun multi-standard because the video standard is automatically 228*4882a593Smuzhiyun determined from the frequency band.) The set of supported video 229*4882a593Smuzhiyun standards is available from the struct 230*4882a593Smuzhiyun :c:type:`v4l2_input` pointing to this tuner, see the 231*4882a593Smuzhiyun description of ioctl :ref:`VIDIOC_ENUMINPUT` 232*4882a593Smuzhiyun for details. Only ``V4L2_TUNER_ANALOG_TV`` tuners can have this 233*4882a593Smuzhiyun capability. 234*4882a593Smuzhiyun * - ``V4L2_TUNER_CAP_HWSEEK_BOUNDED`` 235*4882a593Smuzhiyun - 0x0004 236*4882a593Smuzhiyun - If set, then this tuner supports the hardware seek functionality 237*4882a593Smuzhiyun where the seek stops when it reaches the end of the frequency 238*4882a593Smuzhiyun range. 239*4882a593Smuzhiyun * - ``V4L2_TUNER_CAP_HWSEEK_WRAP`` 240*4882a593Smuzhiyun - 0x0008 241*4882a593Smuzhiyun - If set, then this tuner supports the hardware seek functionality 242*4882a593Smuzhiyun where the seek wraps around when it reaches the end of the 243*4882a593Smuzhiyun frequency range. 244*4882a593Smuzhiyun * - ``V4L2_TUNER_CAP_STEREO`` 245*4882a593Smuzhiyun - 0x0010 246*4882a593Smuzhiyun - Stereo audio reception is supported. 247*4882a593Smuzhiyun * - ``V4L2_TUNER_CAP_LANG1`` 248*4882a593Smuzhiyun - 0x0040 249*4882a593Smuzhiyun - Reception of the primary language of a bilingual audio program is 250*4882a593Smuzhiyun supported. Bilingual audio is a feature of two-channel systems, 251*4882a593Smuzhiyun transmitting the primary language monaural on the main audio 252*4882a593Smuzhiyun carrier and a secondary language monaural on a second carrier. 253*4882a593Smuzhiyun Only ``V4L2_TUNER_ANALOG_TV`` tuners can have this capability. 254*4882a593Smuzhiyun * - ``V4L2_TUNER_CAP_LANG2`` 255*4882a593Smuzhiyun - 0x0020 256*4882a593Smuzhiyun - Reception of the secondary language of a bilingual audio program 257*4882a593Smuzhiyun is supported. Only ``V4L2_TUNER_ANALOG_TV`` tuners can have this 258*4882a593Smuzhiyun capability. 259*4882a593Smuzhiyun * - ``V4L2_TUNER_CAP_SAP`` 260*4882a593Smuzhiyun - 0x0020 261*4882a593Smuzhiyun - Reception of a secondary audio program is supported. This is a 262*4882a593Smuzhiyun feature of the BTSC system which accompanies the NTSC video 263*4882a593Smuzhiyun standard. Two audio carriers are available for mono or stereo 264*4882a593Smuzhiyun transmissions of a primary language, and an independent third 265*4882a593Smuzhiyun carrier for a monaural secondary language. Only 266*4882a593Smuzhiyun ``V4L2_TUNER_ANALOG_TV`` tuners can have this capability. 267*4882a593Smuzhiyun 268*4882a593Smuzhiyun .. note:: 269*4882a593Smuzhiyun 270*4882a593Smuzhiyun The ``V4L2_TUNER_CAP_LANG2`` and ``V4L2_TUNER_CAP_SAP`` 271*4882a593Smuzhiyun flags are synonyms. ``V4L2_TUNER_CAP_SAP`` applies when the tuner 272*4882a593Smuzhiyun supports the ``V4L2_STD_NTSC_M`` video standard. 273*4882a593Smuzhiyun * - ``V4L2_TUNER_CAP_RDS`` 274*4882a593Smuzhiyun - 0x0080 275*4882a593Smuzhiyun - RDS capture is supported. This capability is only valid for radio 276*4882a593Smuzhiyun tuners. 277*4882a593Smuzhiyun * - ``V4L2_TUNER_CAP_RDS_BLOCK_IO`` 278*4882a593Smuzhiyun - 0x0100 279*4882a593Smuzhiyun - The RDS data is passed as unparsed RDS blocks. 280*4882a593Smuzhiyun * - ``V4L2_TUNER_CAP_RDS_CONTROLS`` 281*4882a593Smuzhiyun - 0x0200 282*4882a593Smuzhiyun - The RDS data is parsed by the hardware and set via controls. 283*4882a593Smuzhiyun * - ``V4L2_TUNER_CAP_FREQ_BANDS`` 284*4882a593Smuzhiyun - 0x0400 285*4882a593Smuzhiyun - The :ref:`VIDIOC_ENUM_FREQ_BANDS` 286*4882a593Smuzhiyun ioctl can be used to enumerate the available frequency bands. 287*4882a593Smuzhiyun * - ``V4L2_TUNER_CAP_HWSEEK_PROG_LIM`` 288*4882a593Smuzhiyun - 0x0800 289*4882a593Smuzhiyun - The range to search when using the hardware seek functionality is 290*4882a593Smuzhiyun programmable, see 291*4882a593Smuzhiyun :ref:`VIDIOC_S_HW_FREQ_SEEK` for 292*4882a593Smuzhiyun details. 293*4882a593Smuzhiyun * - ``V4L2_TUNER_CAP_1HZ`` 294*4882a593Smuzhiyun - 0x1000 295*4882a593Smuzhiyun - When set, tuning frequencies are expressed in units of 1 Hz 296*4882a593Smuzhiyun instead of 62.5 kHz. 297*4882a593Smuzhiyun 298*4882a593Smuzhiyun 299*4882a593Smuzhiyun.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| 300*4882a593Smuzhiyun 301*4882a593Smuzhiyun.. _tuner-rxsubchans: 302*4882a593Smuzhiyun 303*4882a593Smuzhiyun.. flat-table:: Tuner Audio Reception Flags 304*4882a593Smuzhiyun :header-rows: 0 305*4882a593Smuzhiyun :stub-columns: 0 306*4882a593Smuzhiyun :widths: 3 1 4 307*4882a593Smuzhiyun 308*4882a593Smuzhiyun * - ``V4L2_TUNER_SUB_MONO`` 309*4882a593Smuzhiyun - 0x0001 310*4882a593Smuzhiyun - The tuner receives a mono audio signal. 311*4882a593Smuzhiyun * - ``V4L2_TUNER_SUB_STEREO`` 312*4882a593Smuzhiyun - 0x0002 313*4882a593Smuzhiyun - The tuner receives a stereo audio signal. 314*4882a593Smuzhiyun * - ``V4L2_TUNER_SUB_LANG1`` 315*4882a593Smuzhiyun - 0x0008 316*4882a593Smuzhiyun - The tuner receives the primary language of a bilingual audio 317*4882a593Smuzhiyun signal. Drivers must clear this flag when the current video 318*4882a593Smuzhiyun standard is ``V4L2_STD_NTSC_M``. 319*4882a593Smuzhiyun * - ``V4L2_TUNER_SUB_LANG2`` 320*4882a593Smuzhiyun - 0x0004 321*4882a593Smuzhiyun - The tuner receives the secondary language of a bilingual audio 322*4882a593Smuzhiyun signal (or a second audio program). 323*4882a593Smuzhiyun * - ``V4L2_TUNER_SUB_SAP`` 324*4882a593Smuzhiyun - 0x0004 325*4882a593Smuzhiyun - The tuner receives a Second Audio Program. 326*4882a593Smuzhiyun 327*4882a593Smuzhiyun .. note:: 328*4882a593Smuzhiyun 329*4882a593Smuzhiyun The ``V4L2_TUNER_SUB_LANG2`` and ``V4L2_TUNER_SUB_SAP`` 330*4882a593Smuzhiyun flags are synonyms. The ``V4L2_TUNER_SUB_SAP`` flag applies 331*4882a593Smuzhiyun when the current video standard is ``V4L2_STD_NTSC_M``. 332*4882a593Smuzhiyun * - ``V4L2_TUNER_SUB_RDS`` 333*4882a593Smuzhiyun - 0x0010 334*4882a593Smuzhiyun - The tuner receives an RDS channel. 335*4882a593Smuzhiyun 336*4882a593Smuzhiyun 337*4882a593Smuzhiyun.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| 338*4882a593Smuzhiyun 339*4882a593Smuzhiyun.. _tuner-audmode: 340*4882a593Smuzhiyun 341*4882a593Smuzhiyun.. flat-table:: Tuner Audio Modes 342*4882a593Smuzhiyun :header-rows: 0 343*4882a593Smuzhiyun :stub-columns: 0 344*4882a593Smuzhiyun :widths: 3 1 4 345*4882a593Smuzhiyun 346*4882a593Smuzhiyun * - ``V4L2_TUNER_MODE_MONO`` 347*4882a593Smuzhiyun - 0 348*4882a593Smuzhiyun - Play mono audio. When the tuner receives a stereo signal this a 349*4882a593Smuzhiyun down-mix of the left and right channel. When the tuner receives a 350*4882a593Smuzhiyun bilingual or SAP signal this mode selects the primary language. 351*4882a593Smuzhiyun * - ``V4L2_TUNER_MODE_STEREO`` 352*4882a593Smuzhiyun - 1 353*4882a593Smuzhiyun - Play stereo audio. When the tuner receives bilingual audio it may 354*4882a593Smuzhiyun play different languages on the left and right channel or the 355*4882a593Smuzhiyun primary language is played on both channels. 356*4882a593Smuzhiyun 357*4882a593Smuzhiyun Playing different languages in this mode is deprecated. New 358*4882a593Smuzhiyun drivers should do this only in ``MODE_LANG1_LANG2``. 359*4882a593Smuzhiyun 360*4882a593Smuzhiyun When the tuner receives no stereo signal or does not support 361*4882a593Smuzhiyun stereo reception the driver shall fall back to ``MODE_MONO``. 362*4882a593Smuzhiyun * - ``V4L2_TUNER_MODE_LANG1`` 363*4882a593Smuzhiyun - 3 364*4882a593Smuzhiyun - Play the primary language, mono or stereo. Only 365*4882a593Smuzhiyun ``V4L2_TUNER_ANALOG_TV`` tuners support this mode. 366*4882a593Smuzhiyun * - ``V4L2_TUNER_MODE_LANG2`` 367*4882a593Smuzhiyun - 2 368*4882a593Smuzhiyun - Play the secondary language, mono. When the tuner receives no 369*4882a593Smuzhiyun bilingual audio or SAP, or their reception is not supported the 370*4882a593Smuzhiyun driver shall fall back to mono or stereo mode. Only 371*4882a593Smuzhiyun ``V4L2_TUNER_ANALOG_TV`` tuners support this mode. 372*4882a593Smuzhiyun * - ``V4L2_TUNER_MODE_SAP`` 373*4882a593Smuzhiyun - 2 374*4882a593Smuzhiyun - Play the Second Audio Program. When the tuner receives no 375*4882a593Smuzhiyun bilingual audio or SAP, or their reception is not supported the 376*4882a593Smuzhiyun driver shall fall back to mono or stereo mode. Only 377*4882a593Smuzhiyun ``V4L2_TUNER_ANALOG_TV`` tuners support this mode. 378*4882a593Smuzhiyun 379*4882a593Smuzhiyun .. note:: The ``V4L2_TUNER_MODE_LANG2`` and ``V4L2_TUNER_MODE_SAP`` 380*4882a593Smuzhiyun are synonyms. 381*4882a593Smuzhiyun * - ``V4L2_TUNER_MODE_LANG1_LANG2`` 382*4882a593Smuzhiyun - 4 383*4882a593Smuzhiyun - Play the primary language on the left channel, the secondary 384*4882a593Smuzhiyun language on the right channel. When the tuner receives no 385*4882a593Smuzhiyun bilingual audio or SAP, it shall fall back to ``MODE_LANG1`` or 386*4882a593Smuzhiyun ``MODE_MONO``. Only ``V4L2_TUNER_ANALOG_TV`` tuners support this 387*4882a593Smuzhiyun mode. 388*4882a593Smuzhiyun 389*4882a593Smuzhiyun.. raw:: latex 390*4882a593Smuzhiyun 391*4882a593Smuzhiyun \scriptsize 392*4882a593Smuzhiyun 393*4882a593Smuzhiyun.. tabularcolumns:: |p{1.5cm}|p{1.5cm}|p{2.9cm}|p{2.9cm}|p{2.9cm}|p{2.9cm}| 394*4882a593Smuzhiyun 395*4882a593Smuzhiyun.. _tuner-matrix: 396*4882a593Smuzhiyun 397*4882a593Smuzhiyun.. flat-table:: Tuner Audio Matrix 398*4882a593Smuzhiyun :header-rows: 2 399*4882a593Smuzhiyun :stub-columns: 0 400*4882a593Smuzhiyun :widths: 7 7 14 14 14 14 401*4882a593Smuzhiyun 402*4882a593Smuzhiyun * - 403*4882a593Smuzhiyun - :cspan:`4` Selected ``V4L2_TUNER_MODE_`` 404*4882a593Smuzhiyun * - Received ``V4L2_TUNER_SUB_`` 405*4882a593Smuzhiyun - ``MONO`` 406*4882a593Smuzhiyun - ``STEREO`` 407*4882a593Smuzhiyun - ``LANG1`` 408*4882a593Smuzhiyun - ``LANG2 = SAP`` 409*4882a593Smuzhiyun - ``LANG1_LANG2``\ [#f1]_ 410*4882a593Smuzhiyun * - ``MONO`` 411*4882a593Smuzhiyun - Mono 412*4882a593Smuzhiyun - Mono/Mono 413*4882a593Smuzhiyun - Mono 414*4882a593Smuzhiyun - Mono 415*4882a593Smuzhiyun - Mono/Mono 416*4882a593Smuzhiyun * - ``MONO | SAP`` 417*4882a593Smuzhiyun - Mono 418*4882a593Smuzhiyun - Mono/Mono 419*4882a593Smuzhiyun - Mono 420*4882a593Smuzhiyun - SAP 421*4882a593Smuzhiyun - Mono/SAP (preferred) or Mono/Mono 422*4882a593Smuzhiyun * - ``STEREO`` 423*4882a593Smuzhiyun - L+R 424*4882a593Smuzhiyun - L/R 425*4882a593Smuzhiyun - Stereo L/R (preferred) or Mono L+R 426*4882a593Smuzhiyun - Stereo L/R (preferred) or Mono L+R 427*4882a593Smuzhiyun - L/R (preferred) or L+R/L+R 428*4882a593Smuzhiyun * - ``STEREO | SAP`` 429*4882a593Smuzhiyun - L+R 430*4882a593Smuzhiyun - L/R 431*4882a593Smuzhiyun - Stereo L/R (preferred) or Mono L+R 432*4882a593Smuzhiyun - SAP 433*4882a593Smuzhiyun - L+R/SAP (preferred) or L/R or L+R/L+R 434*4882a593Smuzhiyun * - ``LANG1 | LANG2`` 435*4882a593Smuzhiyun - Language 1 436*4882a593Smuzhiyun - Lang1/Lang2 (deprecated\ [#f2]_) or Lang1/Lang1 437*4882a593Smuzhiyun - Language 1 438*4882a593Smuzhiyun - Language 2 439*4882a593Smuzhiyun - Lang1/Lang2 (preferred) or Lang1/Lang1 440*4882a593Smuzhiyun 441*4882a593Smuzhiyun.. raw:: latex 442*4882a593Smuzhiyun 443*4882a593Smuzhiyun \normalsize 444*4882a593Smuzhiyun 445*4882a593SmuzhiyunReturn Value 446*4882a593Smuzhiyun============ 447*4882a593Smuzhiyun 448*4882a593SmuzhiyunOn success 0 is returned, on error -1 and the ``errno`` variable is set 449*4882a593Smuzhiyunappropriately. The generic error codes are described at the 450*4882a593Smuzhiyun:ref:`Generic Error Codes <gen-errors>` chapter. 451*4882a593Smuzhiyun 452*4882a593SmuzhiyunEINVAL 453*4882a593Smuzhiyun The struct :c:type:`v4l2_tuner` ``index`` is out of 454*4882a593Smuzhiyun bounds. 455*4882a593Smuzhiyun 456*4882a593Smuzhiyun.. [#f1] 457*4882a593Smuzhiyun This mode has been added in Linux 2.6.17 and may not be supported by 458*4882a593Smuzhiyun older drivers. 459*4882a593Smuzhiyun 460*4882a593Smuzhiyun.. [#f2] 461*4882a593Smuzhiyun Playback of both languages in ``MODE_STEREO`` is deprecated. In the 462*4882a593Smuzhiyun future drivers should produce only the primary language in this mode. 463*4882a593Smuzhiyun Applications should request ``MODE_LANG1_LANG2`` to record both 464*4882a593Smuzhiyun languages or a stereo signal. 465