1 .. SPDX-License-Identifier: GFDL-1.1-no-invari 1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 2 .. c:namespace:: V4L 2 .. c:namespace:: V4L 3 3 4 .. _VIDIOC_G_AUDIO: 4 .. _VIDIOC_G_AUDIO: 5 5 6 ************************************ 6 ************************************ 7 ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO 7 ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO 8 ************************************ 8 ************************************ 9 9 10 Name 10 Name 11 ==== 11 ==== 12 12 13 VIDIOC_G_AUDIO - VIDIOC_S_AUDIO - Query or sel 13 VIDIOC_G_AUDIO - VIDIOC_S_AUDIO - Query or select the current audio input and its attributes 14 14 15 Synopsis 15 Synopsis 16 ======== 16 ======== 17 17 18 .. c:macro:: VIDIOC_G_AUDIO 18 .. c:macro:: VIDIOC_G_AUDIO 19 19 20 ``int ioctl(int fd, VIDIOC_G_AUDIO, struct v4l 20 ``int ioctl(int fd, VIDIOC_G_AUDIO, struct v4l2_audio *argp)`` 21 21 22 .. c:macro:: VIDIOC_S_AUDIO 22 .. c:macro:: VIDIOC_S_AUDIO 23 23 24 ``int ioctl(int fd, VIDIOC_S_AUDIO, const stru 24 ``int ioctl(int fd, VIDIOC_S_AUDIO, const struct v4l2_audio *argp)`` 25 25 26 Arguments 26 Arguments 27 ========= 27 ========= 28 28 29 ``fd`` 29 ``fd`` 30 File descriptor returned by :c:func:`open( 30 File descriptor returned by :c:func:`open()`. 31 31 32 ``argp`` 32 ``argp`` 33 Pointer to struct :c:type:`v4l2_audio`. 33 Pointer to struct :c:type:`v4l2_audio`. 34 34 35 Description 35 Description 36 =========== 36 =========== 37 37 38 To query the current audio input applications 38 To query the current audio input applications zero out the ``reserved`` 39 array of a struct :c:type:`v4l2_audio` and cal 39 array of a struct :c:type:`v4l2_audio` and call the 40 :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` ioctl w 40 :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` ioctl with a pointer to this structure. Drivers fill 41 the rest of the structure or return an ``EINVA 41 the rest of the structure or return an ``EINVAL`` error code when the device 42 has no audio inputs, or none which combine wit 42 has no audio inputs, or none which combine with the current video input. 43 43 44 Audio inputs have one writable property, the a 44 Audio inputs have one writable property, the audio mode. To select the 45 current audio input *and* change the audio mod 45 current audio input *and* change the audio mode, applications initialize 46 the ``index`` and ``mode`` fields, and the ``r 46 the ``index`` and ``mode`` fields, and the ``reserved`` array of a 47 struct :c:type:`v4l2_audio` structure and call 47 struct :c:type:`v4l2_audio` structure and call the :ref:`VIDIOC_S_AUDIO <VIDIOC_G_AUDIO>` 48 ioctl. Drivers may switch to a different audio 48 ioctl. Drivers may switch to a different audio mode if the request 49 cannot be satisfied. However, this is a write- 49 cannot be satisfied. However, this is a write-only ioctl, it does not 50 return the actual new audio mode. 50 return the actual new audio mode. 51 51 52 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm 52 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}| 53 53 54 .. c:type:: v4l2_audio 54 .. c:type:: v4l2_audio 55 55 56 .. flat-table:: struct v4l2_audio 56 .. flat-table:: struct v4l2_audio 57 :header-rows: 0 57 :header-rows: 0 58 :stub-columns: 0 58 :stub-columns: 0 59 :widths: 1 1 2 59 :widths: 1 1 2 60 60 61 * - __u32 61 * - __u32 62 - ``index`` 62 - ``index`` 63 - Identifies the audio input, set by the 63 - Identifies the audio input, set by the driver or application. 64 * - __u8 64 * - __u8 65 - ``name``\ [32] 65 - ``name``\ [32] 66 - Name of the audio input, a NUL-termina 66 - Name of the audio input, a NUL-terminated ASCII string, for 67 example: "Line In". This information i 67 example: "Line In". This information is intended for the user, 68 preferably the connector label on the 68 preferably the connector label on the device itself. 69 * - __u32 69 * - __u32 70 - ``capability`` 70 - ``capability`` 71 - Audio capability flags, see :ref:`audi 71 - Audio capability flags, see :ref:`audio-capability`. 72 * - __u32 72 * - __u32 73 - ``mode`` 73 - ``mode`` 74 - Audio mode flags set by drivers and ap 74 - Audio mode flags set by drivers and applications (on 75 :ref:`VIDIOC_S_AUDIO <VIDIOC_G_AUDIO>` 75 :ref:`VIDIOC_S_AUDIO <VIDIOC_G_AUDIO>` ioctl), see :ref:`audio-mode`. 76 * - __u32 76 * - __u32 77 - ``reserved``\ [2] 77 - ``reserved``\ [2] 78 - Reserved for future extensions. Driver 78 - Reserved for future extensions. Drivers and applications must set 79 the array to zero. 79 the array to zero. 80 80 81 81 82 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm 82 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}| 83 83 84 .. _audio-capability: 84 .. _audio-capability: 85 85 86 .. flat-table:: Audio Capability Flags 86 .. flat-table:: Audio Capability Flags 87 :header-rows: 0 87 :header-rows: 0 88 :stub-columns: 0 88 :stub-columns: 0 89 :widths: 3 1 4 89 :widths: 3 1 4 90 90 91 * - ``V4L2_AUDCAP_STEREO`` 91 * - ``V4L2_AUDCAP_STEREO`` 92 - 0x00001 92 - 0x00001 93 - This is a stereo input. The flag is in 93 - This is a stereo input. The flag is intended to automatically 94 disable stereo recording etc. when the 94 disable stereo recording etc. when the signal is always monaural. 95 The API provides no means to detect if 95 The API provides no means to detect if stereo is *received*, 96 unless the audio input belongs to a tu 96 unless the audio input belongs to a tuner. 97 * - ``V4L2_AUDCAP_AVL`` 97 * - ``V4L2_AUDCAP_AVL`` 98 - 0x00002 98 - 0x00002 99 - Automatic Volume Level mode is support 99 - Automatic Volume Level mode is supported. 100 100 101 101 102 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm 102 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}| 103 103 104 .. _audio-mode: 104 .. _audio-mode: 105 105 106 .. flat-table:: Audio Mode Flags 106 .. flat-table:: Audio Mode Flags 107 :header-rows: 0 107 :header-rows: 0 108 :stub-columns: 0 108 :stub-columns: 0 109 :widths: 3 1 4 109 :widths: 3 1 4 110 110 111 * - ``V4L2_AUDMODE_AVL`` 111 * - ``V4L2_AUDMODE_AVL`` 112 - 0x00001 112 - 0x00001 113 - AVL mode is on. 113 - AVL mode is on. 114 114 115 Return Value 115 Return Value 116 ============ 116 ============ 117 117 118 On success 0 is returned, on error -1 and the 118 On success 0 is returned, on error -1 and the ``errno`` variable is set 119 appropriately. The generic error codes are des 119 appropriately. The generic error codes are described at the 120 :ref:`Generic Error Codes <gen-errors>` chapte 120 :ref:`Generic Error Codes <gen-errors>` chapter. 121 121 122 EINVAL 122 EINVAL 123 No audio inputs combine with the current v 123 No audio inputs combine with the current video input, or the number 124 of the selected audio input is out of boun 124 of the selected audio input is out of bounds or it does not combine.
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.