Log the format when mmapping the sound device

Francois Gouget fgouget at codeweavers.com
Wed Jun 16 12:22:14 CDT 2004


For many sound devices the mmap fails if the sound device is not in just 
the right format. This is known to happen on many i810 sound devices, 
but also for via8233+Alsa in OSS emulation mode (though it wasn't always 
like this).
The upshot is that when debugging DirectSound problems it's critical to 
know what's the format of the sound device when an mmap succeeds or fails.


Changelog:

  * dlls/winmm/wineoss/audio.c

    Francois Gouget <fgouget at codeweavers.com>
    Log the format when mapping the sound device (or failing to).

-- 
Francois Gouget
fgouget at codeweavers.com

-------------- next part --------------
Index: dlls/winmm/wineoss/audio.c
===================================================================
RCS file: /var/cvs/wine/dlls/winmm/wineoss/audio.c,v
retrieving revision 1.131
diff -u -r1.131 audio.c
--- a/dlls/winmm/wineoss/audio.c	15 Jun 2004 20:25:46 -0000	1.131
+++ b/dlls/winmm/wineoss/audio.c	16 Jun 2004 17:19:15 -0000
@@ -2509,15 +2509,16 @@
 
 static HRESULT DSDB_MapBuffer(IDsDriverBufferImpl *dsdb)
 {
-    TRACE("(%p)\n",dsdb);
+    TRACE("(%p), format=%ldx%dx%d\n", dsdb, dsdb->wfx.nSamplesPerSec,
+          dsdb->wfx.wBitsPerSample, dsdb->wfx.nChannels);
     if (!dsdb->mapping) {
         dsdb->mapping = mmap(NULL, dsdb->maplen, PROT_WRITE, MAP_SHARED,
                              dsdb->fd, 0);
         if (dsdb->mapping == (LPBYTE)-1) {
-            TRACE("(%p): Could not map sound device for direct access (%s)\n", dsdb, strerror(errno));
+            TRACE("Could not map sound device for direct access (%s)\n", strerror(errno));
             return DSERR_GENERIC;
         }
-        TRACE("(%p): sound device has been mapped for direct access at %p, size=%ld\n", dsdb, dsdb->mapping, dsdb->maplen);
+        TRACE("The sound device has been mapped for direct access at %p, size=%ld\n", dsdb->mapping, dsdb->maplen);
 
 	/* for some reason, es1371 and sblive! sometimes have junk in here.
 	 * clear it, or we get junk noise */


More information about the wine-patches mailing list