audio: Squashed commit of the following:

commit d4b8171267f47dc133781c9e014240840b748ff4
Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date:   Tue Mar 4 19:49:31 2014 +0000

    hal: Apply TMobile US voice paths to Google products only

    Some non-nexus devices have issues with this, and upstream qualcomm
    doesn't do it at all

    Change-Id: I855791a93c7c136151182d9f8987b22894540aad

commit 7ac54d09913471bf8d6805e9b1ca0d63b279d3e2
Author: Steve Kondik <shade@chemlab.org>
Date:   Sun Mar 2 11:27:14 2014 +0100

    hal: Various USB audio fixes

     * Increase buffer size, fix null terminator, set ACDB id

    Change-Id: I8886c5b0f8ec8137e54785497a82ffe70e7bbd84

commit 36a22174a9d5ae2734d55779f2adc9e8e9ebb7e7
Author: synergydev <synergye@codefi.re>
Date:   Sat Oct 19 22:28:40 2013 -0700

    voice_processing: do not use GNU old-style field designators

    Not using a GNU extension improves portability

    Change-Id: I732753d2efa19efb48312664c7a2155f78ceee35

commit 0a2db4f2d90d00d504b8a2a5f0499a34a285b3ce
Author: synergy dev <synergye@codefi.re>
Date:   Tue Dec 17 17:36:30 2013 -0800

    Visualizer: do not use GNU old-style field designators

    Avoiding the use of GCC extensions improves code
    portability

    Change-Id: Iabe9fc84d135160367922e6d026e8608475fe8c8

commit 70390c93b326ebe6db5218222622ac658170297a
Merge: c414bef ead64cd
Author: Giulio Cervera <giulio.cervera@cyanogenmod.org>
Date:   Mon Jan 20 21:36:22 2014 +0000

    Merge "audio: ifdef usb audio feature" into cm-11.0

commit c414bef7bfcc7cb1b3c6a4627288ba81b622d0aa
Author: Steve Kondik <shade@chemlab.org>
Date:   Mon Jan 20 02:53:40 2014 -0800

    hal: Add DYNAMIC_VOLUME_MIXER ifdef for AOSP compatibility

     * Upstream kernel uses a much newer compress offload implementation
       which supports gapless playback, multiple streams, and effects.
     * The volume for these streams can be controlled independently,
       so add an ifdef if we support the new mixer names.

    Change-Id: I6633ec5c95ba8a8e4424be82fe90fe207a66b964

commit ead64cd6d9b2ae781ba6bacf6fcb1229da59cfe7
Author: Giulio Cervera <giulio.cervera@cyanogenmod.org>
Date:   Sun Jan 19 12:53:12 2014 +0100

    audio: ifdef usb audio feature

    Change-Id: I486bdfe81fbe024e1797f6a5e5f8d219480001ed

commit 0a2d2ba0af406423d9149eac23acf88f074f35fd
Author: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
Date:   Thu Nov 21 20:39:59 2013 -0800

    hal: Add property to configure the compress offload fragment size.

    Add property - audio.offload.buffer.size.kbytes to configure offload
    fragment size. The maximum value for fragment size is 256k. Default
    value is 32k. The minimum value is 8k.

    Change-Id: I9b440a420270b27f5fdba9f82de6944da0afb9d2

commit 9fdf1b47da9a86438c044558f3394d7cdf320598
Author: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
Date:   Mon Dec 16 15:54:40 2013 -0800

    hal: fix set_parameter() returning -2 error

    When setparameters() is called and if the known keys are not found,
    the implementation returns -2 error.Fix this by setting error only
    when keys are found and there is an error while executing corresponding
    implemention.

    CRs-fixed: 589280
    Change-Id: If5544d6fdeac47ddfc1f7e8e18bfa81e2ef5cbc2

commit 5b8008903a411c7b8e5c255ae3c0ac594856d34d
Author: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Date:   Wed Nov 13 13:31:50 2013 -0800

    hal: Add support for audio effects in DSP for tunnel mode playback

    Add support to enable or disable audio post processing  effects
    in DSP for tunnel mode playback.

    Change-Id: I4e0b01ab4ae29d4b1c7986f2a6146e18e8bce2c1

commit ca328ca0b96029d56aa7cb7c22f3b7b91e6d4399
Author: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
Date:   Sun Dec 15 12:03:07 2013 -0800

    hal: set gapless metadata for compress  offload playback

    -If any of the  metadata parameters are set from the framework.
     set the gapless metadata to one.

    CRs-Fixed: 588353
    Change-Id: I66a79d3f64515d108585527496a754c06a441560

commit 707663b28d63bdae74055d3792fc7b693c5911f6
Author: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
Date:   Tue Jan 7 11:25:51 2014 -0800

    hal: Disable gapless offload playback by default.

    -Set the property-audio.offload.gapless.enabled to true to enable
     gapless playback by default.
    -Set mixer control to the driver to decide if gapless playback needs
     to be used or not
    -If gapless playback is not enabled then partial drain from HAL is
     treated as full drain.

    Change-Id: Id7f4967fe528bab9097c3f609058276ec02174e1

commit 456e5361335f2ac69417ad10ded7c4532a391c80
Author: Ravi Kumar Alamanda <ralama@codeaurora.org>
Date:   Fri Nov 1 20:37:38 2013 -0700

    hal: Use deep buffer output as primary

    - The audio content in video clips, YouTube content, etc
      are being rendered through low latency path as it was
      set as default output profile. This results more power
      consumption for video playback.
    - Fix this using deep buffer path as default one and use
      low latency path only for those audio tracks that
      request with AUDIO_OUTPUT_FLAG_FAST.

    Change-Id: I52fafa0ec2a312bc4383c813497830e6ded071bc
    CRs-Fixed: 570389

    hal: Avoid duplicate primary outputs

    open_output_stream API expects the default usecase to
    be returned if other usecases are unavailable or unusable.
    However, the output returned in this default case must be
    the default primary if it exists.

     * cyanogen: This behavior is off by default.

    Change-Id: Ie5cc53f077358d7039d62b09b29edb58c213bc08

commit fe433b0dd3732d2228977f715e50e7a7fc588e0a
Author: Haynes Mathew George <hgeorge@codeaurora.org>
Date:   Tue Dec 10 13:44:56 2013 -0800

    audio: Re-arrange member var initializations

    Rearrange initializations of some stream_out member
    variables to prevent possible uninitialized use.

    CRs-Fixed: 587676
    Change-Id: I7018f38f29a19b130185b285f4acf22219e4228c

commit b17bf38b533f67c4d0e394dcf97764071dea52b7
Author: Mingming Yin <mingming@codeaurora.org>
Date:   Tue Nov 26 17:17:01 2013 -0800

    hal: fix channel mask for m-ch offload playback

    - Update channel mask with compress parameters for
      compress offload playback on HDMI device

    Change-Id: I89263f56923588fcb906facfd4ae9ebf95203743

commit 990525b055790dfe7bd2081aa22f24bea1449015
Author: Ravi Kumar Alamanda <ralama@codeaurora.org>
Date:   Wed Nov 20 14:52:30 2013 -0800

    hal: Correct the multi-channel output usecase selection

    Both Multi-channel output on HDMI and Compress offload playback on
    HDMI use cases request for a stream with AUDIO_OUTPUT_FLAG_DIRECT.
    The current logic would then result selection MULTI_CH usecase.
    Fix this by checking for complete match of flags to select the
    use case.

    Change-Id: I66df94af6c3b837a6c8054282364e1acf78e6e0f

commit bd829d5340155e83d97bb0019d7aff9e60564d85
Author: Steve Kondik <shade@chemlab.org>
Date:   Mon Dec 9 19:56:04 2013 -0800

    hal: Fix issues with USB audio after disconnect

     * Stop the USB audio thread when the refcnt goes to zero.
     * Fix tracking of multiple soundcards.

    Change-Id: Ia24dbcfcbcc855cde32c57dbbeb6d07af8f4cce8

commit a4918345928c25ff3bab927a5007c6d33323ec6f
Merge: b65c4e2 8bba9e9
Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date:   Fri Dec 6 02:20:19 2013 +0000

    Merge tag 'android-4.4.1_r1' into HEAD

    Android 4.4.1 Release 1

commit b65c4e2652ce957ff8d5dec5b26c4edb6e444382
Author: Steve Kondik <shade@chemlab.org>
Date:   Sat Nov 23 16:41:18 2013 -0800

    hal: USB audio support for msm8960

    Change-Id: Ib3229c44056daa0bfcbdb6b14d9f93b374951930

commit c481f2213b7c4deb86ebf366d3d2f7c2a9791be5
Author: Ravi Kumar Alamanda <ralama@codeaurora.org>
Date:   Thu Nov 7 23:31:54 2013 -0800

    hal: Fix audio playback issue on USB headset

    - Start music playback on USB headset. The playback is stopped
      after 3sec.
    - A touch tone is played through low latency output path,  while
      selecting the song in the music app. This output goes to standy
      after 3sec. So the disable_snd_device() is called to reduce the
      ref count on usb headset device by 1. At this point the music
      playback (deep-buffer path) is still active. But the current
      implementation has uncondtionally calls usb_stop_playback()
      which results music playback to stop.
    - Fix by ensuring the usb_stop_playback is called only when the
      device ref count goes to 0.
    - Fix related minor stabilty issues

    Change-Id: I979423458738e68da45973751cd918d4c1a924ea
    CRs-Fixed: 572048

commit a2e95d9e414e651b134529687d92174ce83fec5c
Author: Apoorv Raghuvanshi <apoorvr@codeaurora.org>
Date:   Mon Oct 7 18:40:05 2013 -0700

    hal: Support for usb audio features

    Added support for usb audio feature and
    related proxy device support

    Change-Id: Ia64e9eff20fbbada6f08795686cdbc0ba462bafb

commit 6ad97976fdd779ae4e80e492778dd156e60ffccb
Author: Apoorv Raghuvanshi <apoorvr@codeaurora.org>
Date:   Fri Oct 4 16:13:44 2013 -0700

    hal: Support for anc/aanc/proxy audio features

    Added support for  anc/aanc/proxy audio features

    Change-Id: Id6ebdb9094635563cfafce9dc1d3449efe25bda4

commit f6a1a7187f1d501376f2da45d7a55bb96745a20d
Merge: 3ca121d c751496
Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date:   Fri Nov 1 19:52:53 2013 +0000

    Merge tag 'android-4.4_r1' into cm-11.0

    Android 4.4 Release 1.0

    Conflicts:
    	hal/audio_hw.c

commit 3ca121d25000734f9d8b041a43b75832f5cab22e
Author: madmack <alali48@gmail.com>
Date:   Wed Sep 11 14:53:02 2013 -0400

    Use HEADSET Tx if mic_type isn't analog and Rx device is HEADPHONES

    Some devices require a different tx device when in_call and
    headphones are inserted. While DMIC Endfire is the correct Tx
    device for Earpiece Rx, choosing DMIC Endfire when Rx is
    HEADPHONES will kill CSD. This patch will affect devices
    without analog microphones, as set by the 'persist.audio.handset.mic'
    property.

    Change-Id: I109ddfd029bb0696db7dd1cb95eb14b253e04d61

commit 85263f82487a4c00c4a2cb66a533d8caedbb90e6
Merge: 12de8f9 69cde0e
Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date:   Wed Jul 24 23:10:25 2013 +0100

    Merge tag 'android-4.3_r2.1' into cm-10.2

    Android 4.3 release 2.1

    Conflicts:
    	Android.mk

    Change-Id: I614e2625c0a791174ea26199dceb635f0a4682d4

commit 12de8f9578890e2fe7ad9f1a4b4ee5fa228f598a
Merge: 41020ed 014d19f
Author: Steve Kondik <shade@chemlab.org>
Date:   Thu Dec 27 12:41:50 2012 -0800

    Merge branch 'jb-mr1-release' of https://android.googlesource.com/platform/hardware/qcom/audio into aosp

commit 41020ed9968e1d580a8de40e431744d6da59a0a1
Author: Steve Kondik <shade@chemlab.org>
Date:   Sun Dec 23 18:32:27 2012 -0800

    audio: Don't build if TARGET_QCOM_AUDIO_VARIANT is set

     * To allow us to provide the Qualcomm enhanced audio HAL for
       devices that want to use it.

    Change-Id: I01f8241eb1137d5937dace32d0859484a3d31fcf

commit a9f27d96df22f676e5ce92b48b937b234c787c92
Author: codeworkx <codeworkx@cyanogenmod.org>
Date:   Sat Dec 15 13:40:14 2012 +0100

    audio: add flag to only set min buffersize instead of min and max

    Sony MSM8960 devices expect to only get min buffersize instead of
    min and max size.

    Change-Id: I8e4db2b32592ebe5a2945bf2b3c311f2467f8814

commit be993b1f04af8062d0eae280549174154d42fd46
Author: Steve Kondik <shade@chemlab.org>
Date:   Wed Dec 5 10:26:46 2012 -0800

    alsa_sound: Fix defaults when low-latency audio is disabled

     * Use original buffer size and playback latencies.

    Change-Id: I65b4c80e0ee935ee77de3ef38b66dc5fb7ec4100

commit b469b0ea98baf3b1866865206c0c93e7e8baec30
Author: Steve Kondik <shade@chemlab.org>
Date:   Sat Dec 1 13:50:06 2012 -0800

    alsa_sound: Make low-latency audio feature optional

     * This requires a baseband update on most devices, so make it optional.

    Change-Id: I0be3b6d0c19c26663c9ce8a26d5769a8940b318c

Change-Id: Ieb117d6a01ec60e9ad815cbd77a712eadd45d481
Merge "audio: Squashed commit of the following:" into illusion-4.4