summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
Commit message (Collapse)AuthorAgeFilesLines
* Merge "AudioFlinger: protect input/output stream access"Eric Laurent2011-08-082-21/+106
|\
| * AudioFlinger: protect input/output stream accessEric Laurent2011-08-082-21/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some methods would not check that the output orinput stream of a thread was still valid before calling functions on its interface. This could cause a crash if those methods where called while the output or input was being closed by another thread. Make sure that the output or input stream pointer is cleared before closing the stream. Always check that the output or input pointer is not null before calling functions at the stream interface. Generalize the use of initCheck() method to verify that the output or input stream is not null. Change-Id: I9d9ca6b744d011bcf3a7bbacb4a581ac1477bfa5
* | AudioFlinger: disable AEC and NS with BT headsetsEric Laurent2011-08-032-3/+52
| | | | | | | | | | | | | | Disable AEC and NS when the Bluetooth SCO headset in use indicates it implements those pre processings. Change-Id: I93f3d10b0a27243d5dbff7182639576fc0c6d862
* | Audio Effect Framework: add effect suspend/restoreEric Laurent2011-08-022-35/+498
|/ | | | | | | | | | Add the possibility for the effect framework to suspend (temporarily disable process) and restore audio effects. This feature will be usefull to disable pre processing under certain conditions and better control coexistence of audio effects on output mix and specific sources. Change-Id: I79b195982cc48748d5708308fb1647b9c3c34cc6
* Fix issue 5090721: audio record brokenEric Laurent2011-07-281-1/+1
| | | | | | | Commit 6dbdc40 introduced a deadlock when exiting the AudioFlinger RecordThread. Change-Id: I1f63e54c5aeff05da4e4d028b53f734c62c78677
* Merge "AudioFlinger: fix crash when deleting pre process."Eric Laurent2011-07-272-15/+27
|\
| * AudioFlinger: fix crash when deleting pre process.Eric Laurent2011-07-262-15/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If a pre processing effect is detroyed while enabled and capture is active, there was a possibility that the effect engine is released by the framework while still processed by the audio HAL. The fix consists in not releasing the engine in EffectModule::removeHandle() but just flag the effect as being detroyed to avoid further calls to functions on the engine effect interface. The effect interface is then removed from the audio HAL safely in EffectChain::removeEffect_l() while holding the EffectChain mutex. Change-Id: I71fab30d9145062af8644f545a1f1d4d3e7e7f02
* | Fix issue 4604090: notification sound interrupted.Eric Laurent2011-07-253-14/+132
|/ | | | | | | | | | | | | The problem is that the audio HAL fails to acquire the wake lock when playing the notification. This is because of a change that removed the mediaserver process form the system group for honeycomb. The fix consists in requesting the wake lock from PowerManagerService when AudioFlinger mixer wakes up. A consequence of this change is that audio HALs or pcm drivers do not have to hold wake locks anymore as in the past. Change-Id: I4fb3cc84816c9c408ab7fec75886baf801e1ecb5
* Added APIs for audio preprocessingEric Laurent2011-07-252-0/+40
| | | | | | | | | | | | | | | Added APIs to control pre processes applied on captured audio. Those APIs are still hidden until reviewed by API council. Three types of standard pre processes are supported: - Automatic Gain Control (AGC) by AutomaticGainControl class - Acoustic Echo Cancellation (AEC) by AcousticEchoCanceler class - Noise Suppression (NS) by NoiseSuppressor class A method is added to AudioEffect class to query audio pre processings applied by default by the platform on a given AudioRecord session ID. Change-Id: I0b9fceeb8c704dd06319c3b52b85c96fe871d51d
* AudioFlinger: add dump of audio pre processing.Eric Laurent2011-07-242-19/+21
| | | | | | | | Dump of media.audio_flinger service was only listing effects on output threads. Moved the dump of effect chains from PlaybackThread to ThreadBase class so that pre processings on RecordThread are also listed. Change-Id: If8bc74023c12b9c2371f1b300743b156ceca7b87
* Fix issue 4988574: 8 bit PCM audio playback broken.Eric Laurent2011-07-211-1/+1
| | | | | | | Fixed regression in audio track control block frame size calculation introduced by commit c310dcb. Change-Id: Ia731b946ae4e43316b98d80229e3b08a696e47d6
* Audio framework: support for audio pre processingEric Laurent2011-07-184-213/+924
| | | | | | | | | | | | | | | | | | | | | | | | | Audio effect framework is extended to suport effects on output and input audio path. AudioFlinger: Support for audio effects and effect chains is moved from PlaybackThread class to ThreadBase class so that RecordThread can manage effects. Effects of type pre processing are allowed on record thread only. When a pre processing is enabled, the effect interface handle is passed down to the input stream so that the audio HAL can call the process function. The record thread loop calls the effect chain process function that will only manage the effect state and commands and skip the process function. AudioRecord: The audio session is allocated before calling getInput() into audio policy serice so that the session is known before the input theead is created and pre processings can be created on the correct session. AudioPolicyService: default pre processing for a given input source are loaded from audio_effects.conf file. When an input is created, corresponding effects are created and enabled. Change-Id: Id17119e0979b4dcf189b5c7957fec30dc3478790
* Merge "Log CPU usage"Glenn Kasten2011-07-152-0/+35
|\
| * Log CPU usageGlenn Kasten2011-07-152-0/+35
| | | | | | | | Change-Id: Ie447e59be139153e526b7ad467c46c659d26816f
* | Remove some #ifdef HAVE_ANDROID_OS that were needed for the simulator buildMike Lockwood2011-07-131-3/+0
| | | | | | | | | | Change-Id: I13d9f251f86c05ae5405f37adbf6b8e9660935ba Signed-off-by: Mike Lockwood <lockwood@android.com>
* | Remove the simulator target from all makefiles.Jeff Brown2011-07-111-13/+2
| | | | | | | | | | | | Bug: 5010576 Change-Id: I04d722f258951a3078fe07899f5bbe8aac02a8e8
* | Merge "Fix build warning; LOG_TAG was misplaced"Glenn Kasten2011-07-081-2/+2
|\ \
| * | Fix build warning; LOG_TAG was misplacedGlenn Kasten2011-07-081-2/+2
| |/ | | | | | | Change-Id: I4fb0590f626445188f9053367707878b2fa0fa30
* | Moved and renamed effect API header filesEric Laurent2011-07-072-1/+4
|/ | | | | | | | Moved specific effect header files to system/media/audio_effects/include/audio_effects and renamed to lower case (effect_xxx.h). Change-Id: Icfc2264bfd013cab0395d7e310ada636b9fe3621
* Added audio_bytes_per_sample() helper functionEric Laurent2011-06-171-1/+1
| | | | Change-Id: Ibfcd75c4c241a53d5f052c25ada091904991048a
* audio: update for audio/audio_policy header names/locationsDima Zavin2011-06-134-4/+4
| | | | | Change-Id: I36c49352eee57559403cd1597f56a8485a360289 Signed-off-by: Dima Zavin <dima@android.com>
* Remove dead code related to gettidGlenn Kasten2011-06-032-14/+0
| | | | | | The gettid system call is always available now. Change-Id: Ib78b41781eda182dc8605daf456bbea7ff7c2dc0
* Use channel mask instead of channel count for track creationJean-Michel Trivi2011-06-014-79/+108
| | | | | | | | | | | | | | | | | Record and playback objects (resp AudioRecord and AudioTrack) are created using a channel mask, but this information is lost in the mixer because only the channel count is known to AudioFlinger. A channel count can always be derived from a channel mask. The change consists in: - disambiguiting variable names for channel masks and counts - passing the mask information from the client to AudioFlinger and the mixer. - when using the DIRECT ouput, only verifying the format of the track is compatible with the output's for PCM. Change-Id: I50d87bfb7d7afcabdf5f12d4ab75ef3a54132c0e
* Removed interface to load audio effects librariesEric Laurent2011-05-272-26/+0
| | | | | | | Removed unused functions allowing dynamic loading of audio effects libraries from effects factory API. Change-Id: I06cc5a51dc10aca87c7a8687bbb874babd711eca
* New effect library APIEric Laurent2011-05-272-79/+8
| | | | | | | | | | | | | | | | | Moved and renamed media/EffectApi.h to hardware/audio_effect.h Modified the effect library API to expose a library info structure containing an interface functions table. Also removed enums for audio channels, audio format and devices from effect API and use values from system/audio.h instead. Modified effects factory to support new library interface format and load libraries and efffects listed in audio_effects.conf file. The file audio_effects.conf is first loaded from /vendor/etc and then from /system/etc/audio_effects.conf if not found. Modified existing effect libraries to implement the new library interface. Change-Id: Ie52351e071b6d352fa2fbc06c3846686f8c45df9
* Merge "HAVE_ANDROID_OS AUDIOFLINGER_SECURITY_ENABLED dead"Glenn Kasten2011-05-231-20/+0
|\
| * HAVE_ANDROID_OS AUDIOFLINGER_SECURITY_ENABLED deadGlenn Kasten2011-05-051-20/+0
| | | | | | | | | | | | Remove dead code from the days when Android ran in emulator. Change-Id: Ibadbbde0538239ad9b2811a3a2e8f8a6d3b6389c
* | Merge "Fix audio effect framework issues"Eric Laurent2011-05-132-28/+55
|\ \
| * | Fix audio effect framework issuesEric Laurent2011-05-132-28/+55
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix two issues in audio effect framework reported by partners. 1 - Fixed duplicated audio buffer sent to effect process function when pausing a track. Modified Effectchain::process_l() function to clear the effect chain input buffer before calling the effect process functions when no track is active on the session. Previous code was clearing the buffer after calling the process functions and when transitioning from active to inactive, the last processed buffer was passed again once to effect process function before being cleared. 2 - Fixed potential mutex cross deadlock when disconnecting an effect while playback is active. This is because EffectChain::process_l() was calling PlaybackThread::hasAudioSession() thus creating an inversion in the mutex lock order (EffectChain mutex locked before ThreadBase mutex). The fix consists in removing the call to hasAudioSession() from process_l() and requires each effect chain to keep count of the number of audio tracks attached to it (previously only the active tracks were accounted for). Change-Id: Iee4246694ea8c7a66c012120c629d72dd38f9c35
* | update for new audio.h header locationDima Zavin2011-05-124-4/+4
|/ | | | | Change-Id: Ic4c62c4037800802427eb7d3c7f5eb8b25d18876 Signed-off-by: Dima Zavin <dima@android.com>
* audioflinger: don't do work in constructor, instead do it in onFirstRefDima Zavin2011-04-272-2/+15
| | | | | Change-Id: I22d9e01821816c3beb52b014330386c7fd2f0411 Signed-off-by: Dima Zavin <dima@android.com>
* audioflinger: enumerate all the possible audio interfacesDima Zavin2011-04-272-129/+230
| | | | | | | | Keep track of the primary interface that handles the master volume, etc. Change-Id: Ib0701fccff8d8783a99035a241ab7c8ec75c00ac Signed-off-by: Dima Zavin <dima@android.com>
* audio/media: convert to using the audio HAL and new audio defsDima Zavin2011-04-275-509/+626
| | | | | Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5 Signed-off-by: Dima Zavin <dima@android.com>
* audioflinger: move legacy audio hw/policy out to libhardware_legacyDima Zavin2011-04-2711-4813/+0
| | | | | Change-Id: I4adcec73d3c08bcbe15bb19e1ba2ff18b195af45 Signed-off-by: Dima Zavin <dima@android.com>
* am 48dca4de: am 969357e3: am 223995dc: Fix issue 4335692: HDMI media volumeEric Laurent2011-04-261-0/+7
|\ | | | | | | | | * commit '48dca4de70890d324b5830a58bb9fa273164151a': Fix issue 4335692: HDMI media volume
| * am 969357e3: am 223995dc: Fix issue 4335692: HDMI media volumeEric Laurent2011-04-261-0/+7
| |\ | | | | | | | | | | | | * commit '969357e31c93e168e7a4cb3b41c33a6ec26f4a26': Fix issue 4335692: HDMI media volume
| | * Fix issue 4335692: HDMI media volumeEric Laurent2011-04-251-0/+7
| | | | | | | | | | | | | | | | | | Forced music stream volume to max when not muted and output device is HDMI. Change-Id: Ibd287cea8ae1d3f36fea6651a113bd5cf2dbad13
* | | am 07c25b65: am 4430670f: am ca7ad44a: Merge "audioflinger: Enable ARMv5TE ↵Brad Fitzpatrick2011-04-111-2/+6
|\ \ \ | |/ / | | | | | | | | | | | | | | | optimized resampler" * commit '07c25b651216daac884bd503c02b788418165b50': audioflinger: Enable ARMv5TE optimized resampler
| * | am 4430670f: am ca7ad44a: Merge "audioflinger: Enable ARMv5TE optimized ↵Brad Fitzpatrick2011-04-111-2/+6
| |\ \ | | |/ | |/| | | | | | | | | | | | | resampler" * commit '4430670f48f75661293371dab8db55865f5f56e0': audioflinger: Enable ARMv5TE optimized resampler
| | * audioflinger: Enable ARMv5TE optimized resamplerJim Huang2011-04-071-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the optimized asm option is only enabled when __ARM_ARCH_5E__ is defined, which is assigned in armv5te.mk rather than armv7-a series targets. This patch checks the ARM CPU feature about half-word multiply instructions to enable ARMv5TE resampler optimization routines properly. Change-Id: I4c5a5d8c932416f23bedb0b389db958349f21ea4
* | | Merge "Miscellaneous code cleanup in audio framework"Glenn Kasten2011-04-062-5/+6
|\ \ \
| * | | Miscellaneous code cleanup in audio frameworkGlenn Kasten2011-04-062-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes: - Move declaration of kClassPathName to top of file so it can be used in more than one place, instead of "android/media/AudioSystem". - Make private methods static. - Add comment to stream_type, audio_mode, force_use types that they must match values in AudioSystem.java. - Add comment about unused types mp3_sub_format and vorbis_sub_format. - Fix typos. - Use @ in javadoc comments. - Delete dead APIs setMode, getMode, setRouting, getRouting in AudioSystem.java (they are all hidden, deprecated, and unused by rest of framework) - Delete unused private log method. - Fix pathname for android_media_AudioSystem.cpp. - Improve code formatting for space after == and !=. - Add logging of delta for changing audio policy manager ref count. Change-Id: I18037c7beb8ab76d1fda08c11e589f6e591d36e1
* | | | New fix for issue 4111672: control block flagsEric Laurent2011-04-051-24/+16
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first fix (commit 913af0b4) is problematic because it makes threads in mediaserver process block on the cblk mutex. This is not permitted as it can cause audio to skip or worse have a malicious application prevent all audio playback by keeping the mutex locked. The fix consists in using atomic operations when modifying the control block flags. Also fixed audio_track_cblk_t::framesReady() so that it doesn't block when called from AudioFlinger (only applies when a loop is active). Change-Id: Ibf0abb562ced3e9f64118afdd5036854bb959428
* | | Fix issue 4111672: AudioTrack control block flagsEric Laurent2011-03-181-9/+14
|/ / | | | | | | | | | | | | | | | | | | | | Make sure that all read/modify/write operations on the AudioTrack and AudioRecord control block flags field are protected by the control block's mutex. Also fix potential infinite loop in AudioTrack::write() if the written size is not a multiple of frame size. Change-Id: Ib3d557eb45dcc3abeb32c9aa56058e2873afee27
* | Improvement for issue 3489986: BT SCO volumeEric Laurent2011-03-151-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | This change makes sure that the VOICE_CALL stream volume tracks the BLUETOOTH_SCO stream volume when SCO audio is enabled. The down link audio volume now reflects what is being displayed when pressing volume hard keys on the device while in a video chat with a BT SCO headset. Volume settings on the headset and the device are still independent as we do not support handsfree profile yet. Change-Id: Ie0d2714730ea359b9318b9cbe6f0b2557ef0f976
* | Merge "- To track the usage of all audio output devices - To track the ↵Gloria Wang2011-03-021-0/+50
|\ \ | | | | | | | | | currently used audio device - The devices are separated as speaker and other audio devices - Provide the collected data to battery application through pullBatteryData()"
| * | - To track the usage of all audio output devicesGloria Wang2011-03-021-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | - To track the currently used audio device - The devices are separated as speaker and other audio devices - Provide the collected data to battery application through pullBatteryData() Change-Id: I374c755266b5ac6b1c6c630400f4daf901ea8acc
* | | Merge "Fix issue 3388775."Eric Laurent2011-03-021-6/+6
|\ \ \ | |/ / |/| |
| * | Fix issue 3388775.Eric Laurent2011-03-011-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Do not select A2DP output for media strategy when it is suspended because BT SCO is active. Media audio will be routed to speakers or SCO HS (depending on phone state and activity on stream VOICE_CALL) which is less confusing than not hearing anything while music progress bar is moving. Change-Id: Iff8cc1ea9bf9bde0b33035c4d91398db0934b836
* | | Merge "Fix issue 3479042."Eric Laurent2011-03-015-1/+28
|\ \ \ | |/ / |/| |