winealsa.drv: Add mmdevapi driver.

Joerg-Cyril.Hoehle at Joerg-Cyril.Hoehle at
Tue Apr 26 06:00:58 CDT 2011


+        fmt->Format.nSamplesPerSec = 41100;
+            fmt->nSamplesPerSec != 41100 &&
44100.  IIRC, there was an error exactly like this somewhere in the old drivers.

But why does your IsFormatSupported only accept 48kHz, 44.1, 22.050, etc.?
Do the native drivers behave like this?  Is this a reasonable subset such
that Wine behaves the same on most HW (disregarding CONTINUOUS_RATE)?

+    TRACE("cbSize: %u\n", fmt->cbSize);
Old Wine code contains several comments about never ever reading cbSize
in the WAVE_FORMAT_PCM case because it's a potential read past the structure
and may cause a segmentation fault.  Is it not a valid concern anymore?

WAVEFORMATEX contains the cbSize slot.  However if the winmm:wave* functions
pass through their argument to mmdevapi, it may well end up to be the smaller

MSDN says that CoTaskMemFree will be used to free the output
variable ppClosestMatch.  Wine uses clone_format=>HeapAlloc to allocate
it.  Does CoTaskMemFree match HeapAlloc?  I'd have expected
CoTaskMemAlloc, but I've never used these OLE functions.

+        switch(fmt->wBitsPerSample){
+        case 64:
+            if(!snd_pcm_format_mask_test(formats, SND_PCM_FORMAT_FLOAT64_LE)){
+        if(fmt->wBitsPerSample != 32){
+            WARN("Unsupported float size: %u\n", fmt->wBitsPerSample);
IsFormatSupported may accept 64 bit fp samples, but Initialize will refuse it.
Did you add that code to hear about sound cards that process
64 bits so we know they exist?

 Jörg Höhle

More information about the wine-devel mailing list