2 /* Jon Watte 19971223 */
3 /* Interface to drivers found in /dev/audio */
4 /* Devices found in /dev/audio/old follow a different API! */
7 Copyright 1999, Be Incorporated. All Rights Reserved.
8 This file may be used under the terms of the Be Sample Code License.
11 #if !defined(_AUDIO_DRIVER_H)
12 #define _AUDIO_DRIVER_H
14 #if !defined(_SUPPORT_DEFS_H)
15 #include <SupportDefs.h>
16 #endif /* _SUPPORT_DEFS_H */
17 #if !defined(_DRIVERS_H)
19 #endif /* _DRIVERS_H */
22 /* arg = ptr to struct audio_format */
23 B_AUDIO_GET_AUDIO_FORMAT
= B_AUDIO_DRIVER_BASE
,
24 B_AUDIO_SET_AUDIO_FORMAT
,
25 /* arg = ptr to float[4] */
26 B_AUDIO_GET_PREFERRED_SAMPLE_RATES
,
27 /* arg = ptr to struct audio_routing_cmd */
30 /* arg = ptr to struct audio_routing_cmd */
33 /* arg = ptr to struct audio_timing */
34 B_AUDIO_GET_TIMING
/* used to be SV_SECRET_HANDSHAKE (10100) */
37 /* this is the definition of what the audio driver can do for you */
38 typedef struct audio_format
{
39 float sample_rate
; /* ~4000 - ~48000, maybe more */
40 int32 channels
; /* 1 or 2 */
41 int32 format
; /* 0x11 (uchar), 0x2 (short) or 0x24 (float) */
42 int32 big_endian
; /* 0 for little endian, 1 for big endian */
43 size_t buf_header
; /* typically 0 or 16 */
44 size_t play_buf_size
; /* size of playback buffer (latency) */
45 size_t rec_buf_size
; /* size of record buffer (latency) */
48 /* when buffer header is in effect, this is what gets read before data */
49 typedef struct audio_buf_header
{
50 bigtime_t capture_time
;
55 /* the mux devices use these records */
56 typedef struct audio_routing
{
57 int32 selector
; /* for GET, these need to be filled in! */
61 /* this is the argument for ioctl() */
62 typedef struct audio_routing_cmd
{
78 enum { /* selectors for routing */
81 B_AUDIO_MIDI_OUTPUT_TO_SYNTH
,
82 B_AUDIO_MIDI_INPUT_TO_SYNTH
,
83 B_AUDIO_MIDI_OUTPUT_TO_PORT
,
84 B_AUDIO_PCM_OUT_POST_3D
,
85 B_AUDIO_STEREO_ENHANCEMENT
,
86 B_AUDIO_3D_STEREO_ENHANCEMENT
,
88 B_AUDIO_LOCAL_LOOPBACK
,
89 B_AUDIO_REMOTE_LOOPBACK
,
90 B_AUDIO_MONO_OUTPUT_FROM_MIC
,
91 B_AUDIO_ALTERNATE_MIC
,
92 B_AUDIO_ADC_DAC_LOOPBACK
95 enum { /* input MUX source values */
96 B_AUDIO_INPUT_DAC
= 1, /* (not in AC97) */
97 B_AUDIO_INPUT_LINE_IN
,
100 B_AUDIO_INPUT_AUX1
, /* synth */
101 B_AUDIO_INPUT_AUX2
, /* (not in AC97) */
104 B_AUDIO_INPUT_MIX_OUT
, /* sum of all outputs */
105 B_AUDIO_INPUT_MONO_OUT
108 /* the mixer devices use these records */
109 typedef struct audio_level
{
110 int32 selector
; /* for GET, this still needs to be filled in! */
112 float value
; /* in dB */
115 /* this is the arg to ioctl() */
116 typedef struct audio_level_cmd
{
121 /* bitmask for the flags */
122 #define B_AUDIO_LEVEL_MUTED 1
124 enum { /* selectors for levels */
125 B_AUDIO_MIX_ADC_LEFT
,
126 B_AUDIO_MIX_ADC_RIGHT
,
127 B_AUDIO_MIX_DAC_LEFT
,
128 B_AUDIO_MIX_DAC_RIGHT
,
129 B_AUDIO_MIX_LINE_IN_LEFT
,
130 B_AUDIO_MIX_LINE_IN_RIGHT
,
132 B_AUDIO_MIX_CD_RIGHT
,
133 B_AUDIO_MIX_VIDEO_LEFT
,
134 B_AUDIO_MIX_VIDEO_RIGHT
,
135 B_AUDIO_MIX_SYNTH_LEFT
,
136 B_AUDIO_MIX_SYNTH_RIGHT
,
137 B_AUDIO_MIX_AUX_LEFT
, /* (not in AC97) */
138 B_AUDIO_MIX_AUX_RIGHT
, /* (not in AC97) */
142 B_AUDIO_MIX_LINE_OUT_LEFT
,
143 B_AUDIO_MIX_LINE_OUT_RIGHT
,
144 B_AUDIO_MIX_HEADPHONE_OUT_LEFT
,
145 B_AUDIO_MIX_HEADPHONE_OUT_RIGHT
,
146 B_AUDIO_MIX_MONO_OUT
,
147 B_AUDIO_MIX_LOOPBACK_LEVEL
/* (not in AC97) */
150 #endif /* _AUDIO_DRIVER_H */