CRAS: Separate software volume scaling from controls.

This makes software volume scaling independent of the control
thread. A single float value is stored by the audio thread which (if
required) is used to scale audio samples in write_streams.

The three situations in which the software volume needs to be set
include:
  1. System volume changes
  2. Node volume changes
  3. Stream opens for the first time

BUG=chromium:264890
TEST=Ran unit tests, all tests pass.

Change-Id: I975665e701c751eaf55820747938178e42245d15
Reviewed-on: https://gerrit.chromium.org/gerrit/64821
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Adrian Li <alhli@chromium.org>
Reviewed-by: Adrian Li <alhli@chromium.org>
Tested-by: Adrian Li <alhli@chromium.org>
10 files changed