2 * QEMU DirectSound audio driver
4 * Copyright (c) 2005 Vassili Karpov (malc)
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 * SEAL 1.07 by Carlos 'pel' Hasan was used as documentation
31 #define AUDIO_CAP "dsound"
32 #include "audio_int.h"
38 /* #define DEBUG_DSOUND */
49 int getstatus_retries
;
53 struct full_fmt full_fmt
;
72 LPDIRECTSOUNDCAPTURE dsound_capture
;
73 LPDIRECTSOUNDBUFFER dsound_primary_buffer
;
77 static dsound glob_dsound
;
81 LPDIRECTSOUNDBUFFER dsound_buffer
;
94 LPDIRECTSOUNDCAPTUREBUFFER dsound_capture_buffer
;
97 static void dsound_log_hresult (HRESULT hr
)
99 const char *str
= "BUG";
103 str
= "The method succeeded";
105 #ifdef DS_NO_VIRTUALIZATION
106 case DS_NO_VIRTUALIZATION
:
107 str
= "The buffer was created, but another 3D algorithm was substituted";
112 str
= "The method succeeded, but not all the optional effects were obtained";
115 #ifdef DSERR_ACCESSDENIED
116 case DSERR_ACCESSDENIED
:
117 str
= "The request failed because access was denied";
120 #ifdef DSERR_ALLOCATED
121 case DSERR_ALLOCATED
:
122 str
= "The request failed because resources, such as a priority level, were already in use by another caller";
125 #ifdef DSERR_ALREADYINITIALIZED
126 case DSERR_ALREADYINITIALIZED
:
127 str
= "The object is already initialized";
130 #ifdef DSERR_BADFORMAT
131 case DSERR_BADFORMAT
:
132 str
= "The specified wave format is not supported";
135 #ifdef DSERR_BADSENDBUFFERGUID
136 case DSERR_BADSENDBUFFERGUID
:
137 str
= "The GUID specified in an audiopath file does not match a valid mix-in buffer";
140 #ifdef DSERR_BUFFERLOST
141 case DSERR_BUFFERLOST
:
142 str
= "The buffer memory has been lost and must be restored";
145 #ifdef DSERR_BUFFERTOOSMALL
146 case DSERR_BUFFERTOOSMALL
:
147 str
= "The buffer size is not great enough to enable effects processing";
150 #ifdef DSERR_CONTROLUNAVAIL
151 case DSERR_CONTROLUNAVAIL
:
152 str
= "The buffer control (volume, pan, and so on) requested by the caller is not available. Controls must be specified when the buffer is created, using the dwFlags member of DSBUFFERDESC";
155 #ifdef DSERR_DS8_REQUIRED
156 case DSERR_DS8_REQUIRED
:
157 str
= "A DirectSound object of class CLSID_DirectSound8 or later is required for the requested functionality. For more information, see IDirectSound8 Interface";
160 #ifdef DSERR_FXUNAVAILABLE
161 case DSERR_FXUNAVAILABLE
:
162 str
= "The effects requested could not be found on the system, or they are in the wrong order or in the wrong location; for example, an effect expected in hardware was found in software";
167 str
= "An undetermined error occurred inside the DirectSound subsystem";
170 #ifdef DSERR_INVALIDCALL
171 case DSERR_INVALIDCALL
:
172 str
= "This function is not valid for the current state of this object";
175 #ifdef DSERR_INVALIDPARAM
176 case DSERR_INVALIDPARAM
:
177 str
= "An invalid parameter was passed to the returning function";
180 #ifdef DSERR_NOAGGREGATION
181 case DSERR_NOAGGREGATION
:
182 str
= "The object does not support aggregation";
185 #ifdef DSERR_NODRIVER
187 str
= "No sound driver is available for use, or the given GUID is not a valid DirectSound device ID";
190 #ifdef DSERR_NOINTERFACE
191 case DSERR_NOINTERFACE
:
192 str
= "The requested COM interface is not available";
195 #ifdef DSERR_OBJECTNOTFOUND
196 case DSERR_OBJECTNOTFOUND
:
197 str
= "The requested object was not found";
200 #ifdef DSERR_OTHERAPPHASPRIO
201 case DSERR_OTHERAPPHASPRIO
:
202 str
= "Another application has a higher priority level, preventing this call from succeeding";
205 #ifdef DSERR_OUTOFMEMORY
206 case DSERR_OUTOFMEMORY
:
207 str
= "The DirectSound subsystem could not allocate sufficient memory to complete the caller's request";
210 #ifdef DSERR_PRIOLEVELNEEDED
211 case DSERR_PRIOLEVELNEEDED
:
212 str
= "A cooperative level of DSSCL_PRIORITY or higher is required";
215 #ifdef DSERR_SENDLOOP
217 str
= "A circular loop of send effects was detected";
220 #ifdef DSERR_UNINITIALIZED
221 case DSERR_UNINITIALIZED
:
222 str
= "The Initialize method has not been called or has not been called successfully before other methods were called";
225 #ifdef DSERR_UNSUPPORTED
226 case DSERR_UNSUPPORTED
:
227 str
= "The function called is not supported at this time";
231 AUD_log (AUDIO_CAP
, "Reason: Unknown (HRESULT %#lx)\n", hr
);
235 AUD_log (AUDIO_CAP
, "Reason: %s\n", str
);
238 static void GCC_FMT_ATTR (2, 3) dsound_logerr (
247 AUD_vlog (AUDIO_CAP
, fmt
, ap
);
250 dsound_log_hresult (hr
);
253 static void GCC_FMT_ATTR (3, 4) dsound_logerr2 (
262 AUD_log (AUDIO_CAP
, "Can not initialize %s\n", typ
);
264 AUD_vlog (AUDIO_CAP
, fmt
, ap
);
267 dsound_log_hresult (hr
);
270 static DWORD
millis_to_bytes (struct audio_pcm_info
*info
, DWORD millis
)
272 return (millis
* info
->bytes_per_second
) / 1000;
276 static void print_wave_format (WAVEFORMATEX
*wfx
)
278 dolog ("tag = %d\n", wfx
->wFormatTag
);
279 dolog ("nChannels = %d\n", wfx
->nChannels
);
280 dolog ("nSamplesPerSec = %ld\n", wfx
->nSamplesPerSec
);
281 dolog ("nAvgBytesPerSec = %ld\n", wfx
->nAvgBytesPerSec
);
282 dolog ("nBlockAlign = %d\n", wfx
->nBlockAlign
);
283 dolog ("wBitsPerSample = %d\n", wfx
->wBitsPerSample
);
284 dolog ("cbSize = %d\n", wfx
->cbSize
);
288 static int dsound_restore_out (LPDIRECTSOUNDBUFFER dsb
)
293 for (i
= 0; i
< conf
.restore_retries
; ++i
) {
294 hr
= IDirectSoundBuffer_Restore (dsb
);
300 case DSERR_BUFFERLOST
:
304 dsound_logerr (hr
, "Can not restore playback buffer\n");
309 dolog ("%d attempts to restore playback buffer failed\n", i
);
313 static int waveformat_from_full_fmt (WAVEFORMATEX
*wfx
,
314 struct full_fmt
*full_fmt
)
316 memset (wfx
, 0, sizeof (*wfx
));
318 wfx
->wFormatTag
= WAVE_FORMAT_PCM
;
319 wfx
->nChannels
= full_fmt
->nchannels
;
320 wfx
->nSamplesPerSec
= full_fmt
->freq
;
321 wfx
->nAvgBytesPerSec
= full_fmt
->freq
<< (full_fmt
->nchannels
== 2);
322 wfx
->nBlockAlign
= 1 << (full_fmt
->nchannels
== 2);
325 switch (full_fmt
->fmt
) {
327 wfx
->wBitsPerSample
= 8;
331 wfx
->wBitsPerSample
= 8;
335 wfx
->wBitsPerSample
= 16;
336 wfx
->nAvgBytesPerSec
<<= 1;
337 wfx
->nBlockAlign
<<= 1;
341 wfx
->wBitsPerSample
= 16;
342 wfx
->nAvgBytesPerSec
<<= 1;
343 wfx
->nBlockAlign
<<= 1;
347 dolog ("Internal logic error: Bad audio format %d\n",
355 static int waveformat_to_full_fmt (WAVEFORMATEX
*wfx
,
356 struct full_fmt
*full_fmt
)
358 if (wfx
->wFormatTag
!= WAVE_FORMAT_PCM
) {
359 dolog ("Invalid wave format, tag is not PCM, but %d\n",
364 if (!wfx
->nSamplesPerSec
) {
365 dolog ("Invalid wave format, frequency is zero\n");
368 full_fmt
->freq
= wfx
->nSamplesPerSec
;
370 switch (wfx
->nChannels
) {
372 full_fmt
->nchannels
= 1;
376 full_fmt
->nchannels
= 2;
381 "Invalid wave format, number of channels is not 1 or 2, but %d\n",
387 switch (wfx
->wBitsPerSample
) {
389 full_fmt
->fmt
= AUD_FMT_U8
;
393 full_fmt
->fmt
= AUD_FMT_S16
;
397 dolog ("Invalid wave format, bits per sample is not 8 or 16, but %d\n",
398 wfx
->wBitsPerSample
);
405 #include "dsound_template.h"
407 #include "dsound_template.h"
410 static int dsound_get_status_out (LPDIRECTSOUNDBUFFER dsb
, DWORD
*statusp
)
415 for (i
= 0; i
< conf
.getstatus_retries
; ++i
) {
416 hr
= IDirectSoundBuffer_GetStatus (dsb
, statusp
);
418 dsound_logerr (hr
, "Can not get playback buffer status\n");
422 if (*statusp
& DSERR_BUFFERLOST
) {
423 if (dsound_restore_out (dsb
)) {
434 static int dsound_get_status_in (LPDIRECTSOUNDCAPTUREBUFFER dscb
,
439 hr
= IDirectSoundCaptureBuffer_GetStatus (dscb
, statusp
);
441 dsound_logerr (hr
, "Can not get capture buffer status\n");
448 static void dsound_write_sample (HWVoiceOut
*hw
, uint8_t *dst
, int dst_len
)
450 int src_len1
= dst_len
;
452 int pos
= hw
->rpos
+ dst_len
;
453 st_sample_t
*src1
= hw
->mix_buf
+ hw
->rpos
;
454 st_sample_t
*src2
= NULL
;
456 if (pos
> hw
->samples
) {
457 src_len1
= hw
->samples
- hw
->rpos
;
459 src_len2
= dst_len
- src_len1
;
464 hw
->clip (dst
, src1
, src_len1
);
465 mixeng_clear (src1
, src_len1
);
469 dst
= advance (dst
, src_len1
<< hw
->info
.shift
);
470 hw
->clip (dst
, src2
, src_len2
);
471 mixeng_clear (src2
, src_len2
);
474 hw
->rpos
= pos
% hw
->samples
;
477 static void dsound_clear_sample (HWVoiceOut
*hw
, LPDIRECTSOUNDBUFFER dsb
)
481 DWORD blen1
, blen2
, len1
, len2
;
483 err
= dsound_lock_out (
487 hw
->samples
<< hw
->info
.shift
,
496 len1
= blen1
>> hw
->info
.shift
;
497 len2
= blen2
>> hw
->info
.shift
;
500 dolog ("clear %p,%ld,%ld %p,%ld,%ld\n",
506 audio_pcm_info_clear_buf (&hw
->info
, p1
, len1
);
510 audio_pcm_info_clear_buf (&hw
->info
, p2
, len2
);
513 dsound_unlock_out (dsb
, p1
, p2
, blen1
, blen2
);
516 static void dsound_close (dsound
*s
)
520 if (s
->dsound_primary_buffer
) {
521 hr
= IDirectSoundBuffer_Release (s
->dsound_primary_buffer
);
523 dsound_logerr (hr
, "Can not release primary buffer\n");
525 s
->dsound_primary_buffer
= NULL
;
529 static int dsound_open (dsound
*s
)
537 hwnd
= GetForegroundWindow ();
538 hr
= IDirectSound_SetCooperativeLevel (
545 dsound_logerr (hr
, "Can not set cooperative level for window %p\n",
550 if (!conf
.set_primary
) {
554 err
= waveformat_from_full_fmt (&wfx
, &conf
.full_fmt
);
559 memset (&dsbd
, 0, sizeof (dsbd
));
560 dsbd
.dwSize
= sizeof (dsbd
);
561 dsbd
.dwFlags
= DSBCAPS_PRIMARYBUFFER
;
562 dsbd
.dwBufferBytes
= 0;
563 dsbd
.lpwfxFormat
= NULL
;
565 hr
= IDirectSound_CreateSoundBuffer (
568 &s
->dsound_primary_buffer
,
572 dsound_logerr (hr
, "Can not create primary playback buffer\n");
576 hr
= IDirectSoundBuffer_SetFormat (s
->dsound_primary_buffer
, &wfx
);
578 dsound_logerr (hr
, "Can not set primary playback buffer format\n");
581 hr
= IDirectSoundBuffer_GetFormat (
582 s
->dsound_primary_buffer
,
588 dsound_logerr (hr
, "Can not get primary playback buffer format\n");
594 print_wave_format (&wfx
);
597 err
= waveformat_to_full_fmt (&wfx
, &s
->fmt
);
609 static int dsound_ctl_out (HWVoiceOut
*hw
, int cmd
, ...)
613 DSoundVoiceOut
*ds
= (DSoundVoiceOut
*) hw
;
614 LPDIRECTSOUNDBUFFER dsb
= ds
->dsound_buffer
;
617 dolog ("Attempt to control voice without a buffer\n");
623 if (dsound_get_status_out (dsb
, &status
)) {
627 if (status
& DSBSTATUS_PLAYING
) {
628 dolog ("warning: voice is already playing\n");
632 dsound_clear_sample (hw
, dsb
);
634 hr
= IDirectSoundBuffer_Play (dsb
, 0, 0, DSBPLAY_LOOPING
);
636 dsound_logerr (hr
, "Can not start playing buffer\n");
642 if (dsound_get_status_out (dsb
, &status
)) {
646 if (status
& DSBSTATUS_PLAYING
) {
647 hr
= IDirectSoundBuffer_Stop (dsb
);
649 dsound_logerr (hr
, "Can not stop playing buffer\n");
654 dolog ("warning: voice is not playing\n");
661 static int dsound_write (SWVoiceOut
*sw
, void *buf
, int len
)
663 return audio_pcm_sw_write (sw
, buf
, len
);
666 static int dsound_run_out (HWVoiceOut
*hw
)
670 DSoundVoiceOut
*ds
= (DSoundVoiceOut
*) hw
;
671 LPDIRECTSOUNDBUFFER dsb
= ds
->dsound_buffer
;
672 int live
, len
, hwshift
;
676 DWORD wpos
, ppos
, old_pos
;
680 dolog ("Attempt to run empty with playback buffer\n");
684 hwshift
= hw
->info
.shift
;
686 live
= audio_pcm_hw_get_live_out (hw
);
688 hr
= IDirectSoundBuffer_GetCurrentPosition (
691 ds
->first_time
? &wpos
: NULL
694 dsound_logerr (hr
, "Can not get playback buffer position\n");
698 len
= live
<< hwshift
;
700 if (ds
->first_time
) {
701 if (conf
.latency_millis
) {
702 DWORD cur_blat
= audio_ring_dist (wpos
, ppos
, hw
->bufsize
);
707 millis_to_bytes (&hw
->info
, conf
.latency_millis
) - cur_blat
;
708 old_pos
%= hw
->bufsize
;
709 old_pos
&= ~hw
->info
.align
;
720 if (ds
->old_pos
== ppos
) {
722 dolog ("old_pos == ppos\n");
728 ds
->played
+= audio_ring_dist (ds
->old_pos
, ppos
, hw
->bufsize
);
730 old_pos
= ds
->old_pos
;
733 if ((old_pos
< ppos
) && ((old_pos
+ len
) > ppos
)) {
734 len
= ppos
- old_pos
;
737 if ((old_pos
> ppos
) && ((old_pos
+ len
) > (ppos
+ hw
->bufsize
))) {
738 len
= hw
->bufsize
- old_pos
+ ppos
;
742 if (audio_bug (AUDIO_FUNC
, len
< 0 || len
> hw
->bufsize
)) {
743 dolog ("len=%d hw->bufsize=%d old_pos=%ld ppos=%ld\n",
744 len
, hw
->bufsize
, old_pos
, ppos
);
748 len
&= ~hw
->info
.align
;
756 err
= dsound_lock_out (
769 len1
= blen1
>> hwshift
;
770 len2
= blen2
>> hwshift
;
774 dsound_write_sample (hw
, p1
, len1
);
778 dsound_write_sample (hw
, p2
, len2
);
781 dsound_unlock_out (dsb
, p1
, p2
, blen1
, blen2
);
782 ds
->old_pos
= (old_pos
+ (decr
<< hwshift
)) % hw
->bufsize
;
785 ds
->mixed
+= decr
<< hwshift
;
787 dolog ("played %lu mixed %lu diff %ld sec %f\n",
790 ds
->mixed
- ds
->played
,
791 abs (ds
->mixed
- ds
->played
) / (double) hw
->info
.bytes_per_second
);
796 static int dsound_ctl_in (HWVoiceIn
*hw
, int cmd
, ...)
800 DSoundVoiceIn
*ds
= (DSoundVoiceIn
*) hw
;
801 LPDIRECTSOUNDCAPTUREBUFFER dscb
= ds
->dsound_capture_buffer
;
804 dolog ("Attempt to control capture voice without a buffer\n");
810 if (dsound_get_status_in (dscb
, &status
)) {
814 if (status
& DSCBSTATUS_CAPTURING
) {
815 dolog ("warning: voice is already capturing\n");
821 hr
= IDirectSoundCaptureBuffer_Start (dscb
, DSCBSTART_LOOPING
);
823 dsound_logerr (hr
, "Can not start capturing\n");
829 if (dsound_get_status_in (dscb
, &status
)) {
833 if (status
& DSCBSTATUS_CAPTURING
) {
834 hr
= IDirectSoundCaptureBuffer_Stop (dscb
);
836 dsound_logerr (hr
, "Can not stop capturing\n");
841 dolog ("warning: voice is not capturing\n");
848 static int dsound_read (SWVoiceIn
*sw
, void *buf
, int len
)
850 return audio_pcm_sw_read (sw
, buf
, len
);
853 static int dsound_run_in (HWVoiceIn
*hw
)
857 DSoundVoiceIn
*ds
= (DSoundVoiceIn
*) hw
;
858 LPDIRECTSOUNDCAPTUREBUFFER dscb
= ds
->dsound_capture_buffer
;
868 dolog ("Attempt to run without capture buffer\n");
872 hwshift
= hw
->info
.shift
;
874 live
= audio_pcm_hw_get_live_in (hw
);
875 dead
= hw
->samples
- live
;
880 hr
= IDirectSoundCaptureBuffer_GetCurrentPosition (
883 ds
->first_time
? &rpos
: NULL
886 dsound_logerr (hr
, "Can not get capture buffer position\n");
890 if (ds
->first_time
) {
892 if (rpos
& hw
->info
.align
) {
893 ldebug ("warning: misaligned capture read position %ld(%d)\n",
894 rpos
, hw
->info
.align
);
896 hw
->wpos
= rpos
>> hwshift
;
899 if (cpos
& hw
->info
.align
) {
900 ldebug ("warning: misaligned capture position %ld(%d)\n",
901 cpos
, hw
->info
.align
);
905 len
= audio_ring_dist (cpos
, hw
->wpos
, hw
->samples
);
909 len
= audio_MIN (len
, dead
);
911 err
= dsound_lock_in (
926 len1
= blen1
>> hwshift
;
927 len2
= blen2
>> hwshift
;
931 hw
->conv (hw
->conv_buf
+ hw
->wpos
, p1
, len1
, &nominal_volume
);
935 hw
->conv (hw
->conv_buf
, p2
, len2
, &nominal_volume
);
938 dsound_unlock_in (dscb
, p1
, p2
, blen1
, blen2
);
939 hw
->wpos
= (hw
->wpos
+ decr
) % hw
->samples
;
943 static void dsound_audio_fini (void *opaque
)
952 hr
= IDirectSound_Release (s
->dsound
);
954 dsound_logerr (hr
, "Can not release DirectSound\n");
958 if (!s
->dsound_capture
) {
962 hr
= IDirectSoundCapture_Release (s
->dsound_capture
);
964 dsound_logerr (hr
, "Can not release DirectSoundCapture\n");
966 s
->dsound_capture
= NULL
;
969 static void *dsound_audio_init (void)
973 dsound
*s
= &glob_dsound
;
975 hr
= CoInitialize (NULL
);
977 dsound_logerr (hr
, "Can not initialize COM\n");
981 hr
= CoCreateInstance (
989 dsound_logerr (hr
, "Can not create DirectSound instance\n");
993 hr
= IDirectSound_Initialize (s
->dsound
, NULL
);
995 dsound_logerr (hr
, "Can not initialize DirectSound\n");
999 hr
= CoCreateInstance (
1000 &CLSID_DirectSoundCapture
,
1003 &IID_IDirectSoundCapture
,
1004 (void **) &s
->dsound_capture
1007 dsound_logerr (hr
, "Can not create DirectSoundCapture instance\n");
1010 hr
= IDirectSoundCapture_Initialize (s
->dsound_capture
, NULL
);
1012 dsound_logerr (hr
, "Can not initialize DirectSoundCapture\n");
1014 hr
= IDirectSoundCapture_Release (s
->dsound_capture
);
1016 dsound_logerr (hr
, "Can not release DirectSoundCapture\n");
1018 s
->dsound_capture
= NULL
;
1022 err
= dsound_open (s
);
1024 dsound_audio_fini (s
);
1031 static struct audio_option dsound_options
[] = {
1032 {"LOCK_RETRIES", AUD_OPT_INT
, &conf
.lock_retries
,
1033 "Number of times to attempt locking the buffer", NULL
, 0},
1034 {"RESTOURE_RETRIES", AUD_OPT_INT
, &conf
.restore_retries
,
1035 "Number of times to attempt restoring the buffer", NULL
, 0},
1036 {"GETSTATUS_RETRIES", AUD_OPT_INT
, &conf
.getstatus_retries
,
1037 "Number of times to attempt getting status of the buffer", NULL
, 0},
1038 {"SET_PRIMARY", AUD_OPT_BOOL
, &conf
.set_primary
,
1039 "Set the parameters of primary buffer", NULL
, 0},
1040 {"LATENCY_MILLIS", AUD_OPT_INT
, &conf
.latency_millis
,
1041 "(undocumented)", NULL
, 0},
1042 {"PRIMARY_FREQ", AUD_OPT_INT
, &conf
.full_fmt
.freq
,
1043 "Primary buffer frequency", NULL
, 0},
1044 {"PRIMARY_CHANNELS", AUD_OPT_INT
, &conf
.full_fmt
.nchannels
,
1045 "Primary buffer number of channels (1 - mono, 2 - stereo)", NULL
, 0},
1046 {"PRIMARY_FMT", AUD_OPT_FMT
, &conf
.full_fmt
.fmt
,
1047 "Primary buffer format", NULL
, 0},
1048 {"BUFSIZE_OUT", AUD_OPT_INT
, &conf
.bufsize_out
,
1049 "(undocumented)", NULL
, 0},
1050 {"BUFSIZE_IN", AUD_OPT_INT
, &conf
.bufsize_in
,
1051 "(undocumented)", NULL
, 0},
1052 {NULL
, 0, NULL
, NULL
, NULL
, 0}
1055 static struct audio_pcm_ops dsound_pcm_ops
= {
1069 struct audio_driver dsound_audio_driver
= {
1070 INIT_FIELD (name
= ) "dsound",
1071 INIT_FIELD (descr
= )
1072 "DirectSound http://wikipedia.org/wiki/DirectSound",
1073 INIT_FIELD (options
= ) dsound_options
,
1074 INIT_FIELD (init
= ) dsound_audio_init
,
1075 INIT_FIELD (fini
= ) dsound_audio_fini
,
1076 INIT_FIELD (pcm_ops
= ) &dsound_pcm_ops
,
1077 INIT_FIELD (can_be_default
= ) 1,
1078 INIT_FIELD (max_voices_out
= ) INT_MAX
,
1079 INIT_FIELD (max_voices_in
= ) 1,
1080 INIT_FIELD (voice_size_out
= ) sizeof (DSoundVoiceOut
),
1081 INIT_FIELD (voice_size_in
= ) sizeof (DSoundVoiceIn
)