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_AUDOUT, VIDIOC_S_AUDOUT</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_AUDIO, VIDIOC_S_AUDIO" 17HREF="r9539.htm"><LINK 18REL="NEXT" 19TITLE="ioctl VIDIOC_G_CHIP_IDENT" 20HREF="r9804.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="r9539.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="r9804.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-AUDIOOUT" 74></A 75>ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT</H1 76><DIV 77CLASS="REFNAMEDIV" 78><A 79NAME="AEN9692" 80></A 81><H2 82>Name</H2 83>VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT -- Query or select the current audio output</DIV 84><DIV 85CLASS="REFSYNOPSISDIV" 86><A 87NAME="AEN9696" 88></A 89><H2 90>Synopsis</H2 91><DIV 92CLASS="FUNCSYNOPSIS" 93><P 94></P 95><A 96NAME="AEN9697" 97></A 98><P 99><CODE 100><CODE 101CLASS="FUNCDEF" 102>int ioctl</CODE 103>(int fd, int request, struct v4l2_audioout *argp);</CODE 104></P 105><P 106></P 107></DIV 108><DIV 109CLASS="FUNCSYNOPSIS" 110><P 111></P 112><A 113NAME="AEN9707" 114></A 115><P 116><CODE 117><CODE 118CLASS="FUNCDEF" 119>int ioctl</CODE 120>(int fd, int request, const struct v4l2_audioout *argp);</CODE 121></P 122><P 123></P 124></DIV 125></DIV 126><DIV 127CLASS="REFSECT1" 128><A 129NAME="AEN9717" 130></A 131><H2 132>Arguments</H2 133><P 134></P 135><DIV 136CLASS="VARIABLELIST" 137><DL 138><DT 139><CODE 140CLASS="PARAMETER" 141>fd</CODE 142></DT 143><DD 144><P 145>File descriptor returned by <A 146HREF="r14090.htm" 147><CODE 148CLASS="FUNCTION" 149>open()</CODE 150></A 151>.</P 152></DD 153><DT 154><CODE 155CLASS="PARAMETER" 156>request</CODE 157></DT 158><DD 159><P 160>VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT</P 161></DD 162><DT 163><CODE 164CLASS="PARAMETER" 165>argp</CODE 166></DT 167><DD 168><P 169></P 170></DD 171></DL 172></DIV 173></DIV 174><DIV 175CLASS="REFSECT1" 176><A 177NAME="AEN9737" 178></A 179><H2 180>Description</H2 181><P 182>To query the current audio output applications zero out the 183<CODE 184CLASS="STRUCTFIELD" 185>reserved</CODE 186> array of a struct <A 187HREF="r9688.htm#V4L2-AUDIOOUT" 188>v4l2_audioout</A 189> and 190call the <CODE 191CLASS="CONSTANT" 192>VIDIOC_G_AUDOUT</CODE 193> ioctl with a pointer 194to this structure. Drivers fill the rest of the structure or return an 195<SPAN 196CLASS="ERRORCODE" 197>EINVAL</SPAN 198> error code when the device has no audio inputs, or none which combine 199with the current video output.</P 200><P 201>Audio outputs have no writable properties. Nevertheless, to 202select the current audio output applications can initialize the 203<CODE 204CLASS="STRUCTFIELD" 205>index</CODE 206> field and 207<CODE 208CLASS="STRUCTFIELD" 209>reserved</CODE 210> array (which in the future may 211contain writable properties) of a 212<CODE 213CLASS="STRUCTNAME" 214>v4l2_audioout</CODE 215> structure and call the 216<CODE 217CLASS="CONSTANT" 218>VIDIOC_S_AUDOUT</CODE 219> ioctl. Drivers switch to the 220requested output or return the <SPAN 221CLASS="ERRORCODE" 222>EINVAL</SPAN 223> error code when the index is out of 224bounds. This is a write-only ioctl, it does not return the current 225audio output attributes as <CODE 226CLASS="CONSTANT" 227>VIDIOC_G_AUDOUT</CODE 228> 229does.</P 230><P 231>Note connectors on a TV card to loop back the received audio 232signal to a sound card are not audio outputs in this sense.</P 233><DIV 234CLASS="TABLE" 235><A 236NAME="V4L2-AUDIOOUT" 237></A 238><P 239><B 240>Table 1. struct <CODE 241CLASS="STRUCTNAME" 242>v4l2_audioout</CODE 243></B 244></P 245><TABLE 246BORDER="0" 247FRAME="void" 248WIDTH="100%" 249CLASS="CALSTABLE" 250><COL 251WIDTH="25%" 252TITLE="C1"><COL 253WIDTH="25%" 254TITLE="C2"><COL 255WIDTH="50%" 256TITLE="C3"><TBODY 257VALIGN="TOP" 258><TR 259><TD 260>__u32</TD 261><TD 262><CODE 263CLASS="STRUCTFIELD" 264>index</CODE 265></TD 266><TD 267>Identifies the audio output, set by the 268driver or application.</TD 269></TR 270><TR 271><TD 272>__u8</TD 273><TD 274><CODE 275CLASS="STRUCTFIELD" 276>name</CODE 277>[32]</TD 278><TD 279>Name of the audio output, a NUL-terminated ASCII 280string, for example: "Line Out". This information is intended for the 281user, preferably the connector label on the device itself.</TD 282></TR 283><TR 284><TD 285>__u32</TD 286><TD 287><CODE 288CLASS="STRUCTFIELD" 289>capability</CODE 290></TD 291><TD 292>Audio capability flags, none defined yet. Drivers 293must set this field to zero.</TD 294></TR 295><TR 296><TD 297>__u32</TD 298><TD 299><CODE 300CLASS="STRUCTFIELD" 301>mode</CODE 302></TD 303><TD 304>Audio mode, none defined yet. Drivers and 305applications (on <CODE 306CLASS="CONSTANT" 307>VIDIOC_S_AUDOUT</CODE 308>) must set this 309field to zero.</TD 310></TR 311><TR 312><TD 313>__u32</TD 314><TD 315><CODE 316CLASS="STRUCTFIELD" 317>reserved</CODE 318>[2]</TD 319><TD 320>Reserved for future extensions. Drivers and 321applications must set the array to zero.</TD 322></TR 323></TBODY 324></TABLE 325></DIV 326></DIV 327><DIV 328CLASS="REFSECT1" 329><A 330NAME="AEN9787" 331></A 332><H2 333>Return Value</H2 334><P 335>On success <SPAN 336CLASS="RETURNVALUE" 337>0</SPAN 338> is returned, on error <SPAN 339CLASS="RETURNVALUE" 340>-1</SPAN 341> and the <CODE 342CLASS="VARNAME" 343>errno</CODE 344> variable is set appropriately:</P 345><P 346></P 347><DIV 348CLASS="VARIABLELIST" 349><DL 350><DT 351><SPAN 352CLASS="ERRORCODE" 353>EINVAL</SPAN 354></DT 355><DD 356><P 357>No audio outputs combine with the current video 358output, or the number of the selected audio output is out of bounds or 359it does not combine, or there are no audio outputs at all and the 360ioctl is not supported.</P 361></DD 362><DT 363><SPAN 364CLASS="ERRORCODE" 365>EBUSY</SPAN 366></DT 367><DD 368><P 369>I/O is in progress, the output cannot be 370switched.</P 371></DD 372></DL 373></DIV 374></DIV 375><DIV 376CLASS="NAVFOOTER" 377><HR 378ALIGN="LEFT" 379WIDTH="100%"><TABLE 380SUMMARY="Footer navigation table" 381WIDTH="100%" 382BORDER="0" 383CELLPADDING="0" 384CELLSPACING="0" 385><TR 386><TD 387WIDTH="33%" 388ALIGN="left" 389VALIGN="top" 390><A 391HREF="r9539.htm" 392ACCESSKEY="P" 393>Prev</A 394></TD 395><TD 396WIDTH="34%" 397ALIGN="center" 398VALIGN="top" 399><A 400HREF="book1.htm" 401ACCESSKEY="H" 402>Home</A 403></TD 404><TD 405WIDTH="33%" 406ALIGN="right" 407VALIGN="top" 408><A 409HREF="r9804.htm" 410ACCESSKEY="N" 411>Next</A 412></TD 413></TR 414><TR 415><TD 416WIDTH="33%" 417ALIGN="left" 418VALIGN="top" 419>ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO</TD 420><TD 421WIDTH="34%" 422ALIGN="center" 423VALIGN="top" 424><A 425HREF="r7624.htm" 426ACCESSKEY="U" 427>Up</A 428></TD 429><TD 430WIDTH="33%" 431ALIGN="right" 432VALIGN="top" 433>ioctl VIDIOC_G_CHIP_IDENT</TD 434></TR 435></TABLE 436></DIV 437></BODY 438></HTML 439> 440