]> Repos - portaudio/commitdiff
wasapi:
authordmitrykos <dmitrykos@0f58301d-fd10-0410-b4af-bbb618454e57>
Mon, 17 May 2010 21:15:13 +0000 (21:15 +0000)
committerdmitrykos <dmitrykos@0f58301d-fd10-0410-b4af-bbb618454e57>
Mon, 17 May 2010 21:15:13 +0000 (21:15 +0000)
 - using WOW64 workaround (fall-back to a Poll-driven mode) for any WOW64 process regardless of Windows version due to report of same bug under Windows 7 x64

src/hostapi/wasapi/pa_win_wasapi.c

index 46651299ba5f767e386733a25718d8c74a79ac44..f889c7e78758977be836545c6eb004a48299e688 100644 (file)
@@ -453,8 +453,8 @@ typedef struct
 \r
     PaWasapiDeviceInfo *devInfo;\r
 \r
-       // Is true when WOW64 Vista Workaround is needed\r
-       BOOL useVistaWOW64Workaround;\r
+       // Is true when WOW64 Vista/7 Workaround is needed\r
+       BOOL useWOW64Workaround;\r
 }\r
 PaWasapiHostApiRepresentation;\r
 \r
@@ -871,9 +871,13 @@ static UINT32 GetWindowsVersion()
 }\r
 \r
 // ------------------------------------------------------------------------------------------\r
-static BOOL UseWOW64VistaWorkaround()\r
+static BOOL UseWOW64Workaround()\r
 {\r
-       return (IsWow64() && (GetWindowsVersion() & WINDOWS_VISTA_SERVER2008));\r
+       // note: Excluded OS version check as it is reported that event-driven mode \r
+       //       fails under Windows 7 as well. Now let's assume any WOW64 process \r
+       //       requires a wokaround.\r
+\r
+       return (IsWow64()/* && (GetWindowsVersion() & WINDOWS_VISTA_SERVER2008)*/);\r
 }\r
 \r
 // ------------------------------------------------------------------------------------------\r
@@ -1255,7 +1259,7 @@ PaError PaWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd
 \r
 \r
        // findout if platform workaround is required\r
-       paWasapi->useVistaWOW64Workaround = UseWOW64VistaWorkaround();\r
+       paWasapi->useWOW64Workaround = UseWOW64Workaround();\r
 \r
     SAFE_RELEASE(pEndPoints);\r
 \r
@@ -2214,7 +2218,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
 \r
                // Choose processing mode\r
                stream->in.streamFlags = AUDCLNT_STREAMFLAGS_EVENTCALLBACK;\r
-               if (paWasapi->useVistaWOW64Workaround)\r
+               if (paWasapi->useWOW64Workaround)\r
                        stream->in.streamFlags = 0; // polling interface\r
                if (streamCallback == NULL)\r
                        stream->in.streamFlags = 0; // polling interface\r
@@ -2286,7 +2290,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
                // Append buffer latency to interface latency in shared mode (see GetStreamLatency notes)\r
                stream->in.latency_seconds += buffer_latency;\r
 \r
-               PRINT(("PaWASAPIOpenStream(input): framesPerHostCallback[ %d ] latency[ %.02fms ] exclusive[ %s ] wow64_fix[ %s ]\n", (UINT32)stream->in.framesPerHostCallback, (float)(stream->in.latency_seconds*1000.0f), (stream->in.shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE ? "YES" : "NO"), (paWasapi->useVistaWOW64Workaround ? "YES" : "NO")));\r
+               PRINT(("PaWASAPIOpenStream(input): framesPerHostCallback[ %d ] latency[ %.02fms ] exclusive[ %s ] wow64_fix[ %s ]\n", (UINT32)stream->in.framesPerHostCallback, (float)(stream->in.latency_seconds*1000.0f), (stream->in.shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE ? "YES" : "NO"), (paWasapi->useWOW64Workaround ? "YES" : "NO")));\r
        }\r
     else\r
     {\r
@@ -2323,7 +2327,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
 \r
                // Choose processing mode\r
                stream->out.streamFlags = AUDCLNT_STREAMFLAGS_EVENTCALLBACK;\r
-               if (paWasapi->useVistaWOW64Workaround)\r
+               if (paWasapi->useWOW64Workaround)\r
                        stream->out.streamFlags = 0; // polling interface\r
                if (streamCallback == NULL)\r
                        stream->out.streamFlags = 0; // polling interface\r
@@ -2395,7 +2399,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
                // Append buffer latency to interface latency in shared mode (see GetStreamLatency notes)\r
                stream->out.latency_seconds += buffer_latency;\r
 \r
-               PRINT(("PaWASAPIOpenStream(output): framesPerHostCallback[ %d ] latency[ %.02fms ] exclusive[ %s ] wow64_fix[ %s ]\n", (UINT32)stream->out.framesPerHostCallback, (float)(stream->out.latency_seconds*1000.0f), (stream->out.shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE ? "YES" : "NO"), (paWasapi->useVistaWOW64Workaround ? "YES" : "NO")));\r
+               PRINT(("PaWASAPIOpenStream(output): framesPerHostCallback[ %d ] latency[ %.02fms ] exclusive[ %s ] wow64_fix[ %s ]\n", (UINT32)stream->out.framesPerHostCallback, (float)(stream->out.latency_seconds*1000.0f), (stream->out.shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE ? "YES" : "NO"), (paWasapi->useWOW64Workaround ? "YES" : "NO")));\r
        }\r
     else\r
     {\r