![]() |
![]()
| ![]() |
![]()
NAME
SYNOPSIS
struct sioctl_hdl *
void
int
int
int
int
int
int
int
DESCRIPTIONAudio devices may expose a number of controls, like the playback volume control. Each control has an integer address and an integer value. Some values are boolean and can only be switched to either 0 (off) or 1 (on). Any control may be changed by submitting a new value to its address. When values change, asynchronous notifications are sent. Control descriptions are available, allowing them to be grouped and represented in a human readable form. Opening and closing the control deviceFirst the application must call the
The name parameter gives the device string
discussed in
sndio(7).
In most cases it should be set to SIO_DEVANY to allow the user to select it
using the If the nbio_flag argument
is 1, then the
The
Control descriptionsThe
Then, whenever a control description changes, the callback is
invoked with the updated information followed by a call with a
Controls are described by the sioctl_desc structure as follows: struct sioctl_node { char name[SIOCTL_NAMEMAX]; /* ex. "spkr" */ int unit; /* optional number or -1 */ }; struct sioctl_desc { unsigned int addr; /* control address */ #define SIOCTL_NONE 0 /* deleted */ #define SIOCTL_NUM 2 /* integer in the maxval range */ #define SIOCTL_SW 3 /* on/off switch (1 or 0) */ #define SIOCTL_VEC 4 /* number, element of vector */ #define SIOCTL_LIST 5 /* switch, element of a list */ #define SIOCTL_SEL 6 /* element of a selector */ unsigned int type; /* one of above */ char func[SIOCTL_NAMEMAX]; /* function name, ex. "level" */ char group[SIOCTL_NAMEMAX]; /* group this control belongs to */ struct sioctl_node node0; /* affected node */ struct sioctl_node node1; /* dito for SIOCTL_{VEC,LIST,SEL} */ unsigned int maxval; /* max value */ char display[SIOCTL_DISPLAYMAX]; /* free-format hint */ }; The addr attribute is
the control address, usable with
The type attribute indicates what the structure describes. Possible types are:
The func attribute is the name of the parameter being controlled. There may be no parameters of different types with the same name. The node0 and node1
attributes indicate the names of the controlled nodes, typically channels of
audio streams. node1 is meaningful for
Names in the node0 and node1 attributes and func are strings usable as unique identifiers within the given group. The maxval attribute indicates the maximum value of this control. For boolean control types it is set to 1. The display attribute contains an optional free-format string providing additional hints about the control, like the hardware model, or the units. Changing and reading control valuesControls are changed with the
Interface to poll(2)The The
ENVIRONMENT
SEE ALSOHISTORYThese functions first appeared in OpenBSD 6.7. AUTHORSAlexandre Ratchov <ratchov@openbsd.org>
|