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