Ioctl Requests audiosupport(7I)
NAME
audiosupport - audio driver support routines and interface
SYNOPSIS
#include
DESCRIPTION
The audio support module supports audio drivers that use
the new audio driver architecture. It also provides a lim-
ited number of ioctl(2) functions for application program-
mers.
DATA STRUCTURES
The following data structures are defined to manage the dif-
ferent audio device types and channels.
Device Types
The following enumeration lists a number of generic device
types.
typedef enum {
UNDEFINED, AUDIO, AUDIOCTL, USER1, USER2, USER3
} audiodevicetypee;
Currently, the Solaris audio mixer implements only the AUDIO
and AUDIOCTL audio device types. See the mixer(7I) manual
page for details. The USER1, USER2 and USER3 device types
allow third parties to write audio personality modules of
their own.
Channel Structure
This structure is used to get and set state information on
individual channels.
struct audiochannel {
pidt pid; /* application's process ID */
uintt chnumber; /* device channel */
audiodevicetypee devtype; /* device type */
uintt infosize; /* size of channel's */
/* info structure */
void *info; /* channel state information */
;
typedef struct audiochannel audiochannelt;
The chnumber must specify the specific channel number to
get or set. When the ioctl() returns, the pid contains the
process ID of the process that has that channel open and
SunOS 5.11 Last change: 2 January 2002 1
Ioctl Requests audiosupport(7I)
devtype will contain the device type. If pid is 0 (zero),
then the channel is not open. The pointer *info must point
to a buffer large enough to hold whatever audio device-
related state structure that may be returned. Currently,
only the audioinfot structure is returned. See the
audio(7I) and mixer(7I) man pages for more information.
IOCTLS
The audio support driver provides the following ioctls():
AUDIOGETCHNUMBER This ioctl() returns the channel
number pointed to by the file
descriptor. It is returned in the
integer pointer of the ioctl() argu-
ment.
AUDIOGETCHTYPE This ioctl() returns the type of
channel the process has open. It is
returned in the audiodevicetypee
enumeration pointer of the ioctl()
argument.
AUDIOGETNUMCHS This ioctl() returns the number of
channels the device supports. It is
returned in the integer pointer of the
ioctl() argument.
MACROS
The following macro can be used to initialize data struc-
tures. The established convention is that the state
corresponding to a field set to -1 will not be modified.
AUDIOINIT(I, S)
Where I is a pointer to an info structure and S is the size
of that structure.
The following code segment demonstrates how to use this
macro:
audioinfot info;
AUDIOINIT(&info, sizeof(info));
info.play.port = AUDIOHEADPHONE;
err = ioctl(audiofd, AUDIOSETINFO, &info);
SunOS 5.11 Last change: 2 January 2002 2
Ioctl Requests audiosupport(7I)
ERORS
EINVAL The ioctl() is invalid for this file descriptor.
The audiochannelt structure's info pointer does
not point to a buffer, or the chnumber is bad.
ENOMEM The ioctl() failed due to lack of memory.
FILES
/usr/share/audio/samples Audio sample files
ATRIBUTES
See attributes(5) for a description of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Architecture SPARC, x86
Availability SUNWaudd, SUNWauddx, SUNWaudh
Stability Level Evolving
SEE ALSO
ioctl(2), attributes(5), audio(7I), mixer(7I), streamio(7I)
FUTURE DIRECTIONS
Over time, additional audio personality modules will be
added. Audio application programmers are encouraged to
review this man page with each Solaris release for new audio
personality modules.
SunOS 5.11 Last change: 2 January 2002 3
|