From f4c6aa2e81efb7c4e72fd597e28a7ff25f4411b2 Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Thu, 7 Jun 2012 04:00:15 +0000 Subject: [PATCH] Improve the reliablity of the audio e2e test. - Use higher quality resampling. - Add a longer delay before pacat recording. TBR=kjellander@webrtc.org BUG=issue502 TEST=manually Review URL: https://webrtc-codereview.appspot.com/646005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2374 4adac7df-926f-26a2-2b94-8c16560cd09d --- tools/e2e_quality/audio/README | 4 ++++ tools/e2e_quality/audio/daemon.conf | 1 + tools/e2e_quality/audio/run_audio_test.py | 9 +++++---- 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 tools/e2e_quality/audio/daemon.conf diff --git a/tools/e2e_quality/audio/README b/tools/e2e_quality/audio/README index cbbff751f8..5c8b6f85fd 100644 --- a/tools/e2e_quality/audio/README +++ b/tools/e2e_quality/audio/README @@ -7,6 +7,10 @@ arguments, run_audio_test.py expects a pair of sinks named "capture" and default.pa file in ~/.pulse. Alternately, the "pacmd" commands therein can be run on the command-line to create the devices. +Similarly, place the provided daemon.conf file in ~/.pulse to use high quality +resampling in PulseAudio. This will reduce the resampling impact on the outcome +of the test. + Build all WebRTC targets as usual (or just the audio_e2e_harness target) to generate the VoiceEngine harness. diff --git a/tools/e2e_quality/audio/daemon.conf b/tools/e2e_quality/audio/daemon.conf new file mode 100644 index 0000000000..26c4df4c80 --- /dev/null +++ b/tools/e2e_quality/audio/daemon.conf @@ -0,0 +1 @@ +resample-method = speex-float-9 diff --git a/tools/e2e_quality/audio/run_audio_test.py b/tools/e2e_quality/audio/run_audio_test.py index b32ac2513a..d21865a898 100755 --- a/tools/e2e_quality/audio/run_audio_test.py +++ b/tools/e2e_quality/audio/run_audio_test.py @@ -55,8 +55,9 @@ def main(argv): # # We pass the render device for VoiceEngine to select because (for unknown # reasons) the virtual device is sometimes not used when the default. - retcode = subprocess.call(['pacmd', 'set-default-source', - options.play_sink + '.monitor'], stdout=subprocess.PIPE); + command = ['pacmd', 'set-default-source', options.play_sink + '.monitor'] + print ' '.join(command) + retcode = subprocess.call(command, stdout=subprocess.PIPE) if retcode != 0: return retcode @@ -65,7 +66,7 @@ def main(argv): print ' '.join(command) voe_proc = subprocess.Popen(command) - format_args = ['-n', '--format=s16le', '--rate=' + options.rate, + format_args = ['--format=s16le', '--rate=' + options.rate, '--channels=' + options.channels, '--raw'] command = (['pacat', '-p', '-d', options.play_sink] + format_args + [options.input]) @@ -75,7 +76,7 @@ def main(argv): # If recording starts before there is data available, pacat sometimes # inexplicably adds a large delay to the start of the file. We wait here in # an attempt to prevent that. - time.sleep(0.2) + time.sleep(2) command = (['pacat', '-r', '-d', options.rec_sink + '.monitor'] + format_args + [options.output]) print ' '.join(command)