Merge "improve audio calibration" into jb-mr2-dev
diff --git a/suite/audio_quality/executable/src/main.cpp b/suite/audio_quality/executable/src/main.cpp
index cf33a0f..66d90cc 100644
--- a/suite/audio_quality/executable/src/main.cpp
+++ b/suite/audio_quality/executable/src/main.cpp
@@ -61,7 +61,7 @@
         fprintf(stderr, "%s [-l log_level][-s serial] test_xml\n", argv[0]);
         return 1;
     }
-    int logLevel = Log::ELogE;
+    int logLevel = Log::ELogW;
     char* serial = NULL;
     int opt;
     while ((opt = getopt(argc, argv, "l:s:")) != -1) {
diff --git a/suite/audio_quality/test_description/dut_speaker_calibration.xml b/suite/audio_quality/test_description/dut_speaker_calibration.xml
index e0a613d..a70442c 100644
--- a/suite/audio_quality/test_description/dut_speaker_calibration.xml
+++ b/suite/audio_quality/test_description/dut_speaker_calibration.xml
@@ -18,7 +18,7 @@
 <case name="dut_speaker_calibration" version="1.0" description="Calibrate host recording gain">
 	<setup> <!-- 1 setup -->
 		<!-- prepare sound source id: to be used in output, sine 1000Hz, 20000ms long -->
-		<sound id="sound1" type="sin:32000:1000:5000" preload="1" />
+		<sound id="sound1" type="sin:32000:1000:20000" preload="1" />
 	</setup>
 
 	<action> <!-- 1 action -->
@@ -28,8 +28,8 @@
 			<!--  sync start : execute only sync complete : execute + complete
 			      For sync start, complete will be called when the parent completes -->
 			<output device="DUT" id="sound1" gain="100" sync="start"/>
-			<sequential repeat="8" index="j">
-				<input device="host" id="host_in" gain="100" time="500" sync="complete" />
+			<sequential repeat="50" index="j">
+				<input device="host" id="host_in" gain="100" time="250" sync="complete" />
 				<!-- ------------moving average RMS        min for pass, max for pass                result calculated -->
 				<process method="builtin:rms_mva" input="id:host_in,consti:1000,consti:8000" output="val:rms_$i_$j" />
 				<!-- <message input="val:passfail" output_low="Volume Low" output_ok="Volume OK" output_high="Volume High" /> -->
diff --git a/suite/audio_quality/test_description/dut_speaker_calibration_no_pass.xml b/suite/audio_quality/test_description/dut_speaker_calibration_no_pass.xml
index 6c97ddc..5ebdf8b 100644
--- a/suite/audio_quality/test_description/dut_speaker_calibration_no_pass.xml
+++ b/suite/audio_quality/test_description/dut_speaker_calibration_no_pass.xml
@@ -18,7 +18,7 @@
 <case name="dut_speaker_calibration" version="1.0" description="Calibrate host recording gain">
 	<setup> <!-- 1 setup -->
 		<!-- prepare sound source id: to be used in output, sine 1000Hz, 20000ms long -->
-		<sound id="sound1" type="sin:32000:1000:5000" preload="1" />
+		<sound id="sound1" type="sin:32000:1000:20000" preload="1" />
 	</setup>
 
 	<action> <!-- 1 action -->
@@ -28,8 +28,8 @@
 			<!--  sync start : execute only sync complete : execute + complete
 			      For sync start, complete will be called when the parent completes -->
 			<output device="DUT" id="sound1" gain="100" sync="start" waitforcompletion="1" />
-			<sequential repeat="8" index="j">
-				<input device="host" id="host_in" gain="100" time="500" sync="complete" />
+			<sequential repeat="50" index="j">
+				<input device="host" id="host_in" gain="100" time="250" sync="complete" />
 				<!-- ------------moving average RMS        min for pass, max for pass                result calculated -->
 				<process method="builtin:rms_mva" input="id:host_in,consti:2,consti:1" output="val:rms_$i_$j" />
 				<!-- <message input="val:passfail" output_low="Volume Low" output_ok="Volume OK" output_high="Volume High" /> -->
diff --git a/suite/audio_quality/test_description/host_speaker_calibration.xml b/suite/audio_quality/test_description/host_speaker_calibration.xml
index 576d999..f2ef6d2 100644
--- a/suite/audio_quality/test_description/host_speaker_calibration.xml
+++ b/suite/audio_quality/test_description/host_speaker_calibration.xml
@@ -17,8 +17,8 @@
 
 <case name="host_speaker_calibration" version="1.0" description="Calibrate host speaker's volume.">
 	<setup> <!-- 1 setup -->
-		<!-- prepare sound source id: to be used in output, sine 1000Hz, 20000ms long -->
-		<sound id="sound1" type="sin:32000:1000:20000" />
+		<!-- prepare sound source id: to be used in output, sine 1000Hz, 30000ms long -->
+		<sound id="sound1" type="sin:32000:1000:30000" />
 	</setup>
 
 	<action> <!-- 1 action -->
@@ -28,8 +28,8 @@
 			<!--  sync start : execute only sync complete : execute + complete
 			      For sync start, complete will be called when the parent completes -->
 			<output device="host" id="sound1" gain="70" sync="start"/>
-			<sequential repeat="10" index="j">
-				<input device="host" id="host_in" gain="70" time="500" sync="complete" />
+			<sequential repeat="80" index="j">
+				<input device="host" id="host_in" gain="70" time="250" sync="complete" />
 				<!-- ------------moving average RMS        min for pass, max for pass                result calculated -->
 				<process method="builtin:rms_mva" input="id:host_in,consti:4000,consti:6000" output="val:rms_$i_$j" />
 				<!-- <message input="val:passfail" output_low="Volume Low" output_ok="Volume OK" output_high="Volume High" /> -->
diff --git a/suite/audio_quality/test_description/host_speaker_calibration_no_pass.xml b/suite/audio_quality/test_description/host_speaker_calibration_no_pass.xml
index c2853af..a1d5afb 100644
--- a/suite/audio_quality/test_description/host_speaker_calibration_no_pass.xml
+++ b/suite/audio_quality/test_description/host_speaker_calibration_no_pass.xml
@@ -17,8 +17,8 @@
 
 <case name="host_speaker_calibration" version="1.0" description="Calibrate host speaker's volume.">
 	<setup> <!-- 1 setup -->
-		<!-- prepare sound source id: to be used in output, sine 1000Hz, 20000ms long -->
-		<sound id="sound1" type="sin:32000:1000:20000" />
+		<!-- prepare sound source id: to be used in output, sine 1000Hz, 30000ms long -->
+		<sound id="sound1" type="sin:32000:1000:30000" />
 	</setup>
 
 	<action> <!-- 1 action -->
@@ -28,8 +28,8 @@
 			<!--  sync start : execute only sync complete : execute + complete
 			      For sync start, complete will be called when the parent completes -->
 			<output device="host" id="sound1" gain="70" sync="start"/>
-			<sequential repeat="10" index="j">
-				<input device="host" id="host_in" gain="70" time="500" sync="complete" />
+			<sequential repeat="80" index="j">
+				<input device="host" id="host_in" gain="70" time="250" sync="complete" />
 				<!-- ------------moving average RMS        min for pass, max for pass                result calculated -->
 				<process method="builtin:rms_mva" input="id:host_in,consti:2,consti:1" output="val:rms_$i_$j" />
 				<!-- <message input="val:passfail" output_low="Volume Low" output_ok="Volume OK" output_high="Volume High" /> -->