audio-caf: Trigger immediate doRouting() on setMode() change to normal

On call hangup, this normally happens as consequence of
a setParameter call shortly after the change of mode.
However, if a stream write occurs between the mode change
and setParameter, AudioStreamOutALSA::write calls route()
which then laters causes doRouting() not to deroute voice
properly.

By triggering an immediate doRouting() on a setMode change
to normal, we remove this window of opportunity for voice
derouting to fail.

Resolves calls with mute audio on jf.  This could
theoretically show up on other platforms if the
timing conditions are right.

Change-Id: I90e98596dcb42a0b4b164fc27790c39349ea777c
aacenc: Shut your facehole!

Change-Id: I962f6d99449868187d95b86c3a6672f098de5923
alsa_sound: Untangle VOIP/voice speaker handling

Change-Id: Ieedac3af120a08f567a6575fdb06e6e22946307d
alsa_sound: Allow dual-mic device to be used for VOIP calls

Change-Id: I7a4a79a1c48bd082be8d5163fa8978bca4421390
alsa_sound: Improve USB device detection

 * Samsung's proprietary dock was hijacking the routing when a USB audio
   device such as a DAC was connected in host mode.
 * Instead of blindly shoving stuff down a route that doesn't work for
   the dock case, check the switch in sysfs for the proprietary dock
   first.
 * Remove the DOCK_USBAUDIO define entirely and just wrap it up with
   everything else that SAMSUNG_AUDIO includes.

Change-Id: Id9ea2641b67c68a8b38d24aae88b186ee6e991f0
alsa_sound: Don't use USB devices for calls

 * Causing audio failure on JF. Disable until it's sorted.

Change-Id: I492e1882450f26aa6c6c062915df83f03dfa193b
alsa_sound: Add support for sound card in Galaxy S4 Mini

Change-Id: I9ff14fa6cc1b1a0c5b2307f4f84dc42b378ae8c9
Fix -Wreorder warnings

In file included from hardware/qcom/audio-caf/alsa_sound/AudioHardwareALSA.cpp:42:0:
hardware/qcom/audio-caf/alsa_sound/AudioHardwareALSA.h:
In constructor 'android_audio_legacy::AudioHardwareALSA::AudioHardwareALSA()':
hardware/qcom/audio-caf/alsa_sound/AudioHardwareALSA.h:971:11: warning:
'android_audio_legacy::AudioHardwareALSA::mCsdHandle' will be initialized after [-Wreorder]
hardware/qcom/audio-caf/alsa_sound/AudioHardwareALSA.h:957:10: warning:
'bool android_audio_legacy::AudioHardwareALSA::mMicMute' [-Wreorder]

Change-Id: I778f97bb52ac717cc6915555a177f4335dfde1c4
audio-caf: ensure mInputSource is initialised

Change-Id: I59f2f1aeca460256bfa4989302c2f74c6f791ab1
Fix Wformat warnings

warning: format '%d' expects argument of type 'int', but argument 4
has type 'long int' [-Wformat]

Change-Id: I406189caca08356efe92060cb86a2f8f87e57fcf
audio: libaudioamp: add hooks to open/close for amplifier init

Change-Id: I64e8cafad3e5eb872f2924eabde9b5dbfc947710
alsa_sound: Fix CAMCORDER_TX use case

* Enable use case by setting BOARD_USES_SEPERATED_CAMCORDER

Change-Id: Icabb0073f85e65455d5bbeae9b9b6956a8a78b90
alsa_sound: Add support for custom LPA buffer size

 * On msm8930, during playback over A2DP with DSP Manager effects enabled,
   there's a lot of stuttering with the default buffer size. Stock kernel
   used a buffer size of 32, but that caused no audio at all in CM because
   of mismatch in buffer size between kernel and user space. So up until
   now I've been using a buffer size of 256 to get audio working at all,
   but unfortunately it causes stuttering as mentioned. Hence add support
   for a custom buffer size so we can revert to stock value used in kernel,
   and enjoy no stuttering.

Change-Id: I29113cee46d0adcc72a8c9c830e4c15d9fdd43dc
audio-caf: snd_use_case_apply_voice_acdb: initialise current_mod[]

Change-Id: I38fd1638e34f38e97e9e48a0ddf51bb31e3b10f8
Add Motorola EMU audio dock support

Motorola EMU audio dock (USB->USB charge/audio Y cable) support
can be enabled by BOARD_USES_MOTOROLA_EMU_AUDIO.

- add EMU Antipop mixer control handling
- add Dock Speaker device use case
- fix one missing QCOM_USBAUDIO_ENABLED ifdef

Change-Id: Ie67339b222252411d3c7c0aaea6493a0ff10fd18
Add HAVE_SAMSUNG_AUDIO check in Alsa

Change-Id: Ibaad5bf6006b4745fe26b85939bb556c0b2177ce
Fix building for 8974

Add the platform to the base filter, and initialize a variable when
reading EDID details that could cause evil memory accesses

Change-Id: I61955ca9280cc7c3357bf827e2e1269981fd5d6e
alsa_sound: Add support for separated speaker mic devices

* Some devices use a dedicated ambient mic for loudspeaker, and
  reject attempts at using DMIC for it even if regular earpiece
  mode uses it

Change-Id: I87201cb3ab81a345ac817c66ba35d22b075fcedc
Revert "alsa_sound: Fix CAMCORDER_TX use case"

This reverts commit 58bd771e0b626c5edc6dbb1bfc2df0518387f6d8,
cleaner fix coming up

Change-Id: I4042b699379dbf5a0b868cd978a45cc99d8f91ac
alsa_sound: Fix camcorder input selection

Change I1ddc6460a91752fd7673d84fd41b70365d83d90c was supposed to
address camcorder during calls, and ended up forcing the main mic
for every other use case. Don't do that.

Change-Id: I4ecc11de57603ec12d2f60e408469f90ef3696b9