Index: pjproject/trunk/pjproject-vs8.sln
===================================================================
--- pjproject/trunk/pjproject-vs8.sln	(revision 2838)
+++ pjproject/trunk/pjproject-vs8.sln	(revision 2839)
@@ -3158,5 +3158,6 @@
 		{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
 		{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
-		{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug|Win32.ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
+		{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug|Win32.Build.0 = Debug|Win32
 		{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
 		{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
@@ -3196,5 +3197,6 @@
 		{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)
 		{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)
-		{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release|Win32.ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)
+		{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release|Win32.ActiveCfg = Release|Win32
+		{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release|Win32.Build.0 = Release|Win32
 		{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)
 		{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)
Index: pjproject/trunk/pjsip-apps/build/pjsystest.dsp
===================================================================
--- pjproject/trunk/pjsip-apps/build/pjsystest.dsp	(revision 2838)
+++ pjproject/trunk/pjsip-apps/build/pjsystest.dsp	(revision 2839)
@@ -92,11 +92,4 @@
 
 SOURCE=..\src\pjsystest\main_console.c
-
-!IF  "$(CFG)" == "pjsystest - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "pjsystest - Win32 Debug"
-
-!ENDIF 
-
 # End Source File
 # Begin Source File
Index: pjproject/trunk/pjsip-apps/build/pjsystest.vcproj
===================================================================
--- pjproject/trunk/pjsip-apps/build/pjsystest.vcproj	(revision 2838)
+++ pjproject/trunk/pjsip-apps/build/pjsystest.vcproj	(revision 2839)
@@ -15,4 +15,7 @@
 			Name="Windows Mobile 6 Professional SDK (ARMV4I)"
 		/>
+		<Platform
+			Name="Win32"
+		/>
 	</Platforms>
 	<ToolFiles>
@@ -159,4 +162,67 @@
 		</Configuration>
 		<Configuration
+			Name="Debug|Win32"
+			ConfigurationType="1"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../pjsip/include,../../pjlib/include,../../pjlib-util/include,../../pjmedia/include,../../pjnath/include"
+				PreprocessorDefinitions="_CONSOLE;"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Iphlpapi.lib  dsound.lib dxguid.lib netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib ole32.lib user32.lib gdi32.lib advapi32.lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
 			Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)"
 			ConfigurationType="1"
@@ -295,4 +361,67 @@
 			/>
 			<DebuggerTool
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			ConfigurationType="1"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../../pjsip/include,../../pjlib/include,../../pjlib-util/include,../../pjmedia/include,../../pjnath/include"
+				PreprocessorDefinitions="_CONSOLE;"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Iphlpapi.lib  dsound.lib dxguid.lib netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib ole32.lib user32.lib gdi32.lib advapi32.lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
 			/>
 		</Configuration>
@@ -345,4 +474,20 @@
 				RelativePath="..\src\pjsystest\main_wm.c"
 				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
 			</File>
 			<File
Index: pjproject/trunk/pjsip-apps/src/pjsystest/systest.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/pjsystest/systest.c	(revision 2838)
+++ pjproject/trunk/pjsip-apps/src/pjsystest/systest.c	(revision 2839)
@@ -378,20 +378,16 @@
     rec_id = PJSUA_INVALID_ID;
 
+    status = pjsua_player_create(&filename, 0, &play_id);
+    if (status != PJ_SUCCESS)
+	goto on_return;
+
+    play_slot = pjsua_player_get_conf_port(play_id);
+
+    status = pjsua_conf_connect(play_slot, 0);
+    if (status != PJ_SUCCESS)
+	goto on_return;
+
     key = gui_msgbox(title,
-		     "Recording has been stopped. Press OK to playback "
-		     "the recorded audio.", 
-		      WITH_OK);
-    
-    status = pjsua_player_create(&filename, 0, &play_id);
-    if (status != PJ_SUCCESS)
-	goto on_return;
-
-    play_slot = pjsua_player_get_conf_port(play_id);
-
-    status = pjsua_conf_connect(play_slot, 0);
-    if (status != PJ_SUCCESS)
-	goto on_return;
-
-    key = gui_msgbox(title,
+		     "Recording has been stopped. "
 		     "The recorded audio is being played now to "
 		     "the speaker device, in a loop. Listen for "
@@ -487,5 +483,5 @@
     param.rec_id = systest.rec_id;
     param.play_id = systest.play_id;
-    param.clock_rate = systest.media_cfg.clock_rate;
+    param.clock_rate = systest.media_cfg.snd_clock_rate;
     param.channel_count = systest.media_cfg.channel_count;
     param.samples_per_frame = param.clock_rate * param.channel_count * 
@@ -569,6 +565,6 @@
 
 	pj_ansi_snprintf(drifttext, sizeof(drifttext),
-			"Clock drifts detected. Capture device "
-			"is running %d samples per second %s "
+			"Clock drifts detected. Capture "
+			"is %d samples/sec %s "
 			"than the playback device",
 			drift, which);
@@ -681,5 +677,5 @@
 	lat = (max_echo_pos - max_signal_pos) * 1000 / wav->info.clock_rate;
 
-#if 1
+#if 0
 	PJ_LOG(4,(THIS_FILE, "Signal at %dms, echo at %d ms, latency %d ms",
 		  max_signal_pos * 1000 / wav->info.clock_rate,
@@ -771,4 +767,5 @@
 
     /* We're running */
+    PJ_LOG(3,(THIS_FILE, "Please wait while test is running (~10 sec)"));
     gui_sleep(10);
 
@@ -947,6 +944,10 @@
     len = strlen(textbuf);
 
-    pj_ansi_snprintf(textbuf+len, sizeof(textbuf)-len, "Clock rate: %d\r\n",
+    pj_ansi_snprintf(textbuf+len, sizeof(textbuf)-len, "Test clock rate: %d\r\n",
 		     systest.media_cfg.clock_rate);
+    len = strlen(textbuf);
+
+    pj_ansi_snprintf(textbuf+len, sizeof(textbuf)-len, "Device clock rate: %d\r\n",
+		     systest.media_cfg.snd_clock_rate);
     len = strlen(textbuf);
 
@@ -1032,10 +1033,11 @@
     pjsua_config_default(&systest.ua_cfg);
     pjsua_media_config_default(&systest.media_cfg);
-    systest.media_cfg.clock_rate = CLOCK_RATE;
+    systest.media_cfg.clock_rate = TEST_CLOCK_RATE;
+    systest.media_cfg.snd_clock_rate = DEV_CLOCK_RATE;
     if (OVERRIDE_AUD_FRAME_PTIME)
 	systest.media_cfg.audio_frame_ptime = OVERRIDE_AUD_FRAME_PTIME;
     systest.media_cfg.channel_count = CHANNEL_COUNT;
-    systest.rec_id = PJMEDIA_AUD_DEFAULT_CAPTURE_DEV;
-    systest.play_id = PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV;
+    systest.rec_id = REC_DEV_ID;
+    systest.play_id = PLAY_DEV_ID;
     systest.media_cfg.ec_tail_len = 0;
 
Index: pjproject/trunk/pjsip-apps/src/pjsystest/systest.h
===================================================================
--- pjproject/trunk/pjsip-apps/src/pjsystest/systest.h	(revision 2838)
+++ pjproject/trunk/pjsip-apps/src/pjsystest/systest.h	(revision 2839)
@@ -25,9 +25,25 @@
  * Overrideable parameters
  */
-#define OVERRIDE_AUDDEV_REC_LAT		100
-#define OVERRIDE_AUDDEV_PLAY_LAT	200
+#define REC_DEV_ID			PJMEDIA_AUD_DEFAULT_CAPTURE_DEV
+#define PLAY_DEV_ID			PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV
+//#define REC_DEV_ID			5
+//#define PLAY_DEV_ID			5
+#define OVERRIDE_AUDDEV_REC_LAT		0
+#define OVERRIDE_AUDDEV_PLAY_LAT	0
 #define OVERRIDE_AUD_FRAME_PTIME	0
-#define CLOCK_RATE			8000
+
+/* Don't change this */
 #define CHANNEL_COUNT			1
+
+/* If you change CLOCK_RATE then the input WAV files need to be
+ * changed, so normally don't need to change this.
+ */
+#define TEST_CLOCK_RATE			8000
+
+/* You may change sound device's clock rate as long as resampling
+ * is enabled.
+ */
+#define DEV_CLOCK_RATE			8000
+
 
 #if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE
@@ -40,9 +56,9 @@
 #else
     #define LOG_OUT_PATH		"PJSYSTEST.LOG"
-    #define RESULT_OUT_PATH		"PJSYSTEST.TXT"
-    #define WAV_PLAYBACK_PATH		"pjsip8.wav"
-    #define WAV_REC_OUT_PATH		"TESTREC.WAV"
-    #define WAV_TOCK8_PATH		"TOCK8.WAV"
-    #define WAV_LATENCY_OUT_PATH	"LATENCY.WAV"
+    #define RESULT_OUT_PATH		"PJSYSTEST_RESULT.TXT"
+    #define WAV_PLAYBACK_PATH		"input.8.wav"
+    #define WAV_REC_OUT_PATH		"PJSYSTEST_TESTREC.WAV"
+    #define WAV_TOCK8_PATH		"tock8.wav"
+    #define WAV_LATENCY_OUT_PATH	"PJSYSTEST_LATREC.WAV"
 #endif
 
