Technical data

SunOS 5.5 Ioctl Requests audio(7I)
audio output to the normal state. Most audio devices allow input data to be monitored
by mixing audio input onto the output channel. The monitor_gain field controls the level
of this feedback path.
The play.port field controls the output path for the audio device. It can be set to either
AUDIO_SPEAKER (built-in speaker), AUDIO_HEADPHONE (headphone jack), or
AUDIO_LINE_OUT (line-out port). For some devices, it may be set to a combination of
these ports. The play.avail_ports field returns the set of output ports that are currently
accessible. The input ports can be eitherAUDIO_MICROPHONE or AUDIO_LINE_IN.
The record.avail_ports field returns the set of input ports that are currently accessible.
The play.balance and record.balance fields are used to control the volume between the left
and right channels when manipulating stereo data. When the value is set between
AUDIO_LEFT_BALANCE and AUDIO_MID_BALANCE, the right channel volume will be
reduced in proportion to the balance value. Conversely, when balance is set between
AUDIO_MID_BALANCE and AUDIO_RIGHT_BALANCE, the left channelwill be propor-
tionally reduced.
The play.pause and record.pause flags may be used to pause and resume the transfer of
data between the audio device and the STREAMS buffers. The play.error and record.error
flags indicate that data underflow or overflow has occurred. The play.active and
record.active flags indicate that data transfer is currently active in the corresponding direc-
tion.
The play.open and record.open flags indicate that the device is currently open with the
corresponding access permission. The play.waiting and record.waiting flags provide an
indication that a process may be waiting to access the device. These flags are set
automatically when a process blocks on open(), though they may also be set using the
AUDIO_SETINFO ioctl command. They are cleared only when a process relinquishes
access by closing the device.
The play.samples and record.samples fields are initialized, at open(), to zero and increment
each time a data sample is copied to or from the associated STREAMS queue. Some audio
drivers may be limited to counting buffers of samples, instead of single samples for the
samples accounting. For this reason, applications should not assume that thesamples
fields contain a perfectly accurate count. The play.eof field increments whenever a zero-
length output buffer is synchronously processed. Applications may use this field to
detect the completion of particular segments of audio output.
The record.buffer_size field controls the amount of input data that is buffered in the device
driver during record operations. Applications that have particular requirements for low
latency should set the value appropriately. Note however that smaller input buffer sizes
may result in higher system overhead. The value of this field is specified in bytes and
drivers will constrain it to be a multiple of the current sample frame size. Some drivers
may place other requirements on the value of this field. Refer to the audio device-specific
manual page for more details. If an application changes the format of the audio device
and does not modify the record.buffer_size field, the device driver may use a default value
to compensate for the new data rate. Therefore, if an application wishes to modify this
field, it should modify it during or after the format change itself, not before. The
modified 21 Mar 1995 7I-29