NAME | SYNOPSIS | DESCRIPTION | DATA STRUCTURES | IOCTLS | MACROS | ERRORS | FILES | ATTRIBUTES | SEE ALSO | FUTURE DIRECTIONS
#include <sys/audio.h>
The audio support driver supports audio drivers that use the new audio driver audio driver architecture. It also provides a limited number of ioctl(2)s for application programmers.
The following data structures are defined to manage the different audio devices types and their channels.
typedef enum { UNDEFINED, AUDIO, AUDIOCTL, USER1, USER2, USER3 } audio_device_type_e;
At this time, Solaris implements only the AUDIO and AUDIOCTL audio device types, using the audio mixer, see mixer(7I) for details. The USER1, USER2, and USER3 device types allow third parties to write audio personality modules of their own.
struct audio_channel { pid_t pid; /* application's porcess ID */ uint_t ch_number; /* channel this device is using */ audio_device_type_e dev_type; /* the device type */ uint_t info_size; /* size of the channel's info structure */ void *info; /* the channel's state information */ } audio_channel_t;
The ch_number must be set to the specific channel number to get or set. When the ioctl() returns the pid will contain the process ID of the process that has the channel open and dev_type will contain the type of the device. 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 may be returned. At this time there is only the audio_info_t structure, see the audio(7I) and mixer(7I) man pages.
The audio support driver provides the following ioctls():
This ioctl() returns the channel number the file descriptor represents in the integer pointed to by the ioctl() argument.
This ioctl() returns the type of channel the process has open via the audio_device_type_e enumeration pointed to by the ioctl() argument.
This ioctl() returns the number of channels the device supports in the integer pointed to by the ioctl() argument.
The following macro can be used to initialize data structures. The established convention is that the state corresponding to a field set to -1 will not be modified.
AUDIO_INIT(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:
audio_info_t info; AUDIO_INIT(&info, sizeof(info)); info.play.port = AUDIO_HEADPHONE; err = ioct(audio_fd, AUDIO_SETINFO, &info);
The ioctl() is invalid for this file descriptor, the audio_channel_t structure's info pointer doesn't point to a buffer or the ch_number is bad.
The ioctl() failed due to lack of memory.
See attributes(5) for a description of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Architecture | SPARC |
Availability | SUNWaudd, SUNWauddx, SUNWaudh |
Stability Level | Evolving |
Over time additional audio personallity modules will be added. The audio application programmer is encouraged to review this man page on each Solaris release for new audio personality modules.
NAME | SYNOPSIS | DESCRIPTION | DATA STRUCTURES | IOCTLS | MACROS | ERRORS | FILES | ATTRIBUTES | SEE ALSO | FUTURE DIRECTIONS