Audio inputs and outputs are physical connectors of a device. Video capture devices have inputs, output devices have outputs, zero or more each. Radio devices have no audio inputs or outputs. They have exactly one tuner which in fact is an audio source, but this API associates tuners with video inputs or outputs only, and radio devices have none of these. A connector on a TV card to loop back the received audio signal to a sound card is not considered an audio output.
Audio and video inputs and outputs are associated. Selecting
a video source also selects an audio source. This is most evident when
the video and audio source is a tuner. Further audio connectors can
combine with more than one video input or output. Assumed two
composite video inputs and two audio inputs exist, there may be up to
four valid combinations. The relation of video and audio connectors
is defined in the
audioset field of the
respective struct v4l2_input or struct v4l2_output, where each bit represents
the index number, starting at zero, of one audio input or output.
To learn about the number and attributes of the
available inputs and outputs applications can enumerate them with the
VIDIOC_ENUMAUDOUT ioctl, respectively. The
struct v4l2_audio returned by the
also contains signal status information applicable when the current
audio input is queried.
VIDIOC_G_AUDOUT ioctls report
the current audio input and output, respectively. Note that, unlike
VIDIOC_G_OUTPUT these ioctls return a structure
VIDIOC_ENUMAUDOUT do, not just an index.
To select an audio input and change its properties
applications call the
VIDIOC_S_AUDIO ioctl. To select an audio
output (which presently has no changeable properties) applications
Drivers must implement all audio input ioctls when the device
has multiple selectable audio inputs, all audio output ioctls when the
device has multiple selectable audio outputs. When the device has any
audio inputs or outputs the driver must set the
flag in the struct v4l2_capability returned by the
Example 1.3. Information about the current audio input
Example 1.4. Switching to the first audio input