Audio-CAF: Squash fixes from Code Aurora Forum

audio: enabled SSR in HAL

- Enable surround sound recording in HAL

Change-Id: Ibcbda82166240d613e4302488580cfdb55827d1b

Conflicts:

	alsa_sound/Android.mk

audio: fix for audio recording

- Read SSR system prop only for surround
  sound recording use case.
- Change input buffer size for 8974 to 512 bytes

Change-Id: I70064769e92149cb6675a92018fb35533900e65f

audio: update device for all outputs in setPhoneState

- Change routing for all outputs is nessary in setPhoneState
  Update devices not only for primary outputs but also other
  outputs including direct, tunnel, HDMI and so on

Change-Id: I4861e67c8aab9e39f83386c27b9a9e167befd347
CRs-Fixed: 438651

alsa-sound: AudioSessionOut synchronization fixes

- Modify synchronization between AudioSink and EventThread
- Move the code block related to drain to a different function
- Reset EOS flags in write()
- Do not depend on the filled queue size to set mReachedEOS

Change-Id: Ie8cd7b9ff9cab495f236f2cfa9c68a9f3a204fe4
CRs-Fixed: 439892

alsa-sound : Fix a deadlock

- openOutputStream() deletes an object of type AudioSessionOut
  if the object initialization fails.
- This leads to a deadlock as the AudioSessionOut::reset() tries
  to acquire the same lock held by openOutputStream.
- Release the lock in openOutputStream before deleting the
  AudioSessionOut object.

Change-Id: If763eded702a59828ae51adfa4dca23749bd7300
CRs-Fixed: 442365

AudioSessionOut: Fix to handle a single write() with an empty buffer

- This fix is a workaround to exit cleanly in the case where the AudioSink
  write might give just a single zero length buffer to the driver.

Change-Id: I68d023e6f0bd5b5e4f593a42b26c685e3405288b
CRs-Fixed: 445182

alsa-sound: Adjustment for tunnel mode buffer size

- Make necessary adjustments to align the buffer size
  for tunnel mode playback to satisfy the following condition
- Buffer size is a multiple of LCM(1,2,4,6,8)
- Buffer size is aligned to 4k.
CRs-Fixed: 447274, 442365

Change-Id: Ieb188cba6945b96e99bad4ceba4b53112383fd57

Revert "audio: fix for audio recording"

This reverts commit 28438e79d90a9112da9969c6b09989d35283a522.

Revert "audio: enabled SSR in HAL"

This reverts commit 22ab3ee1288f1cd7ca96a0860de58fb2f7dc8007.

Revert "Revert "audio: fix for audio recording""

This reverts commit 406fba51a0fe4cb89fc2670fa61221f0e70a3fb1.
Merge "Audio-CAF: Squash fixes from Code Aurora Forum" into jb-mr1