summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.cpp
Commit message (Collapse)AuthorAgeFilesLines
* DO NOT MERGE - improve audio effect framwework thread safetyEric Laurent2017-03-221-5/+18
| | | | | | | | | | | | | | | | | | | | | | - Reorganize handle effect creation code to make sure the effect engine is created with both thread and effect chain mutex held. - Reorganize handle disconnect code to make sure the effect engine is released with both thread and effect chain mutex held. - Protect IEffect interface methods in EffectHande with a Mutex. - Only pin effect if the session was acquired first. - Do not use strong pointer to EffectModule in EffectHandles: only the EffectChain has a single strong reference to the EffectModule. Bug: 32707507 CVE-2017-0479 CVE-2017-0480 CVE-2017-0499 Change-Id: Ia1098cba2cd32cc2d1c9dfdff4adc2388dfed80e (cherry picked from commit b378b73dd7480b584340b8028802c9ca2d625123) (cherry picked from commit 22e26d8ee73488c58ba3e7928e5da155151abfd0 with backport by <sultanxda@gmail.com>)
* audioflinger: Enable TEE_SINK compilationLeena Winterrowd2016-02-011-1/+1
| | | | | | | Change CHECK to ALOG_ASSERT to allow compilation of the TEE_SINK dump feature. Change-Id: I1114a9d185cfd24cdbdda51c526f48be7fd009f9
* Combine 'DTS Sound (TruMedia) Postpro support in frameworks/av for Android ↵jinamdar2016-02-011-0/+38
| | | | | | | | | | | | | 6.0' as a single patch. Signed-off-by: jinamdar <jaydeep.inamdar@dts.com> (cherry picked from commit d3668da66643d4cc39058fb65c8db0742748f70f) Conflicts: services/audioflinger/AudioFlinger.cpp services/audioflinger/Threads.cpp Change-Id: I67e3ba100ff40058919ba827b806aea7bdbaf4bb
* Merge tag 'android-6.0.1_r3' of ↵Steve Kondik2015-12-071-2/+7
|\ | | | | | | | | | | | | | | https://android.googlesource.com/platform/frameworks/av into cm-13.0 Android 6.0.1 release 3 Change-Id: I2f2a1fe1b58c828e8341556996211562d6e195ab
| * audioflinger: increase shared memory heap sizeEric Laurent2015-10-141-3/+7
| | | | | | | | | | | | Bug: 21093153. Change-Id: I389af11451b01ce49fdb8957e2f322ba1925a62e (cherry picked from commit da73b6c7474aaa5616f0214e238776f12717f32b)
* | audioflinger: increase client heap size to 4 MBvivek mehta2015-10-061-1/+1
| | | | | | | | | | | | | | | | | | - Memory allocation for AudioTrack fails because the heap gets fragmented and free chunks of the size requested are not available. - Increase the current heap size to 4 MB to ensure that there is always a free chunk to accommodate the requested size. Change-Id: Idf0d3e6c2abbf2f0fa048885acb3200d2a7c16b7
* | Stagefright: Add Checks for allocationsSathishKumar Mani2015-10-061-0/+1
| | | | | | | | | | | | | | Warn allocation failures explicitly rather than crash trying to access unallocated memory Change-Id: Ie86c3ac130917e1f4030eb8207ac8350cba7711d
* | audio: add support to enable Direct PCM outputvivek mehta2015-10-061-1/+5
| | | | | | | | | | | | allow effects in case outout is direct pcm Change-Id: I2ad7eacf11642a4ca9f892b61124293d0dc503a9
* | audioflinger: increase client heap size to 2MBDhanalakshmi Siddani2015-10-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | - Playback of 24 bit 192kHz clips fails during device switch between wired headset and BT when repeat track is enabled. - Memory allocation for AudioTrack fails because the heap gets fragmented and free chunks of the size requested are not available. - Increase the current heap size to 2MB to ensure that there is always a free chunk to accommodate the requested size. CRs-Fixed: 855910 Change-Id: I2eb18b15557fa264fb66ff282746cad4e6c718f7
* | AudioFlinger: Add PCM offload format for dumpsys loggingPreetam Singh Ranawat2015-10-061-0/+8
| | | | | | | | | | | | | | -dumpsys logs show unknown format for PCM offload playback. -Add PCM offloading formats for logging. Change-Id: I4dbb8721c7e1d1f9d51bb1f964648046e7c09875
* | AudioFlinger: Invalidate offload track during SSRRamjee Singh2015-10-061-2/+17
| | | | | | | | | | | | | | -Offload track invalidation is needed during SSR to switch from Offload to deep buffer playback. Change-Id: I728cfcadc8cd734914b94000a711d1e86bcfad9d
* | audioflinger: Increase Client heap sizeHaynes Mathew George2015-10-061-1/+1
|/ | | | | | | | | | | This increase is needed to accommodate higher sampling rate clip playback over devices like BT and to support gapless playback with larger buffer sizes. In both cases, the cblk memory allocated for a track can be high enough that a new allocation (either due to restoreTrack_l or opening a new track) can fail. Change-Id: I96f674706184f029259802d5552f5ceeebc689c1 CRs-Fixed: 768106
* Fix capture overruns at non-primary sample rateGlenn Kasten2015-07-221-3/+0
| | | | | | | | | and small buffer size. Also: Pull out the magic number "12 ms" to a named constant. Remove obsolete AudioFlinger::mPrimaryOutputSampleRate. Bug: 22662814 Change-Id: I261f75a222c4505a84aad2493d251bd2dea59f68
* audio: several fixes in audio routing callbacksEric Laurent2015-07-101-15/+13
| | | | | | | | | | | | | | | | | | | | | | - audio policy: Force device change to ensure new audio patch creation upon first track activity on a given output. Fix function device_distinguishes_on_address() which could mistake some output device with remote submix input device. - audio flinger: Reduce number of binder calls upon new client registration by only sending ioConfigChanged() callbacks to newly registered client. Fix first patch after output thread creation not triggering an ioConfigChanged() callback. -audio system: Force client registration upon routing callback installation to force new ioConfigChanged() callback from audio flinger. Bug: 22381136. Change-Id: Ieb0d9f92f563a40552eb31bc0499c8ac65f78ce4
* audio flinger: do not call JAVA services until system is readyEric Laurent2015-05-201-6/+28
| | | | | | | | Wait for system ready indication form AudioService before enabling calls to scheduling service or power manager. Bug: 11520969. Change-Id: I221927394f4a08fd86c9d457e55dd0e07949f0cf
* audio flinger: fix fuzz test crashEric Laurent2015-05-081-6/+16
| | | | | | | | | | | | | | | | Clear output stream pointer in duplicating thread when the main output to which it is attached is closed. Also do not forward master mute and volume commands to duplicating threads as this is not applicable. Also fix logic in AudioFlinger::primaryPlaybackThread_l() that could accidentally return a duplicating thread. This never happens because the primary thread is always first in the list. Bug: 20731946. Change-Id: Ic8869699836920351b23d09544c50a258d3fb585
* Merge "AudioRecord keeps track of UID" into mnc-devJean-Michel Trivi2015-05-051-2/+2
|\
| * AudioRecord keeps track of UIDJean-Michel Trivi2015-05-051-2/+2
| | | | | | | | | | | | Bug 20832981 Change-Id: If5f3c61fae02d86b9d6fdf411711f854fd56c77d
* | Merge "AudioSystem: refactor audio config cache and callbacks" into mnc-devEric Laurent2015-05-011-11/+14
|\ \ | |/ |/|
| * AudioSystem: refactor audio config cache and callbacksEric Laurent2015-05-011-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up implementation of audio configuration cache and callback events from AudioFlinger: - Define class AudioIoDescriptor for audio input and output configurations outside of AudioSystem class. - Do not use void * but an AudioIoDescriptor as argument to audio config callbacks from AudioFlinger. - Remove unused configuration events. - Move AudioSystem audio input and output cache from static singletons to members of AudioFlingerClient subclass. Change-Id: I67c196c32c09ce2756af0755ee1fe631040c3270
* | Merge "PatchPanel: do not use setParameters() internally." into mnc-devEric Laurent2015-05-011-3/+9
|\ \ | |/
| * PatchPanel: do not use setParameters() internally.Eric Laurent2015-04-281-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not use setParameters() with AUDIO_PARAMETER_STREAM_ROUTING when communicating the input or output device selected to playback or record threads, even for HAL version less than 3.0. Use createAudioPatch()/releaseAudioPatch() instead. This allows to send more information on the output or input device being selected. Also fix a regression introduced in L where the output device selection was not communicated to effects on record threads. Change-Id: I4780ada53241d56694b005c992171e173c3bf8f5
* | Respect the record audio app op - mediaSvet Ganov2015-04-291-2/+4
|/ | | | Change-Id: I3a97977b6e9a09355e2008f780d22d480fb7308b
* Enable 8 bit and float pcm record formats for AudioFlingerAndy Hung2015-04-081-14/+42
| | | | | | | Update sampling rate handling as well. Bug: 19570772 Change-Id: I872248e64c0578b2e48869a68fee0d51bd0640c3
* AudioFlinger: call SPDIF wrapper from AudioFlingerPhil Burk2015-03-241-20/+11
| | | | | | | | | | | | | Create an interface layer between the AudioFlinger and the HAL that manages the wrapping and format conversion. Removed unnecessary includes. Handle rate conversion in getRenderPosition(). Try to open HAL with encoded format before wrapping with SPDIF. Bug: 17566660 Change-Id: I00ad888ca15ff0f85b85efb8167c7f5ea761a244 Signed-off-by: Phil Burk <philburk@google.com>
* Rename tee sink file name and add prefix to macrosGlenn Kasten2015-03-061-12/+12
| | | | Change-Id: If316b9e32963d9baef8f4382fcc73dc6c4ff684d
* Rename formal parameter to match type nameGlenn Kasten2015-03-061-8/+8
| | | | Change-Id: I0761005b751f5c4a4b28729b1820961ff3077afd
* Remove redundant semicolon from namespace closingGlenn Kasten2015-03-031-1/+1
| | | | Change-Id: I163f9d3d216c283ae1160ce4802e5247cf44fba7
* Fix for getMicMute in AudioFlingerRicardo Garcia2015-02-191-4/+10
| | | | | | | | | | Previous logic will only check for mic state of Primary Hardware Device. Current logic checks state of all devices with valid microphone input. This is needed for audio_output feature support. bug: 19439530 Change-Id: Ibbb92412ac70cf2915bbe8660c04fbaf0ab74171
* Line length 100Glenn Kasten2014-12-301-1/+2
| | | | Change-Id: I6c8fe626a3825fa9e139319656d682a57b887c97
* am 93118cd9: am 99429b40: am 277c7b8c: Merge "Fix permission check for audio ↵Jean-Michel Trivi2014-12-171-7/+0
|\ | | | | | | | | | | | | recording" into lmp-mr1-dev * commit '93118cd96233b682be95a3eb114d88d69c8cc416': Fix permission check for audio recording
| * am 99429b40: am 277c7b8c: Merge "Fix permission check for audio recording" ↵Jean-Michel Trivi2014-12-171-7/+0
| |\ | | | | | | | | | | | | | | | | | | into lmp-mr1-dev * commit '99429b40411790b85e19c57392bbd292a237c470': Fix permission check for audio recording
| | * Fix permission check for audio recordingJean-Michel Trivi2014-12-151-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define input types covering the different usecases for audio recording, and check the corresponding permissions when starting to record. Move the permission check from audio flinger to audio policy, as only the policy has the information to determine which permission to enforce. Fix missing permission when an application records audio and the audio is injected by an external policy. Bug 18736417 Change-Id: If7ec040502242c990ac8ea464db484339bdce573
* | | am 72215491: am 1a475921: am 223fd5c9: audio: new routing strategies and ↵Eric Laurent2014-11-261-7/+30
|\ \ \ | |/ / | | | | | | | | | | | | | | | stream types * commit '72215491c60fbcdb9a2f0be782e24e39cca249c5': audio: new routing strategies and stream types
| * | am 1a475921: am 223fd5c9: audio: new routing strategies and stream typesEric Laurent2014-11-261-7/+30
| |\ \ | | |/ | | | | | | | | | * commit '1a475921c0577a4650d1bbe40a85b732d1766939': audio: new routing strategies and stream types
| | * audio: new routing strategies and stream typesEric Laurent2014-11-211-7/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new routing strategies and stream type for internal use by audio policy manager and audio flinger: - One for accessibility to allow different routing than media - One for re-routing (remote submix) in preparation of dynamic policies - Added stream type for "internal" audio flinger tracks used for audio patches and duplication. Bug: 18067208. Change-Id: I88f884b552e51e4a49c29125e5a1204cf58ff434
| * | resolved conflicts for merge of e78a27ca to lmp-mr1-dev-plus-aospMarco Nelissen2014-11-171-1/+1
| |\ \ | | |/ | |/| | | | Change-Id: If10a9cc17245f95d5e10b1507445abbb4020670e
| | * Update calls to IInterface::asBinder()Marco Nelissen2014-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to use the new static version. Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a Conflicts: media/libmedia/IAudioFlinger.cpp media/libmedia/IMediaPlayer.cpp media/libstagefright/CameraSource.cpp
* | | Update calls to IInterface::asBinder()Marco Nelissen2014-11-141-1/+1
| | | | | | | | | | | | | | | | | | to use the new static version. Change-Id: I89a5988a0ac694ffc04d88cf939e8455bf925d4c
* | | am d202ac37: am b7092547: Merge "remove some restrictions on effect output ↵Eric Laurent2014-11-041-1/+2
|\ \ \ | |/ / | | | | | | | | | | | | | | | channels" into lmp-mr1-dev automerge: ed1e55c * commit 'd202ac37fc1f5f31e180af55cebd22810a80251b': remove some restrictions on effect output channels
| * | remove some restrictions on effect output channelsEric Laurent2014-11-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Do not prevent from attaching effects to a non stereo output thread, unless the output thread is a mixer thread. Bug: 18157592. Change-Id: I6ac3187187a1b8aade7db04ea6dfbc47dacc25c3
* | | am 1f4b82a2: am b14e6dc8: Merge "Always use an address for remote submix" ↵Jean-Michel Trivi2014-10-301-2/+2
|\ \ \ | |/ / | | | | | | | | | | | | | | | into lmp-mr1-dev automerge: 6e8212b * commit '1f4b82a20d75b5aa8d7801d342ac3a9b48fa0863': Always use an address for remote submix
| * | Always use an address for remote submixJean-Michel Trivi2014-10-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usage of remote submix device for audio rerouting (e.g. wifi display) didn't mandate the use of addresses. Use "0" as the default address when none is specificed. In logs, only use hex format for audio devices Bug 16009464 Change-Id: Ibfb1ce6881eba8b7e34420293b8a7077a6e659e6
* | | am 6efbadac: am b6a89512: am 9d0d5958: Merge "audioflinger: new HW A/V sync ↵Eric Laurent2014-10-221-9/+57
|\ \ \ | |/ / | | | | | | | | | | | | | | | ID allocation flow" into lmp-mr1-dev * commit '6efbadac3ff5c3ddc194faaba44f1fe63e452c7f': audioflinger: new HW A/V sync ID allocation flow
| * | audioflinger: new HW A/V sync ID allocation flowEric Laurent2014-10-221-9/+57
| |/ | | | | | | | | | | | | | | | | | | | | | | | | The HW A/V sync ID is now allocated by the audio HAL before the output stream is created by a call to global get_parameters() with key AUDIO_PARAMETER_HW_AV_SYNC. When the AudioTrack is created, the HW A/V sync ID is communicated to the output stream by stream set_parameters() with key AUDIO_PARAMETER_STREAM_HW_AV_SYNC. Bug: 17112525. Change-Id: Ia8bc6f3bf9f358aa89f3f56ac554e893a19811ad
* | Check for duplicate uuids when parsing audio_effects.confMarco Nelissen2014-10-081-0/+3
|/ | | | | | | | | uuids need to be unique, and things don't work properly when they're not. Also fix/enhance/extend the dumpEffectDescriptor() method, and include a list of effects in audioflinger dumpsys. Change-Id: I3dfbc5ed0f7272c7809e337f2929212ece047ee4
* audioflinger: fix pre processing transfer between record threads.Eric Laurent2014-10-021-5/+43
| | | | | | | | | | | | Fix two problems remaining with pre processing effects transfer from one record thread to the next in case of tear down due to device connection: 1 - the enabled state of the effects was not communicated to the new HAL input stream. 2 - the effects saved in orphan chains list were not transfered to the new thread when a AudioRecord was created. Bug: 17757378. Change-Id: I0923c98470db3b51154dc89846157780a4c21e86
* Merge "audioflinger: fix pre processing effect leak" into lmp-devEric Laurent2014-09-151-1/+68
|\
| * audioflinger: fix pre processing effect leakEric Laurent2014-09-151-1/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a capture thread was closed, the effects attached to this thread were left dangling and the associated effect chain destroyed. When their last client was disconnected, the effects were not released properly from the effect library because the destruction process could not be completed without the effect being attached to a thread. A similar problem prevented a RecordTrack to be properly released if its client was destroyed after the capture thread. The fix consists in allowing the effect or record track to be properly released even if its parent thread cannot be promoted. Also save any effect chain still present on a closed capture thread in case a new client wants to reuse the effects on the same session later. Bug: 17110064. Change-Id: I5cd644daa357afd1f3548f9bcb28e6152d95fdb8
* | audioflinger: send mic mute command to all audio HALsEric Laurent2014-09-151-2/+7
|/ | | | | | | | | Mic mute should be sent to all audio HALs, not only the primary HAL as telephony can use capture devices on other HALs (e.g USB) Bug: 17321604. Change-Id: I658f6084d5b5cdc5a70784661d5cea0b6f81c3a9