chromeos: Retry ALSA mixer initialization on failure.

There's a race at boot where Chrome can attempt to use ALSA
before its kernel modules have been loaded.  We previously
wouldn't retry the initialization in this case, resulting in
the volume keys not working until Chrome was restarted.

This change makes the mixer code retry on failure once per
second, up to twenty times.  I've typically seen the modules
get loaded 5-6 seconds after we start Chrome (although we
don't make it until this code until a bit later; I see one or
two failures before we succeed).

It would be good to also load the modules earlier, if we can
do so without impacting boot time -- if the volume keys are
pressed before the modules are loaded now, the "muted"
bubble still comes up.

BUG=chromium-os:13162
TEST=booted with my change from issue 13226 and checked that the volume keys start working after a few seconds, and also that this doesn't block the UI (it's happening on its own thread)

Review URL: http://codereview.chromium.org/6760014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79907 0039d316-1c4b-4281-b951-d872f2087c98
1 file changed