/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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) 4Front Technologies 1996-2008.
*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_AUDIO_OSS_H
#define _SYS_AUDIO_OSS_H
/*
* devices.
*
* Note that the contents of this file include definitions which exist
* primarily for compatibility. Many of the defines here are not
* actually implemented, but exist solely to facilitate compilation of
* programs from other operating systems. Other definitions here may
* not be fully supported or may otherwise be obsolete. There are many
* things in this file which should not be used on SunOS.
*
* Please read the documentation to determine which portions of the
* API are fully supported and recommended for use in new
* applications.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Buffer status queries.
* SNDCTL_DSP_GETOSPACE and SNDCTL_DSP_GETISPACE
*/
typedef struct audio_buf_info {
/* Note! 'bytes' could be more than fragments*fragsize */
/*
* Sync groups for audio devices.
* SNDCTL_DSP_SYNCGROUP and SNDCTL_DSP_SYNCSTART
*/
typedef struct oss_syncgroup {
int id;
int mode;
/*
* SNDCTL_DSP_GETERROR
*/
typedef struct audio_errinfo {
int play_underruns;
int rec_overruns;
unsigned int play_ptradjust;
unsigned int rec_ptradjust;
int play_errorcount;
int rec_errorcount;
int play_lasterror;
int rec_lasterror;
int play_errorparm;
int rec_errorparm;
/*
* SNDCTL_DSP_GETIPTR and SNDCTL_DSP_GETOPTR
*/
typedef struct count_info {
} count_info;
/*
* SNDCTL_DSP_CURENT_IPTR and SNDCTL_DSP_CURRENT_OPTR
*/
typedef struct {
} oss_count_t;
/*
* SNDCTL_DSP_GET_RECSRC_NAMES and SNDCTL_DSP_GET_PLAYTGT_NAMES
*/
typedef struct oss_mixer_enuminfo {
int dev;
int ctrl;
int nvalues;
int version;
/*
* SNDCTL_DSP_READCTL and SNDCTL_DSP_WRITECTL
*/
typedef struct oss_digital_control {
unsigned int caps;
unsigned int valid;
unsigned int request;
unsigned int param;
unsigned int outsel;
#define IND_UNKNOWN 0
#define LOCK_NOT_INDICATED 0
#define IN_QUAL_NOT_INDICATED 0
int in_vbit;
#define VBIT_NOT_INDICATED 0
int srate_in;
int srate_out;
int bits_in;
int bits_out;
/*
* The "new" mixer API.
*
* This improved mixer API makes it possible to access every possible feature
* of every possible device. However you should read the mixer programming
* section of the OSS API Developer's Manual. There is no chance that you
* could use this interface correctly just by examining this header.
*/
typedef struct oss_sysinfo {
} oss_sysinfo;
typedef struct oss_mixext {
/* Possible value range (minvalue to maxvalue) */
/* Note that maxvalue may also be smaller than minvalue */
int maxvalue;
int minvalue;
int flags;
int timestamp;
int update_counter;
#ifdef _KERNEL
int enumbit;
#else
#endif
} oss_mixext;
typedef struct oss_mixext_root {
typedef struct oss_mixer_value {
int dev;
int ctrl;
int value;
typedef struct oss_audioinfo {
int card_number;
int port_number;
int mixer_dev;
int rate_source;
int next_play_engine;
int next_rec_engine;
typedef struct oss_mixerinfo {
int dev;
int modify_counter;
int card_number;
int port_number;
int caps;
int nrext;
/*
* The priority field can be used to select the default
* (motherboard) mixer device. The mixer with the highest
* priority is the most preferred one. -2 or less means that
* this device cannot be used as the default mixer.
*/
int priority;
int legacy_device;
typedef struct oss_card_info {
int card;
int flags;
int intr_count;
int ack_count;
int modify_counter;
int card_number;
int port_number;
} mixer_info;
/* For use with SNDCTL_DSP_GET_CHNORDER */
#define CHID_UNDEF 0
/* ioctl codes 'X', 200-255 are reserved for internal use */
/*
* Few more "globally" available ioctl calls.
*/
/*
*/
/*
* These definitions are here for the benefit of compiling application
* code. Most of these are NOT implemented in the Solaris code,
* however. This is the older 3.x OSS API, and only the master input and
* output levels are actually supported.
*/
#define SOUND_MIXER_VOLUME 0
/*
* Again, DO NOT USE the following two macros. They are here for SOURCE
* COMPATIBILITY ONLY.
*/
#define SOUND_DEVICE_LABELS { \
"Vol ", "Bass ", "Treble", "Synth", "Pcm ", "Speaker ", "Line ", \
"Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \
"Aux1", "Aux2", "Aux3", "Digital1", "Digital2", "Digital3", \
"Phone", "Mono", "Video", "Radio", "Depth", \
"Rear", "Center", "Side" }
#define SOUND_DEVICE_NAMES { \
"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \
"mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \
"aux1", "aux2", "aux3", "dig1", "dig2", "dig3", \
"phone", "mono", "video", "radio", "depth", \
"rear", "center", "side" }
/*
* These macros are useful for some applications. They are implemented
* as soft values for the application, and do not affect real hardware.
*/
/*
* These macros are here for source compatibility. They intentionally don't
* map to any real hardware. NOT SUPPORTED!
*/
/*
* Audio encoding types (Note! U8=8 and S16_LE=16 for compatibility)
*/
/*
* opposite endian formats).
*/
#if defined(_BIG_ENDIAN)
#else
#endif
/*
* SNDCTL_DSP_GETCAPS bits
*/
/*
* Preferred channel usage. These bits can be used to give
* recommendations to the application. Used by few drivers. For
* example if ((caps & DSP_CH_MASK) == DSP_CH_MONO) means that the
* device works best in mono mode. However it doesn't necessarily mean
* that the device cannot be used in stereo. These bits should only be
* used by special applications such as multi track hard disk
* recorders to find out the initial setup. However the user should be
* able to override this selection.
*
* To find out which modes are actually supported the application
* should try to select them using SNDCTL_DSP_CHANNELS.
*/
/*
* The PCM_CAP_* capability names used to be known as DSP_CAP_*, so
* it's necessary to define the older names too.
*/
/*
* SNDCTL_DSP_GETTRIGGER and SNDCTL_DSP_SETTRIGGER
*/
/*
* SNDCTL_DSP_BIND_CHANNEL
*/
/*
* SOUND_MIXER_READ_CAPS
*/
/*
* The following ioctl is for internal use only -- it is used to
* as well.)
*/
#ifdef __cplusplus
}
#endif
#endif /* _SYS_AUDIO_OSS_H */