audioio.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1995-2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _SYS_AUDIOIO_H
#define _SYS_AUDIOIO_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* These are the ioctl calls for all Solaris audio devices, including
* the x86 and SPARCstation audio devices.
*
* You are encouraged to design your code in a modular fashion so that
* future changes to the interface can be incorporated with little
* trouble.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* This structure contains state information for audio device IO streams.
*/
struct audio_prinfo {
/*
* The following values describe the audio data encoding.
*/
/*
* The following values control audio device configuration
*/
/*
* The following values describe driver state
*/
/*
* The following values are read-only state flags
*/
};
typedef struct audio_prinfo audio_prinfo_t;
/*
* This structure describes the current state of the audio device.
*/
struct audio_info {
/*
* Per-stream information
*/
/*
*/
};
typedef struct audio_info audio_info_t;
/*
* Audio encoding types
*/
#define AUDIO_ENCODING_NONE (0) /* no encoding assigned */
/*
* These ranges apply to record, play, and monitor gain values
*/
#define AUDIO_MIN_GAIN (0) /* minimum gain value */
/*
* These values apply to the balance field to adjust channel gain values
*/
#define AUDIO_LEFT_BALANCE (0) /* left channel only */
#define AUDIO_BALANCE_SHIFT (3)
/*
*/
#define AUDIO_CHANNELS_MONO (1)
#define AUDIO_CHANNELS_STEREO (2)
#define AUDIO_MIN_PLAY_CHANNELS (AUDIO_CHANNELS_MONO)
#define AUDIO_MAX_PLAY_CHANNELS (AUDIO_CHANNELS_STEREO)
#define AUDIO_MIN_REC_CHANNELS (AUDIO_CHANNELS_MONO)
#define AUDIO_MAX_REC_CHANNELS (AUDIO_CHANNELS_STEREO)
/*
*/
#define AUDIO_PRECISION_8 (8)
#define AUDIO_PRECISION_16 (16)
#define AUDIO_MIN_PLAY_PRECISION (8)
#define AUDIO_MAX_PLAY_PRECISION (32)
#define AUDIO_MIN_REC_PRECISION (8)
#define AUDIO_MAX_REC_PRECISION (32)
/*
* Define some convenient names for typical audio ports
*/
/*
* output ports (several may be enabled simultaneously)
*/
/*
* input ports (usually only one at a time)
*/
/*
* Define the hw_features
*/
/*
* Define the sw_features
*/
/*
* This macro initializes an audio_info structure to 'harmless' values.
* Note that (~0) might not be a harmless value for a flag that was
* a signed int.
*/
#define AUDIO_INITINFO(i) { \
(char *)__x__ < (((char *)(i)) + sizeof (audio_info_t)); \
*__x__++ = ~0); \
}
/*
* Parameter for the AUDIO_GETDEV ioctl to determine current
* audio devices.
*/
#define MAX_AUDIO_DEV_LEN (16)
struct audio_device {
char name[MAX_AUDIO_DEV_LEN];
char version[MAX_AUDIO_DEV_LEN];
char config[MAX_AUDIO_DEV_LEN];
};
typedef struct audio_device audio_device_t;
/*
* Ioctl calls for the audio device.
*/
/*
* AUDIO_GETINFO retrieves the current state of the audio device.
*
* AUDIO_SETINFO copies all fields of the audio_info structure whose
* values are not set to the initialized value (-1) to the device state.
* It performs an implicit AUDIO_GETINFO to return the new state of the
* to the last value before the AUDIO_SETINFO took effect. This allows
* an application to reset the counters while atomically retrieving the
* last value.
*
* AUDIO_DRAIN suspends the calling process until the write buffers are
* empty.
*
* AUDIO_GETDEV returns a structure of type audio_device_t which contains
* three strings. The string "name" is a short identifying string (for
* example, the SBus Fcode name string), the string "version" identifies
* the current version of the device, and the "config" string identifies
* the specific configuration of the audio stream. All fields are
* device-dependent -- see the device specific manual pages for details.
*/
/*
* The following ioctl sets the audio device into an internal loopback mode,
* if the hardware supports this. The argument is TRUE to set loopback,
* FALSE to reset to normal operation. If the hardware does not support
* internal loopback, the ioctl should fail with EINVAL.
*/
/*
* Structure sent up as a M_PROTO message on trace streams
*/
struct audtrace_hdr {
int type; /* device-dependent */
#else
#endif
};
typedef struct audtrace_hdr audtrace_hdr_t;
#ifdef __cplusplus
}
#endif
#endif /* _SYS_AUDIOIO_H */