factory_Audio: Allow for an init command to amixer

Allow the vendor running the test to pass in an initial command to
pass to amixer.  This will allow for unmuting or setting volume of
devices other than master.

No user yet, a subsequent change to some private overlays will use
this.

BUG=chrome-os-partner:7437
TEST=Boot factory image, test that audio test still works.

Change-Id: I829d99f5bced2d2dea83fef6f5fa7c3f87b8f517
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/13845
Reviewed-by: Jay Kim <yongjaek@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/13870
diff --git a/client/site_tests/factory_Audio/factory_Audio.py b/client/site_tests/factory_Audio/factory_Audio.py
index b31ce7f..f4e37c6 100644
--- a/client/site_tests/factory_Audio/factory_Audio.py
+++ b/client/site_tests/factory_Audio/factory_Audio.py
@@ -189,13 +189,17 @@
             raise error.TestFail('ERROR: Unable to find audio sample %s' % path)
         return path
 
-    def run_once(self, audio_sample_path=None, audio_init_volume=None):
+    def run_once(self, audio_sample_path=None, audio_init_volume=None,
+                 amixer_init_cmd=None):
 
         factory.log('%s run_once' % self.__class__)
 
         # Change initial volume.
         if audio_init_volume:
             os.system("amixer -c 0 sset Master %d%%" % audio_init_volume)
+        # Allow extra amixer command for init.
+        if amixer_init_cmd:
+            os.system("amixer -c 0 %s" % amixer_init_cmd)
 
         # Write recordings in tmpdir.
         os.chdir(self.tmpdir)