Home | History | Annotate | Download | only in spec
      1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
      2 <HTML
      3 ><HEAD
      4 ><TITLE
      5 >ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER</TITLE
      6 ><META
      7 NAME="GENERATOR"
      8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
      9 REL="HOME"
     10 TITLE="Video for Linux Two API Specification"
     11 HREF="book1.htm"><LINK
     12 REL="UP"
     13 TITLE="Function Reference"
     14 HREF="r7624.htm"><LINK
     15 REL="PREVIOUS"
     16 TITLE="ioctl VIDIOC_G_STD, VIDIOC_S_STD"
     17 HREF="r12265.htm"><LINK
     18 REL="NEXT"
     19 TITLE="ioctl VIDIOC_LOG_STATUS"
     20 HREF="r12784.htm"></HEAD
     21 ><BODY
     22 CLASS="REFENTRY"
     23 BGCOLOR="#FFFFFF"
     24 TEXT="#000000"
     25 LINK="#0000FF"
     26 VLINK="#840084"
     27 ALINK="#0000FF"
     28 ><DIV
     29 CLASS="NAVHEADER"
     30 ><TABLE
     31 SUMMARY="Header navigation table"
     32 WIDTH="100%"
     33 BORDER="0"
     34 CELLPADDING="0"
     35 CELLSPACING="0"
     36 ><TR
     37 ><TH
     38 COLSPAN="3"
     39 ALIGN="center"
     40 >Video for Linux Two API Specification: Revision 0.24</TH
     41 ></TR
     42 ><TR
     43 ><TD
     44 WIDTH="10%"
     45 ALIGN="left"
     46 VALIGN="bottom"
     47 ><A
     48 HREF="r12265.htm"
     49 ACCESSKEY="P"
     50 >Prev</A
     51 ></TD
     52 ><TD
     53 WIDTH="80%"
     54 ALIGN="center"
     55 VALIGN="bottom"
     56 ></TD
     57 ><TD
     58 WIDTH="10%"
     59 ALIGN="right"
     60 VALIGN="bottom"
     61 ><A
     62 HREF="r12784.htm"
     63 ACCESSKEY="N"
     64 >Next</A
     65 ></TD
     66 ></TR
     67 ></TABLE
     68 ><HR
     69 ALIGN="LEFT"
     70 WIDTH="100%"></DIV
     71 ><H1
     72 ><A
     73 NAME="VIDIOC-G-TUNER"
     74 ></A
     75 >ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER</H1
     76 ><DIV
     77 CLASS="REFNAMEDIV"
     78 ><A
     79 NAME="AEN12346"
     80 ></A
     81 ><H2
     82 >Name</H2
     83 >VIDIOC_G_TUNER, VIDIOC_S_TUNER&nbsp;--&nbsp;Get or set tuner attributes</DIV
     84 ><DIV
     85 CLASS="REFSYNOPSISDIV"
     86 ><A
     87 NAME="AEN12350"
     88 ></A
     89 ><H2
     90 >Synopsis</H2
     91 ><DIV
     92 CLASS="FUNCSYNOPSIS"
     93 ><P
     94 ></P
     95 ><A
     96 NAME="AEN12351"
     97 ></A
     98 ><P
     99 ><CODE
    100 ><CODE
    101 CLASS="FUNCDEF"
    102 >int ioctl</CODE
    103 >(int fd, int request, struct v4l2_tuner
    104 *argp);</CODE
    105 ></P
    106 ><P
    107 ></P
    108 ></DIV
    109 ><DIV
    110 CLASS="FUNCSYNOPSIS"
    111 ><P
    112 ></P
    113 ><A
    114 NAME="AEN12361"
    115 ></A
    116 ><P
    117 ><CODE
    118 ><CODE
    119 CLASS="FUNCDEF"
    120 >int ioctl</CODE
    121 >(int fd, int request, const struct v4l2_tuner
    122 *argp);</CODE
    123 ></P
    124 ><P
    125 ></P
    126 ></DIV
    127 ></DIV
    128 ><DIV
    129 CLASS="REFSECT1"
    130 ><A
    131 NAME="AEN12371"
    132 ></A
    133 ><H2
    134 >Arguments</H2
    135 ><P
    136 ></P
    137 ><DIV
    138 CLASS="VARIABLELIST"
    139 ><DL
    140 ><DT
    141 ><CODE
    142 CLASS="PARAMETER"
    143 >fd</CODE
    144 ></DT
    145 ><DD
    146 ><P
    147 >File descriptor returned by <A
    148 HREF="r14090.htm"
    149 ><CODE
    150 CLASS="FUNCTION"
    151 >open()</CODE
    152 ></A
    153 >.</P
    154 ></DD
    155 ><DT
    156 ><CODE
    157 CLASS="PARAMETER"
    158 >request</CODE
    159 ></DT
    160 ><DD
    161 ><P
    162 >VIDIOC_G_TUNER, VIDIOC_S_TUNER</P
    163 ></DD
    164 ><DT
    165 ><CODE
    166 CLASS="PARAMETER"
    167 >argp</CODE
    168 ></DT
    169 ><DD
    170 ><P
    171 ></P
    172 ></DD
    173 ></DL
    174 ></DIV
    175 ></DIV
    176 ><DIV
    177 CLASS="REFSECT1"
    178 ><A
    179 NAME="AEN12391"
    180 ></A
    181 ><H2
    182 >Description</H2
    183 ><P
    184 >To query the attributes of a tuner applications initialize the
    185 <CODE
    186 CLASS="STRUCTFIELD"
    187 >index</CODE
    188 > field and zero out the
    189 <CODE
    190 CLASS="STRUCTFIELD"
    191 >reserved</CODE
    192 > array of a struct&nbsp;<A
    193 HREF="r12342.htm#V4L2-TUNER"
    194 >v4l2_tuner</A
    195 > and call the
    196 <CODE
    197 CLASS="CONSTANT"
    198 >VIDIOC_G_TUNER</CODE
    199 > ioctl with a pointer to this
    200 structure. Drivers fill the rest of the structure or return an
    201 <SPAN
    202 CLASS="ERRORCODE"
    203 >EINVAL</SPAN
    204 > error code when the index is out of bounds. To enumerate all tuners
    205 applications shall begin at index zero, incrementing by one until the
    206 driver returns <SPAN
    207 CLASS="ERRORCODE"
    208 >EINVAL</SPAN
    209 >.</P
    210 ><P
    211 >Tuners have two writable properties, the audio mode and
    212 the radio frequency. To change the audio mode, applications initialize
    213 the <CODE
    214 CLASS="STRUCTFIELD"
    215 >index</CODE
    216 >,
    217 <CODE
    218 CLASS="STRUCTFIELD"
    219 >audmode</CODE
    220 > and
    221 <CODE
    222 CLASS="STRUCTFIELD"
    223 >reserved</CODE
    224 > fields and call the
    225 <CODE
    226 CLASS="CONSTANT"
    227 >VIDIOC_S_TUNER</CODE
    228 > ioctl. This will
    229 <SPAN
    230 CLASS="emphasis"
    231 ><I
    232 CLASS="EMPHASIS"
    233 >not</I
    234 ></SPAN
    235 > change the current tuner, which is determined
    236 by the current video input. Drivers may choose a different audio mode
    237 if the requested mode is invalid or unsupported. Since this is a
    238 write-only ioctl, it does not return the actually
    239 selected audio mode.</P
    240 ><P
    241 >To change the radio frequency the <A
    242 HREF="r11094.htm"
    243 ><CODE
    244 CLASS="CONSTANT"
    245 >VIDIOC_S_FREQUENCY</CODE
    246 ></A
    247 > ioctl
    248 is available.</P
    249 ><DIV
    250 CLASS="TABLE"
    251 ><A
    252 NAME="V4L2-TUNER"
    253 ></A
    254 ><P
    255 ><B
    256 >Table 1. struct <CODE
    257 CLASS="STRUCTNAME"
    258 >v4l2_tuner</CODE
    259 ></B
    260 ></P
    261 ><TABLE
    262 BORDER="0"
    263 FRAME="void"
    264 WIDTH="100%"
    265 CLASS="CALSTABLE"
    266 ><COL
    267 WIDTH="25%"
    268 TITLE="C1"><COL
    269 WIDTH="25%"
    270 TITLE="C2"><COL
    271 WIDTH="25%"
    272 TITLE="C3"><TBODY
    273 VALIGN="TOP"
    274 ><TR
    275 ><TD
    276 >__u32</TD
    277 ><TD
    278 ><CODE
    279 CLASS="STRUCTFIELD"
    280 >index</CODE
    281 ></TD
    282 ><TD
    283 COLSPAN="2"
    284 >Identifies the tuner, set by the
    285 application.</TD
    286 ></TR
    287 ><TR
    288 ><TD
    289 >__u8</TD
    290 ><TD
    291 ><CODE
    292 CLASS="STRUCTFIELD"
    293 >name</CODE
    294 >[32]</TD
    295 ><TD
    296 COLSPAN="2"
    297 ><P
    298 >Name of the tuner, a
    299 NUL-terminated ASCII string. This information is intended for the
    300 user.</P
    301 ></TD
    302 ></TR
    303 ><TR
    304 ><TD
    305 >enum&nbsp;<A
    306 HREF="r12342.htm#V4L2-TUNER-TYPE"
    307 >v4l2_tuner_type</A
    308 ></TD
    309 ><TD
    310 ><CODE
    311 CLASS="STRUCTFIELD"
    312 >type</CODE
    313 ></TD
    314 ><TD
    315 COLSPAN="2"
    316 >Type of the tuner, see <A
    317 HREF="r12342.htm#V4L2-TUNER-TYPE"
    318 >Table 2</A
    319 >.</TD
    320 ></TR
    321 ><TR
    322 ><TD
    323 >__u32</TD
    324 ><TD
    325 ><CODE
    326 CLASS="STRUCTFIELD"
    327 >capability</CODE
    328 ></TD
    329 ><TD
    330 COLSPAN="2"
    331 ><P
    332 >Tuner capability flags, see
    333 <A
    334 HREF="r12342.htm#TUNER-CAPABILITY"
    335 >Table 3</A
    336 >. Audio flags indicate the ability
    337 to decode audio subprograms. They will <SPAN
    338 CLASS="emphasis"
    339 ><I
    340 CLASS="EMPHASIS"
    341 >not</I
    342 ></SPAN
    343 >
    344 change, for example with the current video standard.</P
    345 ><P
    346 >When
    347 the structure refers to a radio tuner only the
    348 <CODE
    349 CLASS="CONSTANT"
    350 >V4L2_TUNER_CAP_LOW</CODE
    351 > and
    352 <CODE
    353 CLASS="CONSTANT"
    354 >V4L2_TUNER_CAP_STEREO</CODE
    355 > flags can be
    356 set.</P
    357 ></TD
    358 ></TR
    359 ><TR
    360 ><TD
    361 >__u32</TD
    362 ><TD
    363 ><CODE
    364 CLASS="STRUCTFIELD"
    365 >rangelow</CODE
    366 ></TD
    367 ><TD
    368 COLSPAN="2"
    369 >The lowest tunable frequency in
    370 units of 62.5 kHz, or if the <CODE
    371 CLASS="STRUCTFIELD"
    372 >capability</CODE
    373 >
    374 flag <CODE
    375 CLASS="CONSTANT"
    376 >V4L2_TUNER_CAP_LOW</CODE
    377 > is set, in units of 62.5
    378 Hz.</TD
    379 ></TR
    380 ><TR
    381 ><TD
    382 >__u32</TD
    383 ><TD
    384 ><CODE
    385 CLASS="STRUCTFIELD"
    386 >rangehigh</CODE
    387 ></TD
    388 ><TD
    389 COLSPAN="2"
    390 >The highest tunable frequency in
    391 units of 62.5 kHz, or if the <CODE
    392 CLASS="STRUCTFIELD"
    393 >capability</CODE
    394 >
    395 flag <CODE
    396 CLASS="CONSTANT"
    397 >V4L2_TUNER_CAP_LOW</CODE
    398 > is set, in units of 62.5
    399 Hz.</TD
    400 ></TR
    401 ><TR
    402 ><TD
    403 >__u32</TD
    404 ><TD
    405 ><CODE
    406 CLASS="STRUCTFIELD"
    407 >rxsubchans</CODE
    408 ></TD
    409 ><TD
    410 COLSPAN="2"
    411 ><P
    412 >Some tuners or audio
    413 decoders can determine the received audio subprograms by analyzing
    414 audio carriers, pilot tones or other indicators. To pass this
    415 information drivers set flags defined in <A
    416 HREF="r12342.htm#TUNER-RXSUBCHANS"
    417 >Table 4</A
    418 > in this field. For
    419 example:</P
    420 ></TD
    421 ></TR
    422 ><TR
    423 ><TD
    424 >&nbsp;</TD
    425 ><TD
    426 >&nbsp;</TD
    427 ><TD
    428 ><CODE
    429 CLASS="CONSTANT"
    430 >V4L2_TUNER_SUB_MONO</CODE
    431 ></TD
    432 ><TD
    433 >receiving mono audio</TD
    434 ></TR
    435 ><TR
    436 ><TD
    437 >&nbsp;</TD
    438 ><TD
    439 >&nbsp;</TD
    440 ><TD
    441 ><CODE
    442 CLASS="CONSTANT"
    443 >STEREO | SAP</CODE
    444 ></TD
    445 ><TD
    446 >receiving stereo audio and a secondary audio
    447 program</TD
    448 ></TR
    449 ><TR
    450 ><TD
    451 >&nbsp;</TD
    452 ><TD
    453 >&nbsp;</TD
    454 ><TD
    455 ><CODE
    456 CLASS="CONSTANT"
    457 >MONO | STEREO</CODE
    458 ></TD
    459 ><TD
    460 >receiving mono or stereo audio, the hardware cannot
    461 distinguish</TD
    462 ></TR
    463 ><TR
    464 ><TD
    465 >&nbsp;</TD
    466 ><TD
    467 >&nbsp;</TD
    468 ><TD
    469 ><CODE
    470 CLASS="CONSTANT"
    471 >LANG1 | LANG2</CODE
    472 ></TD
    473 ><TD
    474 >receiving bilingual audio</TD
    475 ></TR
    476 ><TR
    477 ><TD
    478 >&nbsp;</TD
    479 ><TD
    480 >&nbsp;</TD
    481 ><TD
    482 ><CODE
    483 CLASS="CONSTANT"
    484 >MONO | STEREO | LANG1 | LANG2</CODE
    485 ></TD
    486 ><TD
    487 >receiving mono, stereo or bilingual
    488 audio</TD
    489 ></TR
    490 ><TR
    491 ><TD
    492 >&nbsp;</TD
    493 ><TD
    494 >&nbsp;</TD
    495 ><TD
    496 COLSPAN="2"
    497 ><P
    498 >When the
    499 <CODE
    500 CLASS="CONSTANT"
    501 >V4L2_TUNER_CAP_STEREO</CODE
    502 >,
    503 <CODE
    504 CLASS="CONSTANT"
    505 >_LANG1</CODE
    506 >, <CODE
    507 CLASS="CONSTANT"
    508 >_LANG2</CODE
    509 > or
    510 <CODE
    511 CLASS="CONSTANT"
    512 >_SAP</CODE
    513 > flag is cleared in the
    514 <CODE
    515 CLASS="STRUCTFIELD"
    516 >capability</CODE
    517 > field, the corresponding
    518 <CODE
    519 CLASS="CONSTANT"
    520 >V4L2_TUNER_SUB_</CODE
    521 > flag must not be set
    522 here.</P
    523 ><P
    524 >This field is valid only if this is the tuner of the
    525 current video input, or when the structure refers to a radio
    526 tuner.</P
    527 ></TD
    528 ></TR
    529 ><TR
    530 ><TD
    531 >__u32</TD
    532 ><TD
    533 ><CODE
    534 CLASS="STRUCTFIELD"
    535 >audmode</CODE
    536 ></TD
    537 ><TD
    538 COLSPAN="2"
    539 ><P
    540 >The selected audio mode, see
    541 <A
    542 HREF="r12342.htm#TUNER-AUDMODE"
    543 >Table 5</A
    544 > for valid values. The audio mode does
    545 not affect audio subprogram detection, and like a <A
    546 HREF="x542.htm"
    547 >control</A
    548 > it does not automatically change
    549 unless the requested mode is invalid or unsupported. See <A
    550 HREF="r12342.htm#TUNER-MATRIX"
    551 >Table 6</A
    552 > for possible results when
    553 the selected and received audio programs do not
    554 match.</P
    555 ><P
    556 >Currently this is the only field of struct
    557 <CODE
    558 CLASS="STRUCTNAME"
    559 >v4l2_tuner</CODE
    560 > applications can
    561 change.</P
    562 ></TD
    563 ></TR
    564 ><TR
    565 ><TD
    566 >__u32</TD
    567 ><TD
    568 ><CODE
    569 CLASS="STRUCTFIELD"
    570 >signal</CODE
    571 ></TD
    572 ><TD
    573 COLSPAN="2"
    574 >The signal strength if known, ranging
    575 from 0 to 65535. Higher values indicate a better signal.</TD
    576 ></TR
    577 ><TR
    578 ><TD
    579 >__s32</TD
    580 ><TD
    581 ><CODE
    582 CLASS="STRUCTFIELD"
    583 >afc</CODE
    584 ></TD
    585 ><TD
    586 COLSPAN="2"
    587 >Automatic frequency control: When the
    588 <CODE
    589 CLASS="STRUCTFIELD"
    590 >afc</CODE
    591 > value is negative, the frequency is too
    592 low, when positive too high.</TD
    593 ></TR
    594 ><TR
    595 ><TD
    596 >__u32</TD
    597 ><TD
    598 ><CODE
    599 CLASS="STRUCTFIELD"
    600 >reserved</CODE
    601 >[4]</TD
    602 ><TD
    603 COLSPAN="2"
    604 >Reserved for future extensions. Drivers and
    605 applications must set the array to zero.</TD
    606 ></TR
    607 ></TBODY
    608 ></TABLE
    609 ></DIV
    610 ><DIV
    611 CLASS="TABLE"
    612 ><A
    613 NAME="V4L2-TUNER-TYPE"
    614 ></A
    615 ><P
    616 ><B
    617 >Table 2. enum v4l2_tuner_type</B
    618 ></P
    619 ><TABLE
    620 BORDER="0"
    621 FRAME="void"
    622 WIDTH="100%"
    623 CLASS="CALSTABLE"
    624 ><COL
    625 WIDTH="38%"
    626 TITLE="C1"><COL
    627 WIDTH="12%"
    628 TITLE="C2"><COL
    629 WIDTH="50%"
    630 TITLE="C3"><TBODY
    631 VALIGN="TOP"
    632 ><TR
    633 ><TD
    634 ><CODE
    635 CLASS="CONSTANT"
    636 >V4L2_TUNER_RADIO</CODE
    637 ></TD
    638 ><TD
    639 >1</TD
    640 ><TD
    641 >&nbsp;</TD
    642 ></TR
    643 ><TR
    644 ><TD
    645 ><CODE
    646 CLASS="CONSTANT"
    647 >V4L2_TUNER_ANALOG_TV</CODE
    648 ></TD
    649 ><TD
    650 >2</TD
    651 ><TD
    652 >&nbsp;</TD
    653 ></TR
    654 ></TBODY
    655 ></TABLE
    656 ></DIV
    657 ><DIV
    658 CLASS="TABLE"
    659 ><A
    660 NAME="TUNER-CAPABILITY"
    661 ></A
    662 ><P
    663 ><B
    664 >Table 3. Tuner and Modulator Capability Flags</B
    665 ></P
    666 ><TABLE
    667 BORDER="0"
    668 FRAME="void"
    669 WIDTH="100%"
    670 CLASS="CALSTABLE"
    671 ><COL
    672 WIDTH="38%"
    673 TITLE="C1"><COL
    674 WIDTH="12%"
    675 TITLE="C2"><COL
    676 WIDTH="50%"
    677 TITLE="C3"><TBODY
    678 VALIGN="TOP"
    679 ><TR
    680 ><TD
    681 ><CODE
    682 CLASS="CONSTANT"
    683 >V4L2_TUNER_CAP_LOW</CODE
    684 ></TD
    685 ><TD
    686 >0x0001</TD
    687 ><TD
    688 >When set, tuning frequencies are expressed in units of
    689 62.5&nbsp;Hz, otherwise in units of 62.5&nbsp;kHz.</TD
    690 ></TR
    691 ><TR
    692 ><TD
    693 ><CODE
    694 CLASS="CONSTANT"
    695 >V4L2_TUNER_CAP_NORM</CODE
    696 ></TD
    697 ><TD
    698 >0x0002</TD
    699 ><TD
    700 >This is a multi-standard tuner; the video standard
    701 can or must be switched. (B/G PAL tuners for example are typically not
    702       considered multi-standard because the video standard is automatically
    703       determined from the frequency band.) The set of supported video
    704       standards is available from the struct&nbsp;<A
    705 HREF="r8936.htm#V4L2-INPUT"
    706 >v4l2_input</A
    707 > pointing to this tuner,
    708       see the description of ioctl <A
    709 HREF="r8936.htm"
    710 ><CODE
    711 CLASS="CONSTANT"
    712 >VIDIOC_ENUMINPUT</CODE
    713 ></A
    714 > for details. Only
    715       <CODE
    716 CLASS="CONSTANT"
    717 >V4L2_TUNER_ANALOG_TV</CODE
    718 > tuners can have this capability.</TD
    719 ></TR
    720 ><TR
    721 ><TD
    722 ><CODE
    723 CLASS="CONSTANT"
    724 >V4L2_TUNER_CAP_STEREO</CODE
    725 ></TD
    726 ><TD
    727 >0x0010</TD
    728 ><TD
    729 >Stereo audio reception is supported.</TD
    730 ></TR
    731 ><TR
    732 ><TD
    733 ><CODE
    734 CLASS="CONSTANT"
    735 >V4L2_TUNER_CAP_LANG1</CODE
    736 ></TD
    737 ><TD
    738 >0x0040</TD
    739 ><TD
    740 >Reception of the primary language of a bilingual
    741 audio program is supported. Bilingual audio is a feature of
    742 two-channel systems, transmitting the primary language monaural on the
    743 main audio carrier and a secondary language monaural on a second
    744 carrier. Only
    745       <CODE
    746 CLASS="CONSTANT"
    747 >V4L2_TUNER_ANALOG_TV</CODE
    748 > tuners can have this capability.</TD
    749 ></TR
    750 ><TR
    751 ><TD
    752 ><CODE
    753 CLASS="CONSTANT"
    754 >V4L2_TUNER_CAP_LANG2</CODE
    755 ></TD
    756 ><TD
    757 >0x0020</TD
    758 ><TD
    759 >Reception of the secondary language of a bilingual
    760 audio program is supported. Only
    761       <CODE
    762 CLASS="CONSTANT"
    763 >V4L2_TUNER_ANALOG_TV</CODE
    764 > tuners can have this capability.</TD
    765 ></TR
    766 ><TR
    767 ><TD
    768 ><CODE
    769 CLASS="CONSTANT"
    770 >V4L2_TUNER_CAP_SAP</CODE
    771 ></TD
    772 ><TD
    773 >0x0020</TD
    774 ><TD
    775 ><P
    776 >Reception of a secondary audio program is
    777 supported. This is a feature of the BTSC system which accompanies the
    778 NTSC video standard. Two audio carriers are available for mono or
    779 stereo transmissions of a primary language, and an independent third
    780 carrier for a monaural secondary language. Only
    781       <CODE
    782 CLASS="CONSTANT"
    783 >V4L2_TUNER_ANALOG_TV</CODE
    784 > tuners can have this capability.</P
    785 ><P
    786 >Note the
    787 <CODE
    788 CLASS="CONSTANT"
    789 >V4L2_TUNER_CAP_LANG2</CODE
    790 > and
    791 <CODE
    792 CLASS="CONSTANT"
    793 >V4L2_TUNER_CAP_SAP</CODE
    794 > flags are synonyms.
    795 <CODE
    796 CLASS="CONSTANT"
    797 >V4L2_TUNER_CAP_SAP</CODE
    798 > applies when the tuner
    799 supports the <CODE
    800 CLASS="CONSTANT"
    801 >V4L2_STD_NTSC_M</CODE
    802 > video
    803 standard.</P
    804 ></TD
    805 ></TR
    806 ></TBODY
    807 ></TABLE
    808 ></DIV
    809 ><DIV
    810 CLASS="TABLE"
    811 ><A
    812 NAME="TUNER-RXSUBCHANS"
    813 ></A
    814 ><P
    815 ><B
    816 >Table 4. Tuner Audio Reception Flags</B
    817 ></P
    818 ><TABLE
    819 BORDER="0"
    820 FRAME="void"
    821 WIDTH="100%"
    822 CLASS="CALSTABLE"
    823 ><COL
    824 WIDTH="38%"
    825 TITLE="C1"><COL
    826 WIDTH="12%"
    827 TITLE="C2"><COL
    828 WIDTH="50%"
    829 TITLE="C3"><TBODY
    830 VALIGN="TOP"
    831 ><TR
    832 ><TD
    833 ><CODE
    834 CLASS="CONSTANT"
    835 >V4L2_TUNER_SUB_MONO</CODE
    836 ></TD
    837 ><TD
    838 >0x0001</TD
    839 ><TD
    840 >The tuner receives a mono audio signal.</TD
    841 ></TR
    842 ><TR
    843 ><TD
    844 ><CODE
    845 CLASS="CONSTANT"
    846 >V4L2_TUNER_SUB_STEREO</CODE
    847 ></TD
    848 ><TD
    849 >0x0002</TD
    850 ><TD
    851 >The tuner receives a stereo audio signal.</TD
    852 ></TR
    853 ><TR
    854 ><TD
    855 ><CODE
    856 CLASS="CONSTANT"
    857 >V4L2_TUNER_SUB_LANG1</CODE
    858 ></TD
    859 ><TD
    860 >0x0008</TD
    861 ><TD
    862 >The tuner receives the primary language of a
    863 bilingual audio signal. Drivers must clear this flag when the current
    864 video standard is <CODE
    865 CLASS="CONSTANT"
    866 >V4L2_STD_NTSC_M</CODE
    867 >.</TD
    868 ></TR
    869 ><TR
    870 ><TD
    871 ><CODE
    872 CLASS="CONSTANT"
    873 >V4L2_TUNER_SUB_LANG2</CODE
    874 ></TD
    875 ><TD
    876 >0x0004</TD
    877 ><TD
    878 >The tuner receives the secondary language of a
    879 bilingual audio signal (or a second audio program).</TD
    880 ></TR
    881 ><TR
    882 ><TD
    883 ><CODE
    884 CLASS="CONSTANT"
    885 >V4L2_TUNER_SUB_SAP</CODE
    886 ></TD
    887 ><TD
    888 >0x0004</TD
    889 ><TD
    890 >The tuner receives a Second Audio Program. Note the
    891 <CODE
    892 CLASS="CONSTANT"
    893 >V4L2_TUNER_SUB_LANG2</CODE
    894 > and
    895 <CODE
    896 CLASS="CONSTANT"
    897 >V4L2_TUNER_SUB_SAP</CODE
    898 > flags are synonyms. The
    899 <CODE
    900 CLASS="CONSTANT"
    901 >V4L2_TUNER_SUB_SAP</CODE
    902 > flag applies when the
    903 current video standard is <CODE
    904 CLASS="CONSTANT"
    905 >V4L2_STD_NTSC_M</CODE
    906 >.</TD
    907 ></TR
    908 ></TBODY
    909 ></TABLE
    910 ></DIV
    911 ><DIV
    912 CLASS="TABLE"
    913 ><A
    914 NAME="TUNER-AUDMODE"
    915 ></A
    916 ><P
    917 ><B
    918 >Table 5. Tuner Audio Modes</B
    919 ></P
    920 ><TABLE
    921 BORDER="0"
    922 FRAME="void"
    923 WIDTH="100%"
    924 CLASS="CALSTABLE"
    925 ><COL
    926 WIDTH="38%"
    927 TITLE="C1"><COL
    928 WIDTH="12%"
    929 TITLE="C2"><COL
    930 WIDTH="50%"
    931 TITLE="C3"><TBODY
    932 VALIGN="TOP"
    933 ><TR
    934 ><TD
    935 ><CODE
    936 CLASS="CONSTANT"
    937 >V4L2_TUNER_MODE_MONO</CODE
    938 ></TD
    939 ><TD
    940 >0</TD
    941 ><TD
    942 >Play mono audio. When the tuner receives a stereo
    943 signal this a down-mix of the left and right channel. When the tuner
    944 receives a bilingual or SAP signal this mode selects the primary
    945 language.</TD
    946 ></TR
    947 ><TR
    948 ><TD
    949 ><CODE
    950 CLASS="CONSTANT"
    951 >V4L2_TUNER_MODE_STEREO</CODE
    952 ></TD
    953 ><TD
    954 >1</TD
    955 ><TD
    956 ><P
    957 >Play stereo audio. When the tuner receives
    958 bilingual audio it may play different languages on the left and right
    959 channel or the primary language on both channels. behave as in mono
    960 mode.</P
    961 ><P
    962 >Playing different languages in this mode is
    963 deprecated. New drivers should do this only in
    964 <CODE
    965 CLASS="CONSTANT"
    966 >MODE_LANG1_LANG2</CODE
    967 >.</P
    968 ><P
    969 >When the tuner
    970 receives no stereo signal or does not support stereo reception the
    971 driver shall fall back to <CODE
    972 CLASS="CONSTANT"
    973 >MODE_MONO</CODE
    974 >.</P
    975 ></TD
    976 ></TR
    977 ><TR
    978 ><TD
    979 ><CODE
    980 CLASS="CONSTANT"
    981 >V4L2_TUNER_MODE_LANG1</CODE
    982 ></TD
    983 ><TD
    984 >3</TD
    985 ><TD
    986 >Play the primary language, mono or stereo. Only
    987 <CODE
    988 CLASS="CONSTANT"
    989 >V4L2_TUNER_ANALOG_TV</CODE
    990 > tuners support this
    991 mode.</TD
    992 ></TR
    993 ><TR
    994 ><TD
    995 ><CODE
    996 CLASS="CONSTANT"
    997 >V4L2_TUNER_MODE_LANG2</CODE
    998 ></TD
    999 ><TD
   1000 >2</TD
   1001 ><TD
   1002 >Play the secondary language, mono. When the tuner
   1003 receives no bilingual audio or SAP, or their reception is not
   1004 supported the driver shall fall back to mono or stereo mode. Only
   1005 <CODE
   1006 CLASS="CONSTANT"
   1007 >V4L2_TUNER_ANALOG_TV</CODE
   1008 > tuners support this
   1009 mode.</TD
   1010 ></TR
   1011 ><TR
   1012 ><TD
   1013 ><CODE
   1014 CLASS="CONSTANT"
   1015 >V4L2_TUNER_MODE_SAP</CODE
   1016 ></TD
   1017 ><TD
   1018 >2</TD
   1019 ><TD
   1020 >Play the Second Audio Program. When the tuner
   1021 receives no bilingual audio or SAP, or their reception is not
   1022 supported the driver shall fall back to mono or stereo mode. Only
   1023 <CODE
   1024 CLASS="CONSTANT"
   1025 >V4L2_TUNER_ANALOG_TV</CODE
   1026 > tuners support this mode.
   1027 Note the <CODE
   1028 CLASS="CONSTANT"
   1029 >V4L2_TUNER_MODE_LANG2</CODE
   1030 > and
   1031 <CODE
   1032 CLASS="CONSTANT"
   1033 >V4L2_TUNER_MODE_SAP</CODE
   1034 > are synonyms.</TD
   1035 ></TR
   1036 ><TR
   1037 ><TD
   1038 ><CODE
   1039 CLASS="CONSTANT"
   1040 >V4L2_TUNER_MODE_LANG1_LANG2</CODE
   1041 ></TD
   1042 ><TD
   1043 >4</TD
   1044 ><TD
   1045 >Play the primary language on the left channel, the
   1046 secondary language on the right channel. When the tuner receives no
   1047 bilingual audio or SAP, it shall fall back to
   1048 <CODE
   1049 CLASS="CONSTANT"
   1050 >MODE_LANG1</CODE
   1051 > or <CODE
   1052 CLASS="CONSTANT"
   1053 >MODE_MONO</CODE
   1054 >.
   1055 Only <CODE
   1056 CLASS="CONSTANT"
   1057 >V4L2_TUNER_ANALOG_TV</CODE
   1058 > tuners support this
   1059 mode.</TD
   1060 ></TR
   1061 ></TBODY
   1062 ></TABLE
   1063 ></DIV
   1064 ><DIV
   1065 CLASS="TABLE"
   1066 ><A
   1067 NAME="TUNER-MATRIX"
   1068 ></A
   1069 ><P
   1070 ><B
   1071 >Table 6. Tuner Audio Matrix</B
   1072 ></P
   1073 ><TABLE
   1074 BORDER="1"
   1075 FRAME="border"
   1076 WIDTH="100%"
   1077 CLASS="CALSTABLE"
   1078 ><COL
   1079 WIDTH="20%"
   1080 ALIGN="LEFT"><COL
   1081 WIDTH="20%"
   1082 TITLE="C2"><COL
   1083 WIDTH="20%"><COL
   1084 WIDTH="20%"><COL><COL
   1085 WIDTH="20%"
   1086 TITLE="C6"><THEAD
   1087 ><TR
   1088 ><TH
   1089 >&nbsp;</TH
   1090 ><TH
   1091 COLSPAN="5"
   1092 ALIGN="CENTER"
   1093 >Selected
   1094 <CODE
   1095 CLASS="CONSTANT"
   1096 >V4L2_TUNER_MODE_</CODE
   1097 ></TH
   1098 ></TR
   1099 ><TR
   1100 ><TH
   1101 >Received <CODE
   1102 CLASS="CONSTANT"
   1103 >V4L2_TUNER_SUB_</CODE
   1104 ></TH
   1105 ><TH
   1106 ><CODE
   1107 CLASS="CONSTANT"
   1108 >MONO</CODE
   1109 ></TH
   1110 ><TH
   1111 ><CODE
   1112 CLASS="CONSTANT"
   1113 >STEREO</CODE
   1114 ></TH
   1115 ><TH
   1116 ><CODE
   1117 CLASS="CONSTANT"
   1118 >LANG1</CODE
   1119 ></TH
   1120 ><TH
   1121 ><CODE
   1122 CLASS="CONSTANT"
   1123 >LANG2 = SAP</CODE
   1124 ></TH
   1125 ><TH
   1126 ><CODE
   1127 CLASS="CONSTANT"
   1128 >LANG1_LANG2</CODE
   1129 ><A
   1130 NAME="AEN12723"
   1131 HREF="r12342.htm#FTN.AEN12723"
   1132 ><SPAN
   1133 CLASS="footnote"
   1134 >[a]</SPAN
   1135 ></A
   1136 ></TH
   1137 ></TR
   1138 ></THEAD
   1139 ><TBODY
   1140 VALIGN="TOP"
   1141 ><TR
   1142 ><TD
   1143 ><CODE
   1144 CLASS="CONSTANT"
   1145 >MONO</CODE
   1146 ></TD
   1147 ><TD
   1148 >Mono</TD
   1149 ><TD
   1150 >Mono/Mono</TD
   1151 ><TD
   1152 >Mono</TD
   1153 ><TD
   1154 >Mono</TD
   1155 ><TD
   1156 >Mono/Mono</TD
   1157 ></TR
   1158 ><TR
   1159 ><TD
   1160 ><CODE
   1161 CLASS="CONSTANT"
   1162 >MONO | SAP</CODE
   1163 ></TD
   1164 ><TD
   1165 >Mono</TD
   1166 ><TD
   1167 >Mono/Mono</TD
   1168 ><TD
   1169 >Mono</TD
   1170 ><TD
   1171 >SAP</TD
   1172 ><TD
   1173 >Mono/SAP (preferred) or Mono/Mono</TD
   1174 ></TR
   1175 ><TR
   1176 ><TD
   1177 ><CODE
   1178 CLASS="CONSTANT"
   1179 >STEREO</CODE
   1180 ></TD
   1181 ><TD
   1182 >L+R</TD
   1183 ><TD
   1184 >L/R</TD
   1185 ><TD
   1186 >Stereo L/R (preferred) or Mono L+R</TD
   1187 ><TD
   1188 >Stereo L/R (preferred) or Mono L+R</TD
   1189 ><TD
   1190 >L/R (preferred) or L+R/L+R</TD
   1191 ></TR
   1192 ><TR
   1193 ><TD
   1194 ><CODE
   1195 CLASS="CONSTANT"
   1196 >STEREO | SAP</CODE
   1197 ></TD
   1198 ><TD
   1199 >L+R</TD
   1200 ><TD
   1201 >L/R</TD
   1202 ><TD
   1203 >Stereo L/R (preferred) or Mono L+R</TD
   1204 ><TD
   1205 >SAP</TD
   1206 ><TD
   1207 >L+R/SAP (preferred) or L/R or L+R/L+R</TD
   1208 ></TR
   1209 ><TR
   1210 ><TD
   1211 ><CODE
   1212 CLASS="CONSTANT"
   1213 >LANG1 | LANG2</CODE
   1214 ></TD
   1215 ><TD
   1216 >Language&nbsp;1</TD
   1217 ><TD
   1218 >Lang1/Lang2 (deprecated<A
   1219 NAME="AEN12763"
   1220 HREF="r12342.htm#FTN.AEN12763"
   1221 ><SPAN
   1222 CLASS="footnote"
   1223 >[b]</SPAN
   1224 ></A
   1225 >) or
   1226 Lang1/Lang1</TD
   1227 ><TD
   1228 >Language&nbsp;1</TD
   1229 ><TD
   1230 >Language&nbsp;2</TD
   1231 ><TD
   1232 >Lang1/Lang2 (preferred) or Lang1/Lang1</TD
   1233 ></TR
   1234 ></TBODY
   1235 ><TR
   1236 ><TD
   1237 COLSPAN="6"
   1238 >Notes:<BR><A
   1239 NAME="FTN.AEN12723"
   1240 >a. </A
   1241 >This
   1242 mode has been added in Linux 2.6.17 and may not be supported by older
   1243 drivers.<BR><A
   1244 NAME="FTN.AEN12763"
   1245 >b. </A
   1246 >Playback of
   1247 both languages in <CODE
   1248 CLASS="CONSTANT"
   1249 >MODE_STEREO</CODE
   1250 > is deprecated. In
   1251 the future drivers should produce only the primary language in this
   1252 mode. Applications should request
   1253 <CODE
   1254 CLASS="CONSTANT"
   1255 >MODE_LANG1_LANG2</CODE
   1256 > to record both languages or a
   1257 stereo signal.<BR></TD
   1258 ></TR
   1259 ></TABLE
   1260 ></DIV
   1261 ></DIV
   1262 ><DIV
   1263 CLASS="REFSECT1"
   1264 ><A
   1265 NAME="AEN12770"
   1266 ></A
   1267 ><H2
   1268 >Return Value</H2
   1269 ><P
   1270 >On success <SPAN
   1271 CLASS="RETURNVALUE"
   1272 >0</SPAN
   1273 > is returned, on error <SPAN
   1274 CLASS="RETURNVALUE"
   1275 >-1</SPAN
   1276 > and the <CODE
   1277 CLASS="VARNAME"
   1278 >errno</CODE
   1279 > variable is set appropriately:</P
   1280 ><P
   1281 ></P
   1282 ><DIV
   1283 CLASS="VARIABLELIST"
   1284 ><DL
   1285 ><DT
   1286 ><SPAN
   1287 CLASS="ERRORCODE"
   1288 >EINVAL</SPAN
   1289 ></DT
   1290 ><DD
   1291 ><P
   1292 >The struct&nbsp;<A
   1293 HREF="r12342.htm#V4L2-TUNER"
   1294 >v4l2_tuner</A
   1295 > <CODE
   1296 CLASS="STRUCTFIELD"
   1297 >index</CODE
   1298 > is
   1299 out of bounds.</P
   1300 ></DD
   1301 ></DL
   1302 ></DIV
   1303 ></DIV
   1304 ><DIV
   1305 CLASS="NAVFOOTER"
   1306 ><HR
   1307 ALIGN="LEFT"
   1308 WIDTH="100%"><TABLE
   1309 SUMMARY="Footer navigation table"
   1310 WIDTH="100%"
   1311 BORDER="0"
   1312 CELLPADDING="0"
   1313 CELLSPACING="0"
   1314 ><TR
   1315 ><TD
   1316 WIDTH="33%"
   1317 ALIGN="left"
   1318 VALIGN="top"
   1319 ><A
   1320 HREF="r12265.htm"
   1321 ACCESSKEY="P"
   1322 >Prev</A
   1323 ></TD
   1324 ><TD
   1325 WIDTH="34%"
   1326 ALIGN="center"
   1327 VALIGN="top"
   1328 ><A
   1329 HREF="book1.htm"
   1330 ACCESSKEY="H"
   1331 >Home</A
   1332 ></TD
   1333 ><TD
   1334 WIDTH="33%"
   1335 ALIGN="right"
   1336 VALIGN="top"
   1337 ><A
   1338 HREF="r12784.htm"
   1339 ACCESSKEY="N"
   1340 >Next</A
   1341 ></TD
   1342 ></TR
   1343 ><TR
   1344 ><TD
   1345 WIDTH="33%"
   1346 ALIGN="left"
   1347 VALIGN="top"
   1348 >ioctl VIDIOC_G_STD, VIDIOC_S_STD</TD
   1349 ><TD
   1350 WIDTH="34%"
   1351 ALIGN="center"
   1352 VALIGN="top"
   1353 ><A
   1354 HREF="r7624.htm"
   1355 ACCESSKEY="U"
   1356 >Up</A
   1357 ></TD
   1358 ><TD
   1359 WIDTH="33%"
   1360 ALIGN="right"
   1361 VALIGN="top"
   1362 >ioctl VIDIOC_LOG_STATUS</TD
   1363 ></TR
   1364 ></TABLE
   1365 ></DIV
   1366 ></BODY
   1367 ></HTML
   1368 >
   1369