88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * CDDL HEADER START
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore *
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * The contents of this file are subject to the terms of the
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Common Development and Distribution License (the "License").
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * You may not use this file except in compliance with the License.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore *
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * or http://www.opensolaris.org/os/licensing.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * See the License for the specific language governing permissions
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * and limitations under the License.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore *
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * When distributing Covered Code, include this CDDL HEADER in each
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * If applicable, add the following below this CDDL HEADER, with the
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * fields enclosed by brackets "[]" replaced with your own identifying
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * information: Portions Copyright [yyyy] [name of copyright owner]
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore *
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * CDDL HEADER END
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Copyright (C) 4Front Technologies 1996-2008.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore *
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Use is subject to license terms.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#ifndef _SYS_AUDIO_OSS_H
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define _SYS_AUDIO_OSS_H
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#include <sys/types.h>
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#include <sys/time.h>
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * These are the ioctl calls for all Solaris /dev/dsp and /dev/mixer audio
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * devices.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore *
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Note that the contents of this file include definitions which exist
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * primarily for compatibility. Many of the defines here are not
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * actually implemented, but exist solely to facilitate compilation of
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * programs from other operating systems. Other definitions here may
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * not be fully supported or may otherwise be obsolete. There are many
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * things in this file which should not be used on SunOS.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore *
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Please read the documentation to determine which portions of the
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * API are fully supported and recommended for use in new
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * applications.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#ifdef __cplusplus
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoreextern "C" {
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#endif
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Buffer status queries.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * SNDCTL_DSP_GETOSPACE and SNDCTL_DSP_GETISPACE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct audio_buf_info {
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int fragments; /* # of available fragments */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int fragstotal; /* Total # of fragments allocated */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int fragsize; /* Size of a fragment in bytes */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int bytes; /* Available space in bytes */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /* Note! 'bytes' could be more than fragments*fragsize */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore} audio_buf_info;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Sync groups for audio devices.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * SNDCTL_DSP_SYNCGROUP and SNDCTL_DSP_SYNCSTART
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct oss_syncgroup {
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int id;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int mode;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int filler[16];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore} oss_syncgroup;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * SNDCTL_DSP_GETERROR
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct audio_errinfo {
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int play_underruns;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int rec_overruns;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned int play_ptradjust;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned int rec_ptradjust;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int play_errorcount;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int rec_errorcount;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int play_lasterror;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int rec_lasterror;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int play_errorparm;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int rec_errorparm;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int filler[16];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore} audio_errinfo;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * SNDCTL_DSP_GETIPTR and SNDCTL_DSP_GETOPTR
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct count_info {
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned int bytes; /* Total # of bytes processed */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int blocks; /* # of fragment transitions since last time */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int ptr; /* Current DMA pointer value */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore} count_info;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * SNDCTL_DSP_CURENT_IPTR and SNDCTL_DSP_CURRENT_OPTR
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct {
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore long long samples; /* Total # of samples */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int fifo_samples; /* Samples in device FIFO */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int filler[32]; /* For future use */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore} oss_count_t;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * SNDCTL_DSP_GET_RECSRC_NAMES and SNDCTL_DSP_GET_PLAYTGT_NAMES
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OSS_ENUM_MAXVALUE 255
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct oss_mixer_enuminfo {
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int dev;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int ctrl;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int nvalues;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int version;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore short strindex[OSS_ENUM_MAXVALUE];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char strings[3000];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore} oss_mixer_enuminfo;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Digital interface (S/PDIF) control interface
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * SNDCTL_DSP_READCTL and SNDCTL_DSP_WRITECTL
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct oss_digital_control {
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned int caps;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_CBITIN_NONE 0x00000000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_CBITIN_LIMITED 0x00000001
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_CBITIN_DATA 0x00000002
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_CBITIN_BYTE0 0x00000004
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_CBITIN_FULL 0x00000008
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_CBITIN_MASK 0x0000000f
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_CBITOUT_NONE 0x00000000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_CBITOUT_LIMITED 0x00000010
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_CBITOUT_BYTE0 0x00000020
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_CBITOUT_FULL 0x00000040
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_CBITOUT_DATA 0x00000080
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_CBITOUT_MASK 0x000000f0
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_UBITIN 0x00000100
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_UBITOUT 0x00000200
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_VBITOUT 0x00000400
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_OUTRATE 0x00000800
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_INRATE 0x00001000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_INBITS 0x00002000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_OUTBITS 0x00004000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_EXACT 0x00010000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_PRO 0x00020000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_CONSUMER 0x00040000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_PASSTHROUGH 0x00080000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DIG_OUTSEL 0x00100000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned int valid;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define VAL_CBITIN 0x00000001
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define VAL_UBITIN 0x00000002
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define VAL_CBITOUT 0x00000004
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define VAL_UBITOUT 0x00000008
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define VAL_ISTATUS 0x00000010
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define VAL_IRATE 0x00000020
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define VAL_ORATE 0x00000040
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define VAL_INBITS 0x00000080
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define VAL_OUTBITS 0x00000100
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define VAL_REQUEST 0x00000200
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define VAL_OUTSEL 0x00000400
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define VAL_OUTMASK (VAL_CBITOUT|VAL_UBITOUT|VAL_ORATE|VAL_OUTBITS|VAL_OUTSEL)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned int request;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned int param;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SPD_RQ_PASSTHROUGH 1
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned char cbitin[24];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned char ubitin[24];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned char cbitout[24];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned char ubitout[24];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned int outsel;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OUTSEL_DIGITAL 1
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OUTSEL_ANALOG 2
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OUTSEL_BOTH (OUTSEL_DIGITAL|OUTSEL_ANALOG)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int in_data; /* Audio/data if autodetectable by receiver */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define IND_UNKNOWN 0
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define IND_AUDIO 1
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define IND_DATA 2
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int in_locked; /* Receiver locked */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define LOCK_NOT_INDICATED 0
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define LOCK_UNLOCKED 1
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define LOCK_LOCKED 2
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int in_quality; /* Input signal quality */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define IN_QUAL_NOT_INDICATED 0
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define IN_QUAL_POOR 1
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define IN_QUAL_GOOD 2
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int in_vbit;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int out_vbit; /* V bits */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define VBIT_NOT_INDICATED 0
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define VBIT_OFF 1
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define VBIT_ON 2
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned int in_errors; /* Various input error conditions */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define INERR_CRC 0x0001
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define INERR_QCODE_CRC 0x0002
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define INERR_PARITY 0x0004
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define INERR_BIPHASE 0x0008
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int srate_in;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int srate_out;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int bits_in;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int bits_out;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int filler[32];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore} oss_digital_control;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * The "new" mixer API.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore *
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * This improved mixer API makes it possible to access every possible feature
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * of every possible device. However you should read the mixer programming
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * section of the OSS API Developer's Manual. There is no chance that you
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * could use this interface correctly just by examining this header.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OSS_VERSION 0x040003
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_VERSION OSS_VERSION
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct oss_sysinfo {
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char product[32]; /* E.g. SunOS Audio */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char version[32]; /* E.g. 4.0a */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int versionnum; /* See OSS_GETVERSION */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char options[128]; /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int numaudios; /* # of audio/dsp devices */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int openedaudio[8]; /* Mask of audio devices are busy */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int numsynths; /* NOT SUPPORTED, always 0 */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int nummidis; /* NOT SUPPORTED, always 0 */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int numtimers; /* NOT SUPPORTED, always 0 */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int nummixers; /* # of mixer devices */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int openedmidi[8]; /* Mask of midi devices are busy */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int numcards; /* Number of sound cards in the system */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int numaudioengines; /* Number of audio engines in the system */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char license[16]; /* E.g. "GPL" or "CDDL" */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char revision_info[256]; /* For internal use */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int filler[172]; /* For future expansion */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore} oss_sysinfo;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct oss_mixext {
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int dev; /* Mixer device number */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int ctrl; /* Extension number */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int type; /* Entry type */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_DEVROOT 0 /* Device root entry */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_GROUP 1 /* Controller group */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_ONOFF 2 /* OFF (0) or ON (1) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_ENUM 3 /* Enumerated (0 to maxvalue) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_MONOSLIDER 4 /* Mono slider (0 to 255) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_STEREOSLIDER 5 /* Stereo slider (dual 0 to 255) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_MESSAGE 6 /* (Readable) textual message */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_MONOVU 7 /* VU meter value (mono) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_STEREOVU 8 /* VU meter value (stereo) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_MONOPEAK 9 /* VU meter peak value (mono) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_STEREOPEAK 10 /* VU meter peak value (stereo) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_RADIOGROUP 11 /* Radio button group */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_MARKER 12 /* Separator between entries */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_VALUE 13 /* Decimal value entry */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_HEXVALUE 14 /* Hexadecimal value entry */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_MONODB 15 /* OBSOLETE */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_STEREODB 16 /* OBSOLETE */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_SLIDER 17 /* Slider (mono, 31 bit int range) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_3D 18
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_MONOSLIDER16 19 /* Mono slider (0-32767) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_STEREOSLIDER16 20 /* Stereo slider (dual 0-32767) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXT_MUTE 21 /* Mute=1, unmute=0 */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /* Possible value range (minvalue to maxvalue) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /* Note that maxvalue may also be smaller than minvalue */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int maxvalue;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int minvalue;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int flags;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_READABLE 0x00000001 /* Has readable value */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_WRITEABLE 0x00000002 /* Has writeable value */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_POLL 0x00000004 /* May change itself */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_HZ 0x00000008 /* Hertz scale */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_STRING 0x00000010 /* Use dynamic extensions for value */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_DYNAMIC 0x00000010 /* Supports dynamic extensions */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_OKFAIL 0x00000020 /* Interpret value as 1=OK, 0=FAIL */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_FLAT 0x00000040 /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_LEGACY 0x00000080 /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_CENTIBEL 0x00000100 /* Centibel (0.1 dB) step size */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_DECIBEL 0x00000200 /* Step size of 1 dB */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_MAINVOL 0x00000400 /* Main volume control */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_PCMVOL 0x00000800 /* PCM output volume control */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_RECVOL 0x00001000 /* PCM recording volume control */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_MONVOL 0x00002000 /* Input->output monitor volume */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_WIDE 0x00004000 /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_DESCR 0x00008000 /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXF_DISABLE 0x00010000 /* Control has been disabled */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char id[16]; /* Mnemonic ID (internal use) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int parent; /* Entry# of parent (-1 if root) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int dummy; /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int timestamp;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char data[64]; /* Misc data (entry type dependent) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned char enum_present[32]; /* Mask of allowed enum values */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int control_no; /* NOT SUPPORTED, always -1 */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned int desc; /* Scope flags, etc */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXEXT_SCOPE_MASK 0x0000003f
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXEXT_SCOPE_OTHER 0x00000000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXEXT_SCOPE_INPUT 0x00000001
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXEXT_SCOPE_OUTPUT 0x00000002
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXEXT_SCOPE_MONITOR 0x00000003
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXEXT_SCOPE_RECSWITCH 0x00000004
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char extname[32];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int update_counter;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#ifdef _KERNEL
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int filler[6];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int enumbit;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#else
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int filler[7];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#endif
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore} oss_mixext;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct oss_mixext_root {
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char id[16];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char name[48];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore} oss_mixext_root;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct oss_mixer_value {
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int dev;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int ctrl;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int value;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int flags; /* Reserved for future use. Initialize to 0 */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int timestamp; /* Must be set to oss_mixext.timestamp */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int filler[8]; /* Reserved for future use. Initialize to 0 */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore} oss_mixer_value;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OSS_LONGNAME_SIZE 64
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OSS_LABEL_SIZE 16
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OSS_DEVNODE_SIZE 32
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef char oss_longname_t[OSS_LONGNAME_SIZE];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef char oss_label_t[OSS_LABEL_SIZE];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef char oss_devnode_t[OSS_DEVNODE_SIZE];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct oss_audioinfo {
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int dev; /* Audio device number */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char name[64];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int busy; /* 0, OPEN_READ, OPEN_WRITE, OPEN_READWRITE */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int pid; /* Process ID, not used in SunOS */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int caps; /* PCM_CAP_INPUT, PCM_CAP_OUTPUT */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int iformats; /* Supported input formats */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int oformats; /* Supported output formats */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int magic; /* Internal use only */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char cmd[64]; /* Command using the device (if known) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int card_number;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int port_number;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int mixer_dev;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int legacy_device; /* Obsolete field. Replaced by devnode */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int enabled; /* 1=enabled, 0=device not ready */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int flags; /* internal use only - no practical meaning */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int min_rate; /* Minimum sample rate */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int max_rate; /* Maximum sample rate */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int min_channels; /* Minimum number of channels */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int max_channels; /* Maximum number of channels */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int binding; /* DSP_BIND_FRONT, etc. 0 means undefined */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int rate_source;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char handle[32];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OSS_MAX_SAMPLE_RATES 20 /* Cannot be changed */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned int nrates; /* Array of supported sample rates */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned int rates[OSS_MAX_SAMPLE_RATES];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore oss_longname_t song_name; /* Song name (if given) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore oss_label_t label; /* Device label (if given) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int latency; /* In usecs, -1=unknown */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore oss_devnode_t devnode; /* Device special file name (absolute path) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int next_play_engine;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int next_rec_engine;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int filler[184];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore} oss_audioinfo;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct oss_mixerinfo {
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int dev;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char id[16];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char name[32];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int modify_counter;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int card_number;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int port_number;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char handle[32];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int magic; /* Reserved */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int enabled; /* Reserved */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int caps;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXER_CAP_VIRTUAL 0x00000001
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXER_CAP_LAYOUT_B 0x00000002 /* For internal use only */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXER_CAP_NARROW 0x00000004 /* Conserve horiz space */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int flags; /* Reserved */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int nrext;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * The priority field can be used to select the default
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * (motherboard) mixer device. The mixer with the highest
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * priority is the most preferred one. -2 or less means that
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * this device cannot be used as the default mixer.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int priority;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore oss_devnode_t devnode; /* Device special file name (absolute path) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int legacy_device;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int filler[245]; /* Reserved */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore} oss_mixerinfo;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct oss_card_info {
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int card;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char shortname[16];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char longname[128];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int flags;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char hw_info[400];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int intr_count;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int ack_count;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int filler[154];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore} oss_card_info;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct mixer_info { /* OBSOLETE */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char id[16];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char name[32];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int modify_counter;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int card_number;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int port_number;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore char handle[32];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore} mixer_info;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MAX_PEAK_CHANNELS 128
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef unsigned short oss_peaks_t[MAX_PEAK_CHANNELS];
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/* For use with SNDCTL_DSP_GET_CHNORDER */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define CHID_UNDEF 0
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define CHID_L 1
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define CHID_R 2
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define CHID_C 3
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define CHID_LFE 4
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define CHID_LS 5
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define CHID_RS 6
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define CHID_LR 7
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define CHID_RR 8
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define CHNORDER_UNDEF 0x0000000000000000ULL
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define CHNORDER_NORMAL 0x0000000087654321ULL
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OSSIOCPARM_MASK 0x1fff /* parameters must be < 8192 bytes */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OSSIOC_VOID 0x00000000 /* no parameters */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OSSIOC_OUT 0x20000000 /* copy out parameters */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OSSIOC_IN 0x40000000 /* copy in parameters */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OSSIOC_INOUT (OSSIOC_IN|OSSIOC_OUT)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OSSIOC_SZ(t) ((sizeof (t) & OSSIOCPARM_MASK) << 16)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OSSIOC_GETSZ(x) (((x) >> 16) & OSSIOCPARM_MASK)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define __OSSIO(x, y) ((int)(OSSIOC_VOID|(x<<8)|y))
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define __OSSIOR(x, y, t) ((int)(OSSIOC_OUT|OSSIOC_SZ(t)|(x<<8)|y))
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define __OSSIOW(x, y, t) ((int)(OSSIOC_IN|OSSIOC_SZ(t)|(x<<8)|y))
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define __OSSIOWR(x, y, t) ((int)(OSSIOC_INOUT|OSSIOC_SZ(t)|(x<<8)|y))
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_SYSINFO __OSSIOR('X', 1, oss_sysinfo)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OSS_SYSINFO SNDCTL_SYSINFO /* Old name */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_MIX_NRMIX __OSSIOR('X', 2, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_MIX_NREXT __OSSIOWR('X', 3, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_MIX_EXTINFO __OSSIOWR('X', 4, oss_mixext)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_MIX_READ __OSSIOWR('X', 5, oss_mixer_value)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_MIX_WRITE __OSSIOWR('X', 6, oss_mixer_value)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_AUDIOINFO __OSSIOWR('X', 7, oss_audioinfo)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_MIX_ENUMINFO __OSSIOWR('X', 8, oss_mixer_enuminfo)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_MIDIINFO __OSSIO('X', 9)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_MIXERINFO __OSSIOWR('X', 10, oss_mixerinfo)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_CARDINFO __OSSIOWR('X', 11, oss_card_info)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_ENGINEINFO __OSSIOWR('X', 12, oss_audioinfo)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_AUDIOINFO_EX __OSSIOWR('X', 13, oss_audioinfo)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_MIX_DESCRIPTION __OSSIOWR('X', 14, oss_mixer_enuminfo)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/* ioctl codes 'X', 200-255 are reserved for internal use */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Few more "globally" available ioctl calls.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_SETSONG __OSSIOW('Y', 2, oss_longname_t)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_GETSONG __OSSIOR('Y', 2, oss_longname_t)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_SETNAME __OSSIOW('Y', 3, oss_longname_t)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_SETLABEL __OSSIOW('Y', 4, oss_label_t)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_GETLABEL __OSSIOR('Y', 4, oss_label_t)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * IOCTL commands for /dev/dsp
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_HALT __OSSIO('P', 0)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_RESET SNDCTL_DSP_HALT /* Old name */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SYNC __OSSIO('P', 1)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SPEED __OSSIOWR('P', 2, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_STEREO __OSSIOWR('P', 3, int) /* OBSOLETE */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GETBLKSIZE __OSSIOWR('P', 4, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_CHANNELS __OSSIOWR('P', 6, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_POST __OSSIO('P', 8)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SUBDIVIDE __OSSIOWR('P', 9, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SETFRAGMENT __OSSIOWR('P', 10, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GETFMTS __OSSIOR('P', 11, int) /* Returns a mask */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SETFMT __OSSIOWR('P', 5, int) /* Selects ONE fmt */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GETOSPACE __OSSIOR('P', 12, audio_buf_info)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GETISPACE __OSSIOR('P', 13, audio_buf_info)
260256302ac564fcfed9ebfa5a6c98a2e6ef3808Garrett D'Amore#define SNDCTL_DSP_NONBLOCK __OSSIO('P', 14) /* Obsolete */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GETCAPS __OSSIOR('P', 15, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GETTRIGGER __OSSIOR('P', 16, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SETTRIGGER __OSSIOW('P', 16, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GETIPTR __OSSIOR('P', 17, count_info)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GETOPTR __OSSIOR('P', 18, count_info)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SETSYNCRO __OSSIO('P', 21)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SETDUPLEX __OSSIO('P', 22)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_PROFILE __OSSIOW('P', 23, int) /* OBSOLETE */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define APF_NORMAL 0 /* Normal applications */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define APF_NETWORK 1 /* Underruns caused by "external" delay */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define APF_CPUINTENS 2 /* Underruns caused by "overheating" the CPU */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GETODELAY __OSSIOR('P', 23, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GETPLAYVOL __OSSIOR('P', 24, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SETPLAYVOL __OSSIOWR('P', 24, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GETERROR __OSSIOR('P', 25, audio_errinfo)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_READCTL __OSSIOWR('P', 26, oss_digital_control)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_WRITECTL __OSSIOWR('P', 27, oss_digital_control)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SYNCGROUP __OSSIOWR('P', 28, oss_syncgroup)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SYNCSTART __OSSIOW('P', 29, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_COOKEDMODE __OSSIOW('P', 30, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SILENCE __OSSIO('P', 31)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SKIP __OSSIO('P', 32)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_HALT_INPUT __OSSIO('P', 33)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_RESET_INPUT SNDCTL_DSP_HALT_INPUT /* Old name */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_HALT_OUTPUT __OSSIO('P', 34)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_RESET_OUTPUT SNDCTL_DSP_HALT_OUTPUT /* Old name */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_LOW_WATER __OSSIOW('P', 34, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_CURRENT_IPTR __OSSIOR('P', 35, oss_count_t)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_CURRENT_OPTR __OSSIOR('P', 36, oss_count_t)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GET_RECSRC_NAMES __OSSIOR('P', 37, oss_mixer_enuminfo)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GET_RECSRC __OSSIOR('P', 38, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SET_RECSRC __OSSIOWR('P', 38, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GET_PLAYTGT_NAMES __OSSIOR('P', 39, oss_mixer_enuminfo)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GET_PLAYTGT __OSSIOR('P', 40, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SET_PLAYTGT __OSSIOWR('P', 40, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GETRECVOL __OSSIOR('P', 41, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SETRECVOL __OSSIOWR('P', 41, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GET_CHNORDER __OSSIOR('P', 42, unsigned long long)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_SET_CHNORDER __OSSIOWR('P', 42, unsigned long long)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GETIPEAKS __OSSIOR('P', 43, oss_peaks_t)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GETOPEAKS __OSSIOR('P', 44, oss_peaks_t)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_POLICY __OSSIOW('P', 45, int) /* See the manual */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_GETCHANNELMASK __OSSIOWR('P', 64, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_DSP_BIND_CHANNEL __OSSIOWR('P', 65, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * These definitions are here for the benefit of compiling application
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * code. Most of these are NOT implemented in the Solaris code,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * however. This is the older 3.x OSS API, and only the master input and
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * output levels are actually supported.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_NRDEVICES 28
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_VOLUME 0
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_BASS 1
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_TREBLE 2
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_SYNTH 3
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_PCM 4
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_SPEAKER 5
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_LINE 6
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_MIC 7
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_CD 8
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_IMIX 9 /* Recording monitor */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_ALTPCM 10
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_RECLEV 11 /* Recording level */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_IGAIN 12 /* Input gain */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_OGAIN 13 /* Output gain */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_LINE1 14 /* Input source 1 (aux1) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_LINE2 15 /* Input source 2 (aux2) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_LINE3 16 /* Input source 3 (line) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_DIGITAL1 17 /* Digital I/O 1 */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_DIGITAL2 18 /* Digital I/O 2 */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_DIGITAL3 19 /* Digital I/O 3 */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_PHONE 20 /* Phone */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_MONO 21 /* Mono Output */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_VIDEO 22 /* Video/TV (audio) in */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_RADIO 23 /* Radio in */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_DEPTH 24 /* Surround depth */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_REARVOL 25 /* Rear/Surround speaker vol */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_CENTERVOL 26 /* Center/LFE speaker vol */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_SIDEVOL 27 /* Side-Surround (8speaker) vol */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_SURRVOL SOUND_MIXER_SIDEVOL
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_ONOFF_MIN 28
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_ONOFF_MAX 30
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_NONE 31
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_RECSRC 0xff /* Recording sources */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_DEVMASK 0xfe /* Supported devices */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_RECMASK 0xfd /* Recording sources */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_CAPS 0xfc /* Mixer capabilities (do not use) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_STEREODEVS 0xfb /* Mixer channels supporting stereo */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_OUTSRC 0xfa
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_OUTMASK 0xf9
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_ENHANCE SOUND_MIXER_NONE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_MUTE SOUND_MIXER_NONE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_LOUD SOUND_MIXER_NONE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_CD (1 << SOUND_MIXER_CD)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_MONO (1 << SOUND_MIXER_MONO)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_PHONE (1 << SOUND_MIXER_PHONE)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_DEPTH (1 << SOUND_MIXER_DEPTH)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_REARVOL (1 << SOUND_MIXER_REARVOL)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_CENTERVOL (1 << SOUND_MIXER_CENTERVOL)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_SIDEVOL (1 << SOUND_MIXER_SIDEVOL)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_SURRVOL SOUND_MASK_SIDEVOL
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_MUTE (1 << SOUND_MIXER_MUTE)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_ENHANCE (1 << SOUND_MIXER_ENHANCE)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MASK_LOUD (1 << SOUND_MIXER_LOUD)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Again, DO NOT USE the following two macros. They are here for SOURCE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * COMPATIBILITY ONLY.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_DEVICE_LABELS { \
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore "Vol ", "Bass ", "Treble", "Synth", "Pcm ", "Speaker ", "Line ", \
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore "Aux1", "Aux2", "Aux3", "Digital1", "Digital2", "Digital3", \
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore "Phone", "Mono", "Video", "Radio", "Depth", \
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore "Rear", "Center", "Side" }
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_DEVICE_NAMES { \
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore "vol", "bass", "treble", "synth", "pcm", "speaker", "line", \
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore "aux1", "aux2", "aux3", "dig1", "dig2", "dig3", \
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore "phone", "mono", "video", "radio", "depth", \
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore "rear", "center", "side" }
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXER_READ(dev) __OSSIOR('M', dev, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define MIXER_WRITE(dev) __OSSIOWR('M', dev, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_INFO __OSSIOR('M', 101, mixer_info)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define OSS_GETVERSION __OSSIOR('M', 118, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * These macros are useful for some applications. They are implemented
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * as soft values for the application, and do not affect real hardware.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_RECGAIN __OSSIOR('M', 119, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_MONGAIN __OSSIOR('M', 120, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_RECGAIN __OSSIOWR('M', 119, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_MONGAIN __OSSIOWR('M', 120, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * These macros are here for source compatibility. They intentionally don't
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * map to any real hardware. NOT SUPPORTED!
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Audio encoding types (Note! U8=8 and S16_LE=16 for compatibility)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_QUERY 0x00000000 /* Return current fmt */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_MU_LAW 0x00000001
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_A_LAW 0x00000002
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_IMA_ADPCM 0x00000004
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_U8 0x00000008
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S16_LE 0x00000010
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S16_BE 0x00000020
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S8 0x00000040
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_U16_LE 0x00000080
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_U16_BE 0x00000100
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_MPEG 0x00000200 /* NOT SUPPORTED: MPEG (2) audio */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_AC3 0x00000400 /* NOT SUPPORTED: AC3 compressed */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_VORBIS 0x00000800 /* NOT SUPPORTED: Ogg Vorbis */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S32_LE 0x00001000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S32_BE 0x00002000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_FLOAT 0x00004000 /* NOT SUPPORTED: IEEE double float */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S24_LE 0x00008000 /* LSB aligned in 32 bit word */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S24_BE 0x00010000 /* LSB aligned in 32 bit word */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_SPDIF_RAW 0x00020000 /* NOT SUPPORTED: Raw S/PDIF frames */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S24_PACKED 0x00040000 /* 24 bit packed little endian */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Some big endian/little endian handling macros (native endian and
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * opposite endian formats).
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#if defined(_BIG_ENDIAN)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S16_NE AFMT_S16_BE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_U16_NE AFMT_U16_BE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S32_NE AFMT_S32_BE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S24_NE AFMT_S24_BE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S16_OE AFMT_S16_LE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S32_OE AFMT_S32_LE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S24_OE AFMT_S24_LE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#else
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S16_NE AFMT_S16_LE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_U16_NE AFMT_U16_LE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S32_NE AFMT_S32_LE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S24_NE AFMT_S24_LE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S16_OE AFMT_S16_BE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S32_OE AFMT_S32_BE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define AFMT_S24_OE AFMT_S24_BE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#endif
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * SNDCTL_DSP_GETCAPS bits
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_REVISION 0x000000ff /* Revision level (0 to 255) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_DUPLEX 0x00000100 /* Full duplex rec/play */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_REALTIME 0x00000200 /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_BATCH 0x00000400 /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_COPROC 0x00000800 /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_TRIGGER 0x00001000 /* Supports SETTRIGGER */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_MMAP 0x00002000 /* Supports mmap() */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_MULTI 0x00004000 /* Supports multiple open */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_BIND 0x00008000 /* Supports channel binding */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_INPUT 0x00010000 /* Supports recording */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_OUTPUT 0x00020000 /* Supports playback */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_VIRTUAL 0x00040000 /* Virtual device */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_ANALOGOUT 0x00100000 /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_ANALOGIN 0x00200000 /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_DIGITALOUT 0x00400000 /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_DIGITALIN 0x00800000 /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_ADMASK 0x00f00000 /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_SHADOW 0x01000000 /* "Shadow" device */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_CH_MASK 0x06000000 /* See DSP_CH_MASK below */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_HIDDEN 0x08000000 /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_FREERATE 0x10000000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_MODEM 0x20000000 /* NOT SUPPORTED */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_CAP_DEFAULT 0x40000000 /* "Default" device */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Preferred channel usage. These bits can be used to give
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * recommendations to the application. Used by few drivers. For
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * example if ((caps & DSP_CH_MASK) == DSP_CH_MONO) means that the
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * device works best in mono mode. However it doesn't necessarily mean
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * that the device cannot be used in stereo. These bits should only be
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * used by special applications such as multi track hard disk
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * recorders to find out the initial setup. However the user should be
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * able to override this selection.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore *
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * To find out which modes are actually supported the application
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * should try to select them using SNDCTL_DSP_CHANNELS.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CH_MASK 0x06000000 /* Mask */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CH_ANY 0x00000000 /* No preferred mode */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CH_MONO 0x02000000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CH_STEREO 0x04000000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CH_MULTI 0x06000000 /* More than two channels */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * The PCM_CAP_* capability names used to be known as DSP_CAP_*, so
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * it's necessary to define the older names too.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_ADMASK PCM_CAP_ADMASK
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_ANALOGIN PCM_CAP_ANALOGIN
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_ANALOGOUT PCM_CAP_ANALOGOUT
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_BATCH PCM_CAP_BATCH
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_BIND PCM_CAP_BIND
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_COPROC PCM_CAP_COPROC
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_DEFAULT PCM_CAP_DEFAULT
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_DIGITALIN PCM_CAP_DIGITALIN
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_DIGITALOUT PCM_CAP_DIGITALOUT
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_DUPLEX PCM_CAP_DUPLEX
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_FREERATE PCM_CAP_FREERATE
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_HIDDEN PCM_CAP_HIDDEN
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_INPUT PCM_CAP_INPUT
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_MMAP PCM_CAP_MMAP
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_MODEM PCM_CAP_MODEM
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_MULTI PCM_CAP_MULTI
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_OUTPUT PCM_CAP_OUTPUT
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_REALTIME PCM_CAP_REALTIME
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_REVISION PCM_CAP_REVISION
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_SHADOW PCM_CAP_SHADOW
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_TRIGGER PCM_CAP_TRIGGER
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_CAP_VIRTUAL PCM_CAP_VIRTUAL
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * SNDCTL_DSP_GETTRIGGER and SNDCTL_DSP_SETTRIGGER
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_ENABLE_INPUT 0x00000001
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define PCM_ENABLE_OUTPUT 0x00000002
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * SNDCTL_DSP_BIND_CHANNEL
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_BIND_QUERY 0x00000000
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_BIND_FRONT 0x00000001
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_BIND_SURR 0x00000002
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_BIND_CENTER_LFE 0x00000004
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_BIND_HANDSET 0x00000008
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_BIND_MIC 0x00000010
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_BIND_MODEM1 0x00000020
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_BIND_MODEM2 0x00000040
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_BIND_I2S 0x00000080
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_BIND_SPDIF 0x00000100
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define DSP_BIND_REAR 0x00000200
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * SOUND_MIXER_READ_CAPS
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_CAP_EXCL_INPUT 0x00000001
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_CAP_NOLEGACY 0x00000004
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SOUND_CAP_NORECSRC 0x00000008
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/*
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * The following ioctl is for internal use only -- it is used to
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * coordinate /dev/sndstat numbering with file names in /dev/sound.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Applications must not use it. (This is duplicated in sys/audioio.h
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * as well.)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#define SNDCTL_SUN_SEND_NUMBER __OSSIOW('X', 200, int)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#ifdef __cplusplus
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore}
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#endif
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#endif /* _SYS_AUDIO_OSS_H */