summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy
Commit message (Collapse)AuthorAgeFilesLines
* audio: Send effect session notifications after startOutput successSteve Kondik2016-04-052-5/+11
| | | | | | | * Because we get a hellish firestorm during offload fallback, and our effects library really dislikes this. Change-Id: I22adb55d04502eedf03ce22f35f8b9f61de1c7b0
* audio: Remove LEGACY_ALSA_AUDIO ifdefs from AudioPolicyManager.cppArne Coucheron2016-03-171-54/+0
| | | | | | This is moved to custom policy manager in HAL sources. Change-Id: I716580f7d3399f1628c26bd3b79bd6c6a52fbbf6
* audiopolicy: squashed support for pre-kitkat audio blobsc4572016-03-103-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Squash of the following: commit 40c41a743a4345ad26b6eab41755c5b474f75853 Author: chrmhoffmann <chrmhoffmann@gmail.com> Date: Sat Nov 29 19:32:27 2014 +0100 pre kitkat audio legacy policy fix for hotword (ok google) Change-Id: I5bb90fb90f373461a98609226a5cea50ac5266e9 commit d47b306954b96142323c79b976edeb3eaa3b46dd Author: chrmhoffmann <chrmhoffmann@gmail.com> Date: Sun Nov 23 18:22:35 2014 +0100 commit d47b306954b96142323c79b976edeb3eaa3b46dd Author: chrmhoffmann <chrmhoffmann@gmail.com> Date: Sun Nov 23 18:22:35 2014 +0100 pre-kitkat audio policy blobs re-activated. Change-Id: Idfcb03d0a4aa0a099bf5a17b7bf592ab402e3255 Change-Id: Iae65c6ccb6dcb120a6fc20978b8a69e6af39a51a
* audiopolicy: Defer release of output session effectsSteve Kondik2016-03-084-2/+96
| | | | | | | | | | | | | | * Some effects modules are racy and don't tolerate being destroyed and immediately resurrected on the same session. This is the common case when switching tracks, and the use of default output effects makes the problem even worse. Certain apps which handle gapless in a sloppy way are also to blame. * Instead of immediately nuking the entire descriptor with the stream, just decrease the refcount and defer it for 10 seconds. If it needs resurrected, the refcount will be increased and the delayed release command will not shoot it in the face. Change-Id: I068dd72c4180023a74eb9ccbe8a180f6f0683dbf
* audiopolicy: Add notification when default effects are updatedSteve Kondik2016-03-086-6/+125
| | | | | | | | | | | | | | | | | | | * In M, we now have the ability to define a default set of audio effect on a per-stream basis. This allows us to get around the problem of apps not sending the control intents so we can implement smart global effects for specific media types. * We still need a session id in order to get a handle and configure them from an app like AudioFX, so we'll need to add some plumbing in order to send an event to interested applications. * This patch implements the native side of this. The Java layer will call down thru AudioSystem and register a callback which will be invoked by the audio policy when default effects are updated on a stream. This callback will receive both the stream type as well as the session id. * Attaching this listener requires that the caller hold the MODIFY_AUDIO_ROUTING permission. Change-Id: I142b15f2585ffca6a953c3e828e2a7c07b24f56c
* av: Add support for loading audio_effects_vendor.confSteve Kondik2016-01-121-1/+3
| | | | | | | | | * In case a device has a /vendor partition which cannot be modified, this allows us to short-circuit the audio_effects.conf file which might be placed there with one of our own which lives on /system. Change-Id: Ief87bd4cfba2c3188b0dff122d91f773b7f3d92d
* audiopolicy: Handle legacy startOutput on output command thread tooXuefer2016-01-061-1/+15
| | | | | | | | * Fixes the build for legacy audio policy * Broken by: de3b1c01146d2103f6bf56e2659a9c650734945a Change-Id: I990ce609b3da81c462b35c7dd3f7b11d189e2d2e Signed-off-by: Xuefer <xuefer@gmail.com>
* audiopolicy: Handle startOutput on output command threadHaynes Mathew George2015-12-233-0/+57
| | | | | | | | Handle startOutput on AudioPolicyService output command thread to serialize with concurrent releaseOutput/stopOutput calls. CRs-Fixed: 944129 Change-Id: Ie333c736750c7dfb31d3036d79dfff13cd0486fc
* audiopolicy: Set sane defaults for QC audio featuresSteve Kondik2015-12-162-2/+2
| | | | Change-Id: If91536d2be0165c90effccdfa2b92722223eb905
* stagefright: Additional fixes for extended offload supportSteve Kondik2015-12-141-2/+0
| | | | | | | | | | | * Fix compilation with debug enabled * Allow FLAC offload to be enabled independent of QCOM_HARDWARE, tested with the Nexus 5X and is working! * Disable the FLACExtractor if offload is enabled since it can only output decoded PCM. This will force FFMPEG to be used, which does everything we need for FLAC offload Change-Id: I7d71c153a6a6ea7df8e32bc73f5cbe9f51cdcf64
* audiopolicy: Add voip flag to output flag listKarthik Reddy Katta2015-12-072-1/+3
| | | | | | | | | Direct output is not selected for voip usecases as AUDIO_OUTPUT_FLAG_VOIP_RX is not added to sOutputFlagNameToEnumTable. Add this flag to output flags list. Change-Id: Ifccb78a7b8579da0a65eb3ea7347756c664246a8
* Merge tag 'android-6.0.1_r3' of ↵Steve Kondik2015-12-071-2/+31
|\ | | | | | | | | | | | | | | https://android.googlesource.com/platform/frameworks/av into cm-13.0 Android 6.0.1 release 3 Change-Id: I2f2a1fe1b58c828e8341556996211562d6e195ab
| * audio policy: fix transition from VoIP to voice call on USBEric Laurent2015-10-151-0/+23
| | | | | | | | | | | | | | | | | | Make sure no active capture takes place while in call and the capture device is the same as the call TX device. Bug: 23977713. Change-Id: Ia379d5e626c150ea49f0cdd581c881dbf0b8399d
| * audio policy: fix USB mic selection for VoIPEric Laurent2015-10-151-2/+8
| | | | | | | | | | | | | | | | | | When transitioning from speaker phone to normal mode and a USB headset is connected, we must force a teardown of active input as the new input device cannot be reached via current input stream. Bug: 24406915. Change-Id: I9f7c1d3f3cba285c25a6da1d54a3d15a5c1f378a
* | Volume should take VOLUME_MIN_DB value when audio is muted.Safa Boumaiza2015-12-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Audio can be heard when muting volume as the minimum volume value takes 0.0f instead of VOLUME_MIN_DB (-758). This patch fixes the minimum volume value which should be VOLUME_MIN_DB instead of 0.0f. Change-Id: I4cb8093b6d9f18e5330ba5f770b9133baa77542f Signed-off-by: Safa Boumaiza <Safax.boumaiza@intel.com> Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
* | audio: Changes to enable BT A2DPShreyas Nagasandra Chandrasekhar2015-11-202-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | For Proxy thread to be started , a2dp state has to updated from the audiopolicy. Now , added changes to send the BT A2DP status to audio HAL. - A- Family doesn't support separate output for a2dp , removed the getA2dpOutput(). getDeviceForStrategy() is selecting the proper device using mA2dpSuspended flag. CRs-Fixed: 751090 Change-Id: I599de562a8674ee611e10575fcc85e4715707a63
* | audiopolicy: Remove unused variables with LEGACY_ALSA_AUDIOAdrianDC2015-11-201-1/+3
| | | | | | | | | | Change-Id: If037b4eb6bbd864ccab050565899ce508ee90f9e Signed-off-by: AdrianDC <radian.dc@gmail.com>
* | Merge branch 'LA.BF64.1.2.2_rb4.7' of ↵Steve Kondik2015-11-162-0/+8
|\ \ | | | | | | | | | | | | | | | git://codeaurora.org/platform/frameworks/av into cm-13.0 Change-Id: Ia41df61c3ccfeb809572b63a4b1a8ca6bd85dfb2
| * | audiopolicy: Add synchronization to EffectDescriptorCollectionHaynes Mathew George2015-11-092-0/+8
| | | | | | | | | | | | | | | | | | | | | Synchronize public APIs of EffectDescriptorCollection CRs-Fixed: 920103 Change-Id: I04ccac526c6f99e61e43288776653d6b7ff325c4
| * | AudioPolicyService: fix race in AudioCommandThreadEric Laurent2015-11-041-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixe race condition in AudioCommandThread::threadLoop() where a command can be inserted in first position in the queue after the sleep time has been calculated causing a longer delay than expected. Also fix a failure to hold a wake lock while commands are still in the queue. Bug: 22707905. Change-Id: I813626986677bf00106acb37ee20d3dd75d5cf33
| * | AudioPolicyService: Synchronize access to AudioPolicyManagerHaynes Mathew George2015-11-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Synchronize access to APM when getDevicesForStream is called on APM. CRs-Fixed: 913227 Change-Id: I2ba6922341f035375270b02000ef5a7e078f6b5a
* | | audiopolicy: Fix call recording for legacy qcom HALnadlabak2015-11-072-0/+21
| | | | | | | | | | | | Change-Id: I774f75b493c47386ca1eaf004d663432f1041a66
* | | audio: Send USB connection events only for USB accessoryRamjee Singh2015-11-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | - Send USB connected/disconnected events to Audio HAL only in case of USB AOA as these are used only in case of USB AOA Change-Id: I7db508f6eff5e8601d54f1e1bfa603358f9d6703
* | | audio: Fixed Audio Source in Voice CallPavan Chikkala2015-11-072-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setPhoneState calls getDeviceForInputSource to check if voice_tx device is available as part of Primary Audio Module. getDeviceForInputSource always returns DEVICE_IN_COMMUNICATION for SOURCE_VOICE_COMMUNICATION on A Family and this is not added to Available devices This is leading to creation of txPatch when it is not needed Fix is to use AUDIO_SOURCE_VOICE_CALL instead of AUDIO_SOURCE_VOICE_COMMUNICATION Change-Id: I9aa7dd2139b8374ec7f06676d06ef5addea4b2a9
* | | audiopolicy: Add DEVICE_IN_COMMUNICATION for VOIPPavan Chikkala2015-11-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | - On A family, Only DEVICE_IN_COMMUNICATION is supported by voip_tx profile. getDeviceForInputSource should always return DEVICE_IN_COMMUNICATION to load voip_tx profile Change-Id: I3bb2fb70a89eadc35c2ced0c7f717ec15120bfe7
* | | audio: Added support for USB AOA connect/disconnect eventsRamjee Singh2015-11-071-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | USB AOA is supported by primary HAL on A family through customized connect/disconnect parameters.Added support for that in AudioPolicyManager Change-Id: I5212027b2711c24a9750629774f69d669a9d164f
* | | audiopolicy: Update DeviceNametoEnumTablePavan Chikkala2015-11-071-0/+3
| | | | | | | | | | | | | | | | | | | | | Added entry for DEVICE_IN_COMMUNICATION to support VOIP usecase. Change-Id: Ie7e5131b776d7b93c53ca0796dffa11316091805
* | | audio: Change the default init value for StreamDescriptorRalph Nathan2015-11-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, audio doesn't play on Brillo because the policy manager's default value for all streams is set to 0. In Android, this value is changed by calls from AudioService.java. If we set the default value to 1 in Brillo, then even if there are no calls, we will have audio. BUG=none TEST=manual Change-Id: I1418c9ecfb4f1c81c9c0946eee11deed3c65b358
* | | AudioPolicyService: Synchronize access to AudioPolicyManagerHaynes Mathew George2015-11-071-0/+1
| | | | | | | | | | | | | | | | | | | | | Synchronize access to APM when getDevicesForStream is called on APM. Change-Id: I2ba6922341f035375270b02000ef5a7e078f6b5a
* | | Merge tag 'android-6.0.0_r26' into cm-13.0Ricardo Cerqueira2015-11-057-19/+85
|\ \ \ | |/ / |/| / | |/ | | | | Android 6.0.0 release 26 Change-Id: I8a57007bf6efcd8b95c3cebf5e0444345bdd4cda
| * Merge "audio policy: fix preemtible capture race" into mnc-dr-devEric Laurent2015-09-243-3/+41
| |\
| | * audio policy: fix preemtible capture raceEric Laurent2015-09-223-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because a preemtible capture session can preempt another one, we end up in an endless loop situation were each session is allowed to restart after being preempted, thus preempting the other one which restarts and so on. To avoid this situation, we store which audio session was preempted when a particular input started and prevent preemption of this active input by this session. We also inherit sessions from the preempted input to avoid a 3 way preemption loop etc... Bug: 24007220. Change-Id: I0eab5299440ef3ab9e987635dc9a300cf42f2c79
| * | AudioPolicyService: fix race in AudioCommandThreadEric Laurent2015-09-231-8/+16
| |/ | | | | | | | | | | | | | | | | | | | | Fixe race condition in AudioCommandThread::threadLoop() where a command can be inserted in first position in the queue after the sleep time has been calculated causing a longer delay than expected. Also fix a failure to hold a wake lock while commands are still in the queue. Bug: 22707905. Change-Id: I813626986677bf00106acb37ee20d3dd75d5cf33
| * audio policy: bind setMode() and setPhoneState() operationsEric Laurent2015-09-161-1/+5
| | | | | | | | | | | | | | | | | | | | No routing operation should be allowed between setMode() and setPhoneState() when starting a call as the audio HAL relies on a precise sequence of mode change and routing change to select the initial audio device for the call. Bug: 24083591. Change-Id: I2d5ef62c11cf7aedc2ec7ca5e5fadd7ac875afbc
| * AudioPolicy: don't always change ACCESSIBILITY volumeJean-Michel Trivi2015-09-141-1/+3
| | | | | | | | | | | | | | | | | | Only change the volume for AUDIO_STREAM_ACCESSIBILITY when changing the media volume. Bug 23366575 Change-Id: Ic42c726ec4d47615c20500c20e4d43cef159b3c6
| * Force fixed volume for TTS streamEric Laurent2015-09-111-4/+4
| | | | | | | | | | | | | | | | Always play Transmitted Through Speaker stream at max volume instead of tracking media stream volume. Bug: 23729461. Change-Id: I61021f59617bb851a4cd7da80924e587029e96a3
| * Merge "audio policy: refine TTS stream mute management" into mnc-dr-devEric Laurent2015-08-132-2/+16
| |\
| | * audio policy: refine TTS stream mute managementEric Laurent2015-08-122-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | Do not mute the TTS stream if a dedicated output for TTS is available. Bug: 22100304. Change-Id: Ic126100ce1144f765bc0ae42c8ea87fa47cfb822
* | | audio policy: move output handle to AudioOutputDescriptor base classDhananjay Kumar2015-10-202-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Output handle of AudioOutputDescriptor is required by derived implementation of some AudioPolicyManager methods. These methods need to access attributes of an output which is not accessible through AudioOutputDescriptor base class unless output handle is made available here. Change-Id: I96ef9fd1c5a94874acb897245501ba2f9c9ab0c0
* | | stagefright: Add support for custom size i/p buffervivek mehta2015-10-062-0/+15
| | | | | | | | | | | | | | | | | | | | | - handle non default input buffer size - fix issues associated with non-default buffer size Change-Id: Iad31f5c85601983b01e18e130b1c3eecb3988e30
* | | Stagefright: Add Checks for allocationsSathishKumar Mani2015-10-062-0/+4
| | | | | | | | | | | | | | | | | | | | | Warn allocation failures explicitly rather than crash trying to access unallocated memory Change-Id: Ie86c3ac130917e1f4030eb8207ac8350cba7711d
* | | Direct_PCM: add support for effectsvivek mehta2015-10-061-0/+7
| | | | | | | | | | | | | | | | | | - add support for effects on direct pcm output Change-Id: I2fbac63c623bf51a03e5e91828369739d33329f3
* | | audiopolicy: fix for voice call to work on USB headset during concurrencyKarthik Reddy Katta2015-10-061-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an input stream is active on USB headset and if a voice call is received, the proxy_open() for voice call fails and the screen freezes. All active inputs must be closed before opening input stream for voice call and also all new requests to open input stream must be blocked. Change-Id: I3fb0d482a77495ff6fe9fcdc8a1f8915ade52c9a CRs-fixed: 876993
* | | audiopolicy: port existing fixes to AudioPolicyManagerSatya Krishna Pindiproli2015-10-064-9/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a squashed commit of the following fixes in AudioPolicyManager. Only some parts of the fixes have been ported as the custom audio policy has the other required changes. audiopolicy: Fix MT call delay Change-Id: I790479eaad9d2d6fd4204cc4cb7698761c30f7cf audiopolicy: support extended feature in audiopolicymanager Change-Id: I1925339b591cd29f11a71c287a2e53c0627e9e62 audiopolicy: additional change for extended feature Change-Id: I9bad6a294ddd7aee72f6f6a314666b892b730c8e Change-Id: I7738d4b0ac11ee6d93bfd67e2553eae8518ff719
* | | audio: add support to enable Direct PCM outputvivek mehta2015-10-061-0/+1
| | | | | | | | | | | | | | | | | | allow effects in case outout is direct pcm Change-Id: I2ad7eacf11642a4ca9f892b61124293d0dc503a9
* | | audiopolicy: do not update channelMask for voice input sourceKarthik Reddy Katta2015-10-061-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not needed to update the channel mask based on source because the source is sent to audio HAL through set_parameters() and if source equal to VOICE_CALL does not mean that two channels need to capture. If recorder app selects AMR as encoding format but source as RX+TX means both RX and TX are captured in ONE channel. So use channels set by the app and use source for the type of capture (RX only, TX only, or RX+TX). Change-Id: Iedf23318356480ba939fc06df4ae4f12906322b3
* | | audio: add support for 5.1 channel recordingMingming Yin2015-10-061-0/+1
| | | | | | | | | | | | | | | | | | - Add support for 5.1 channel recording Change-Id: If060fffb2e198f516f40e85390489de2108be5d1
* | | audiopolicy: fix to play 6.1 channel ALAC clipsSharad Sangle2015-10-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For 6.1 channel ALAC clips, the compress offload profile is not found even though the channel mask is defined in the audio_policy.conf file. This is because the channel mask enum is not defined and hence the profile's channel masks are not getting enumerated properly. This change is needed for 6.1 channel ALAC clips playback. Change-Id: I6b820776c0dc6e68a402886f0931439edab24a8b
* | | audio: add support for APE decoding.Sharad Sangle2015-10-062-0/+6
| | | | | | | | | | | | | | | | | | add support for APE decoding Change-Id: I55e8f4b3b87f4bdf1c99774d702506eb7c2f05b5
* | | audio: add support for ALAC decoding.Sharad Sangle2015-10-062-0/+6
| | | | | | | | | | | | | | | | | | | | | add support for decoding/offloading ALAC audio formats Change-Id: Id66f0cb6c140113741962e119148bf434de3d064