2 * Sample Wine Driver for Advanced Linux Sound System (ALSA)
3 * Based on version <final> of the ALSA API
5 * Copyright 2002 Eric Pouech
6 * 2002 Marco Pietrobono
7 * 2003 Christian Costa : WaveIn support
8 * 2006-2007 Maarten Lankhorst
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 /*======================================================================*
26 * Low level dsound output implementation *
27 *======================================================================*/
30 #include "wine/port.h"
42 #ifdef HAVE_SYS_IOCTL_H
43 # include <sys/ioctl.h>
45 #ifdef HAVE_SYS_MMAN_H
46 # include <sys/mman.h>
57 #include "wine/library.h"
58 #include "wine/unicode.h"
59 #include "wine/debug.h"
63 WINE_DEFAULT_DEBUG_CHANNEL(wave);
64 WINE_DECLARE_DEBUG_CHANNEL(waveloop);
66 typedef struct IDsDriverImpl IDsDriverImpl;
67 typedef struct IDsDriverBufferImpl IDsDriverBufferImpl;
72 const IDsDriverVtbl *lpVtbl;
74 /* IDsDriverImpl fields */
76 IDsDriverBufferImpl*primary;
79 struct IDsDriverBufferImpl
82 const IDsDriverBufferVtbl *lpVtbl;
84 /* IDsDriverBufferImpl fields */
88 DWORD mmap_buflen_bytes;
89 snd_pcm_uframes_t mmap_buflen_frames;
90 snd_pcm_channel_area_t * mmap_areas;
91 snd_pcm_uframes_t mmap_ppos; /* play position */
92 snd_pcm_uframes_t mmap_wpos; /* write position */
94 ALSA_MSG_RING mmap_ring; /* sync object */
97 static void DSDB_CheckXRUN(IDsDriverBufferImpl* pdbi)
99 WINE_WAVEDEV * wwo = &(WOutDev[pdbi->drv->wDevID]);
100 snd_pcm_state_t state = snd_pcm_state(wwo->pcm);
101 snd_pcm_avail_update(wwo->pcm);
103 if ( state == SND_PCM_STATE_XRUN )
105 int err = snd_pcm_prepare(wwo->pcm);
106 WARN_(waveloop)("xrun occurred\n");
108 ERR("recovery from xrun failed, prepare failed: %s\n", snd_strerror(err));
110 else if ( state == SND_PCM_STATE_SUSPENDED )
112 int err = snd_pcm_resume(wwo->pcm);
113 TRACE_(waveloop)("recovery from suspension occurred\n");
114 if (err < 0 && err != -EAGAIN){
115 err = snd_pcm_prepare(wwo->pcm);
117 ERR("recovery from suspend failed, prepare failed: %s\n", snd_strerror(err));
119 } else if ( state != SND_PCM_STATE_RUNNING ) {
120 WARN_(waveloop)("Unhandled state: %d\n", state);
125 * The helper thread for DirectSound
127 * Basically it does an infinite loop until it is told to die
129 * snd_pcm_wait() is a call that polls the sound buffer and waits
130 * until there is at least 1 period free before it returns.
132 * We then commit the buffer filled by the owner of this
134 static DWORD CALLBACK DBSB_MMAPLoop(LPVOID data)
136 IDsDriverBufferImpl* pdbi = (IDsDriverBufferImpl*)data;
137 WINE_WAVEDEV *wwo = &(WOutDev[pdbi->drv->wDevID]);
138 snd_pcm_uframes_t frames, wanted, ofs;
139 const snd_pcm_channel_area_t *areas;
140 int state = WINE_WS_STOPPED;
141 snd_pcm_state_t alsastate;
143 TRACE_(waveloop)("0x%8p\n", data);
144 TRACE("0x%8p, framelength: %lu, area: %8p\n", data, pdbi->mmap_buflen_frames, pdbi->mmap_areas);
147 enum win_wm_message msg;
151 snd_pcm_format_t format;
153 if (state != WINE_WS_PLAYING)
155 ALSA_WaitRingMessage(&pdbi->mmap_ring, 1000000);
156 ALSA_RetrieveRingMessage(&pdbi->mmap_ring, &msg, ¶m, &hEvent);
159 while (!ALSA_RetrieveRingMessage(&pdbi->mmap_ring, &msg, ¶m, &hEvent))
161 snd_pcm_wait(wwo->pcm, -1);
162 DSDB_CheckXRUN(pdbi);
164 wanted = frames = pdbi->mmap_buflen_frames;
166 err = snd_pcm_mmap_begin(wwo->pcm, &areas, &ofs, &frames);
167 snd_pcm_mmap_commit(wwo->pcm, ofs, frames);
169 /* mark our current play position */
170 pdbi->mmap_ppos = ofs;
171 TRACE_(waveloop)("Updated position to %lx [%d, 0x%8p, %lu]\n", ofs, err, areas, frames);
172 /* Check to make sure we committed all we want to commit. ALSA
173 * only gives a contiguous linear region, so we need to check this
174 * in case we've reached the end of the buffer, in which case we
175 * can wrap around back to the beginning. */
176 if (frames < wanted) {
177 frames = wanted - frames;
178 snd_pcm_mmap_begin(wwo->pcm, &areas, &ofs, &frames);
179 snd_pcm_mmap_commit(wwo->pcm, ofs, frames);
182 snd_pcm_mmap_begin(wwo->pcm, &areas, &ofs, &wanted);
183 snd_pcm_mmap_commit(wwo->pcm, ofs, wanted);
184 pdbi->mmap_wpos = ofs;
188 case WINE_WM_STARTING:
189 if (state == WINE_WS_PLAYING)
192 alsastate = snd_pcm_state(wwo->pcm);
193 if ( alsastate == SND_PCM_STATE_SETUP )
195 err = snd_pcm_prepare(wwo->pcm);
196 alsastate = snd_pcm_state(wwo->pcm);
199 snd_pcm_avail_update(wwo->pcm);
201 /* Rewind, and initialise */
203 snd_pcm_mmap_begin(wwo->pcm, &areas, &ofs, &frames);
204 snd_pcm_mmap_commit(wwo->pcm, ofs, frames);
205 snd_pcm_rewind(wwo->pcm, ofs);
206 snd_pcm_hw_params_get_format(wwo->hw_params, &format);
207 snd_pcm_format_set_silence(format, pdbi->mmap_buffer, pdbi->mmap_buflen_frames);
209 snd_pcm_hw_params_get_period_size(wwo->hw_params, &wanted, NULL);
210 pdbi->mmap_wpos = 2*wanted;
211 if ( alsastate == SND_PCM_STATE_PREPARED )
213 err = snd_pcm_start(wwo->pcm);
214 TRACE("Starting 0x%8p err: %d\n", wwo->pcm, err);
216 state = WINE_WS_PLAYING;
219 case WINE_WM_STOPPING:
220 state = WINE_WS_STOPPED;
221 snd_pcm_drop(wwo->pcm);
224 case WINE_WM_CLOSING:
225 if (wwo->pcm != NULL)
226 snd_pcm_drop(wwo->pcm);
227 pdbi->mmap_thread = NULL;
231 ERR("Unhandled event %s\n", ALSA_getCmdString(msg));
234 if (hEvent != INVALID_HANDLE_VALUE)
238 TRACE_(waveloop)("Destroyed MMAP thread\n");
239 TRACE("Destroyed MMAP thread\n");
244 * Allocate the memory-mapped buffer for direct sound, and set up the
247 static int DSDB_CreateMMAP(IDsDriverBufferImpl* pdbi)
249 WINE_WAVEDEV * wwo = &(WOutDev[pdbi->drv->wDevID]);
250 snd_pcm_format_t format;
251 snd_pcm_uframes_t frames, ofs, avail, psize;
252 unsigned int channels, bits_per_sample, bits_per_frame;
255 mmap_mode = snd_pcm_type(wwo->pcm);
257 ALSA_InitRingMessage(&pdbi->mmap_ring);
259 if (mmap_mode == SND_PCM_TYPE_HW) {
260 TRACE("mmap'd buffer is a hardware buffer.\n");
263 #if 0 /* Horribly hack, shouldn't be used */
264 err = snd_pcm_hw_params_get_period_size(wwo->hw_params, &psize, NULL);
265 /* Set only a buffer of 2 period sizes, to decrease latency */
267 err = snd_pcm_hw_params_set_buffer_size_near(wwo->pcm, wwo->hw_params, &psize);
271 ERR("Errno %d (%s) occurred when setting buffer size\n", err, strerror(errno));
274 TRACE("mmap'd buffer is an ALSA emulation of hardware buffer.\n");
277 err = snd_pcm_hw_params_get_period_size(wwo->hw_params, &psize, NULL);
278 err = snd_pcm_hw_params_get_format(wwo->hw_params, &format);
279 err = snd_pcm_hw_params_get_buffer_size(wwo->hw_params, &frames);
280 err = snd_pcm_hw_params_get_channels(wwo->hw_params, &channels);
281 bits_per_sample = snd_pcm_format_physical_width(format);
282 bits_per_frame = bits_per_sample * channels;
285 ALSA_TraceParameters(wwo->hw_params, NULL, FALSE);
287 TRACE("format=%s frames=%ld channels=%d bits_per_sample=%d bits_per_frame=%d\n",
288 snd_pcm_format_name(format), frames, channels, bits_per_sample, bits_per_frame);
290 pdbi->mmap_buflen_frames = frames;
291 pdbi->mmap_buflen_bytes = snd_pcm_frames_to_bytes( wwo->pcm, frames );
293 avail = snd_pcm_avail_update(wwo->pcm);
296 ERR("No buffer is available: %s.\n", snd_strerror(avail));
297 return DSERR_GENERIC;
299 err = snd_pcm_mmap_begin(wwo->pcm, (const snd_pcm_channel_area_t **)&pdbi->mmap_areas, &ofs, &avail);
302 ERR("Can't map sound device for direct access: %s\n", snd_strerror(err));
303 return DSERR_GENERIC;
305 avail = 0;/* We don't have any data to commit yet */
306 err = snd_pcm_mmap_commit(wwo->pcm, ofs, avail);
308 err = snd_pcm_rewind(wwo->pcm, ofs);
309 pdbi->mmap_buffer = pdbi->mmap_areas->addr;
310 pdbi->mmap_thread = NULL;
312 TRACE("created mmap buffer of %ld frames (%d bytes) at %p\n",
313 frames, pdbi->mmap_buflen_bytes, pdbi->mmap_buffer);
318 static HRESULT WINAPI IDsDriverBufferImpl_QueryInterface(PIDSDRIVERBUFFER iface, REFIID riid, LPVOID *ppobj)
320 /* IDsDriverBufferImpl *This = (IDsDriverBufferImpl *)iface; */
321 FIXME("(): stub!\n");
322 return DSERR_UNSUPPORTED;
325 static ULONG WINAPI IDsDriverBufferImpl_AddRef(PIDSDRIVERBUFFER iface)
327 IDsDriverBufferImpl *This = (IDsDriverBufferImpl *)iface;
328 ULONG refCount = InterlockedIncrement(&This->ref);
330 TRACE("(%p)->(ref before=%u)\n",This, refCount - 1);
335 static ULONG WINAPI IDsDriverBufferImpl_Release(PIDSDRIVERBUFFER iface)
337 IDsDriverBufferImpl *This = (IDsDriverBufferImpl *)iface;
338 ULONG refCount = InterlockedDecrement(&This->ref);
340 TRACE("(%p)->(ref before=%u)\n",This, refCount + 1);
345 if (This->mmap_thread != NULL)
346 ALSA_AddRingMessage(&This->mmap_ring, WINE_WM_CLOSING, 0, 1);
348 TRACE("mmap buffer %p destroyed\n", This->mmap_buffer);
349 ALSA_DestroyRingMessage(&This->mmap_ring);
351 if (This == This->drv->primary)
352 This->drv->primary = NULL;
353 HeapFree(GetProcessHeap(), 0, This);
357 static HRESULT WINAPI IDsDriverBufferImpl_Lock(PIDSDRIVERBUFFER iface,
358 LPVOID*ppvAudio1,LPDWORD pdwLen1,
359 LPVOID*ppvAudio2,LPDWORD pdwLen2,
360 DWORD dwWritePosition,DWORD dwWriteLen,
363 /* IDsDriverBufferImpl *This = (IDsDriverBufferImpl *)iface; */
364 TRACE("(%p)\n",iface);
365 return DSERR_UNSUPPORTED;
368 static HRESULT WINAPI IDsDriverBufferImpl_Unlock(PIDSDRIVERBUFFER iface,
369 LPVOID pvAudio1,DWORD dwLen1,
370 LPVOID pvAudio2,DWORD dwLen2)
372 /* IDsDriverBufferImpl *This = (IDsDriverBufferImpl *)iface; */
373 TRACE("(%p)\n",iface);
374 return DSERR_UNSUPPORTED;
377 static HRESULT WINAPI IDsDriverBufferImpl_SetFormat(PIDSDRIVERBUFFER iface,
380 /* IDsDriverBufferImpl *This = (IDsDriverBufferImpl *)iface; */
381 TRACE("(%p,%p)\n",iface,pwfx);
382 return DSERR_BUFFERLOST;
385 static HRESULT WINAPI IDsDriverBufferImpl_SetFrequency(PIDSDRIVERBUFFER iface, DWORD dwFreq)
387 /* IDsDriverBufferImpl *This = (IDsDriverBufferImpl *)iface; */
388 TRACE("(%p,%d): stub\n",iface,dwFreq);
389 return DSERR_UNSUPPORTED;
392 static HRESULT WINAPI IDsDriverBufferImpl_SetVolumePan(PIDSDRIVERBUFFER iface, PDSVOLUMEPAN pVolPan)
395 IDsDriverBufferImpl *This = (IDsDriverBufferImpl *)iface;
396 TRACE("(%p,%p)\n",iface,pVolPan);
397 vol = pVolPan->dwTotalLeftAmpFactor | (pVolPan->dwTotalRightAmpFactor << 16);
399 if (wodSetVolume(This->drv->wDevID, vol) != MMSYSERR_NOERROR) {
400 WARN("wodSetVolume failed\n");
401 return DSERR_INVALIDPARAM;
407 static HRESULT WINAPI IDsDriverBufferImpl_SetPosition(PIDSDRIVERBUFFER iface, DWORD dwNewPos)
409 /* IDsDriverImpl *This = (IDsDriverImpl *)iface; */
410 FIXME("(%p,%d): stub\n",iface,dwNewPos);
411 return DSERR_UNSUPPORTED;
414 static HRESULT WINAPI IDsDriverBufferImpl_GetPosition(PIDSDRIVERBUFFER iface,
415 LPDWORD lpdwPlay, LPDWORD lpdwWrite)
417 IDsDriverBufferImpl *This = (IDsDriverBufferImpl *)iface;
418 WINE_WAVEDEV * wwo = &(WOutDev[This->drv->wDevID]);
419 snd_pcm_uframes_t hw_pptr, hw_wptr;
420 snd_pcm_state_t state;
422 if (wwo->hw_params == NULL || wwo->pcm == NULL) return DSERR_GENERIC;
424 #if 0 /* Shouldn't be needed */
425 /* we need to track down buffer underruns */
426 DSDB_CheckXRUN(This);
429 state = snd_pcm_state(wwo->pcm);
430 if (state == SND_PCM_STATE_RUNNING)
432 hw_pptr = This->mmap_ppos;
433 hw_wptr = This->mmap_wpos;
436 hw_pptr = hw_wptr = 0;
439 *lpdwPlay = snd_pcm_frames_to_bytes(wwo->pcm, hw_pptr) % This->mmap_buflen_bytes;
441 *lpdwWrite = snd_pcm_frames_to_bytes(wwo->pcm, hw_wptr) % This->mmap_buflen_bytes;
443 TRACE_(waveloop)("hw_pptr=0x%08x, hw_wptr=0x%08x playpos=%d, writepos=%d\n", (unsigned int)hw_pptr, (unsigned int)hw_wptr, lpdwPlay?*lpdwPlay:-1, lpdwWrite?*lpdwWrite:-1);
447 static HRESULT WINAPI IDsDriverBufferImpl_Play(PIDSDRIVERBUFFER iface, DWORD dwRes1, DWORD dwRes2, DWORD dwFlags)
449 IDsDriverBufferImpl *This = (IDsDriverBufferImpl *)iface;
451 TRACE("(%p,%x,%x,%x)\n",iface,dwRes1,dwRes2,dwFlags);
453 if (This->mmap_thread == NULL)
454 This->mmap_thread = CreateThread(NULL, 0, DBSB_MMAPLoop, (LPVOID)(DWORD)This, 0, NULL);
456 if (This->mmap_thread == NULL)
457 ERR("Cannot create sound thread, don't expect any sound at all\n");
459 ALSA_AddRingMessage(&This->mmap_ring, WINE_WM_STARTING, 0, 1);
464 static HRESULT WINAPI IDsDriverBufferImpl_Stop(PIDSDRIVERBUFFER iface)
466 IDsDriverBufferImpl *This = (IDsDriverBufferImpl *)iface;
468 TRACE("(%p)\n",iface);
470 if (This->mmap_thread != NULL)
471 ALSA_AddRingMessage(&This->mmap_ring, WINE_WM_STOPPING, 0, 1);
476 static const IDsDriverBufferVtbl dsdbvt =
478 IDsDriverBufferImpl_QueryInterface,
479 IDsDriverBufferImpl_AddRef,
480 IDsDriverBufferImpl_Release,
481 IDsDriverBufferImpl_Lock,
482 IDsDriverBufferImpl_Unlock,
483 IDsDriverBufferImpl_SetFormat,
484 IDsDriverBufferImpl_SetFrequency,
485 IDsDriverBufferImpl_SetVolumePan,
486 IDsDriverBufferImpl_SetPosition,
487 IDsDriverBufferImpl_GetPosition,
488 IDsDriverBufferImpl_Play,
489 IDsDriverBufferImpl_Stop
492 static HRESULT WINAPI IDsDriverImpl_QueryInterface(PIDSDRIVER iface, REFIID riid, LPVOID *ppobj)
494 /* IDsDriverImpl *This = (IDsDriverImpl *)iface; */
495 FIXME("(%p): stub!\n",iface);
496 return DSERR_UNSUPPORTED;
499 static ULONG WINAPI IDsDriverImpl_AddRef(PIDSDRIVER iface)
501 IDsDriverImpl *This = (IDsDriverImpl *)iface;
502 ULONG refCount = InterlockedIncrement(&This->ref);
504 TRACE("(%p)->(ref before=%u)\n",This, refCount - 1);
509 static ULONG WINAPI IDsDriverImpl_Release(PIDSDRIVER iface)
511 IDsDriverImpl *This = (IDsDriverImpl *)iface;
512 ULONG refCount = InterlockedDecrement(&This->ref);
514 TRACE("(%p)->(ref before=%u)\n",This, refCount + 1);
518 HeapFree(GetProcessHeap(),0,This);
522 static HRESULT WINAPI IDsDriverImpl_GetDriverDesc(PIDSDRIVER iface, PDSDRIVERDESC pDesc)
524 IDsDriverImpl *This = (IDsDriverImpl *)iface;
525 TRACE("(%p,%p)\n",iface,pDesc);
526 memcpy(pDesc, &(WOutDev[This->wDevID].ds_desc), sizeof(DSDRIVERDESC));
527 pDesc->dwFlags = DSDDESC_DOMMSYSTEMOPEN | DSDDESC_DOMMSYSTEMSETFORMAT |
528 DSDDESC_USESYSTEMMEMORY | DSDDESC_DONTNEEDPRIMARYLOCK;
529 pDesc->dnDevNode = WOutDev[This->wDevID].waveDesc.dnDevNode;
531 pDesc->wReserved = 0;
532 pDesc->ulDeviceNum = This->wDevID;
533 pDesc->dwHeapType = DSDHEAP_NOHEAP;
534 pDesc->pvDirectDrawHeap = NULL;
535 pDesc->dwMemStartAddress = 0;
536 pDesc->dwMemEndAddress = 0;
537 pDesc->dwMemAllocExtra = 0;
538 pDesc->pvReserved1 = NULL;
539 pDesc->pvReserved2 = NULL;
543 static HRESULT WINAPI IDsDriverImpl_Open(PIDSDRIVER iface)
545 /* IDsDriverImpl *This = (IDsDriverImpl *)iface; */
546 TRACE("(%p)\n",iface);
550 static HRESULT WINAPI IDsDriverImpl_Close(PIDSDRIVER iface)
552 /* IDsDriverImpl *This = (IDsDriverImpl *)iface; */
553 TRACE("(%p)\n",iface);
557 static HRESULT WINAPI IDsDriverImpl_GetCaps(PIDSDRIVER iface, PDSDRIVERCAPS pCaps)
559 IDsDriverImpl *This = (IDsDriverImpl *)iface;
560 TRACE("(%p,%p)\n",iface,pCaps);
561 memcpy(pCaps, &(WOutDev[This->wDevID].ds_caps), sizeof(DSDRIVERCAPS));
565 static HRESULT WINAPI IDsDriverImpl_CreateSoundBuffer(PIDSDRIVER iface,
567 DWORD dwFlags, DWORD dwCardAddress,
568 LPDWORD pdwcbBufferSize,
572 IDsDriverImpl *This = (IDsDriverImpl *)iface;
573 IDsDriverBufferImpl** ippdsdb = (IDsDriverBufferImpl**)ppvObj;
576 TRACE("(%p,%p,%x,%x)\n",iface,pwfx,dwFlags,dwCardAddress);
577 /* we only support primary buffers */
578 if (!(dwFlags & DSBCAPS_PRIMARYBUFFER))
579 return DSERR_UNSUPPORTED;
581 return DSERR_ALLOCATED;
582 if (dwFlags & (DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLPAN))
583 return DSERR_CONTROLUNAVAIL;
585 *ippdsdb = HeapAlloc(GetProcessHeap(),0,sizeof(IDsDriverBufferImpl));
586 if (*ippdsdb == NULL)
587 return DSERR_OUTOFMEMORY;
588 (*ippdsdb)->lpVtbl = &dsdbvt;
590 (*ippdsdb)->drv = This;
592 err = DSDB_CreateMMAP((*ippdsdb));
595 HeapFree(GetProcessHeap(), 0, *ippdsdb);
599 *ppbBuffer = (*ippdsdb)->mmap_buffer;
600 *pdwcbBufferSize = (*ippdsdb)->mmap_buflen_bytes;
602 This->primary = *ippdsdb;
604 /* buffer is ready to go */
605 TRACE("buffer created at %p\n", *ippdsdb);
609 static HRESULT WINAPI IDsDriverImpl_DuplicateSoundBuffer(PIDSDRIVER iface,
610 PIDSDRIVERBUFFER pBuffer,
613 /* IDsDriverImpl *This = (IDsDriverImpl *)iface; */
614 TRACE("(%p,%p): stub\n",iface,pBuffer);
615 return DSERR_INVALIDCALL;
618 static const IDsDriverVtbl dsdvt =
620 IDsDriverImpl_QueryInterface,
621 IDsDriverImpl_AddRef,
622 IDsDriverImpl_Release,
623 IDsDriverImpl_GetDriverDesc,
626 IDsDriverImpl_GetCaps,
627 IDsDriverImpl_CreateSoundBuffer,
628 IDsDriverImpl_DuplicateSoundBuffer
631 DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv)
633 IDsDriverImpl** idrv = (IDsDriverImpl**)drv;
635 TRACE("driver created\n");
637 /* the HAL isn't much better than the HEL if we can't do mmap() */
638 if (!(WOutDev[wDevID].outcaps.dwSupport & WAVECAPS_DIRECTSOUND)) {
639 ERR("DirectSound flag not set\n");
640 MESSAGE("This sound card's driver does not support direct access\n");
641 MESSAGE("The (slower) DirectSound HEL mode will be used instead.\n");
642 return MMSYSERR_NOTSUPPORTED;
645 *idrv = HeapAlloc(GetProcessHeap(),0,sizeof(IDsDriverImpl));
647 return MMSYSERR_NOMEM;
648 (*idrv)->lpVtbl = &dsdvt;
651 (*idrv)->wDevID = wDevID;
652 (*idrv)->primary = NULL;
653 return MMSYSERR_NOERROR;
656 DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc)
658 memcpy(desc, &(WOutDev[wDevID].ds_desc), sizeof(DSDRIVERDESC));
659 return MMSYSERR_NOERROR;
662 #endif /* HAVE_ALSA */