History log of /frameworks/base/media/libmedia/AudioSystem.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
dca56b9432e2cc851d1a58920071fed2e1e3d142 02-Sep-2011 Eric Laurent <elaurent@google.com> Fix issue 5252593: any app can restart the runtime

Replace null device address string by empty sting.

Change-Id: I285c35f3345334e6d2190493b1a8a5aca1a361a4
/frameworks/base/media/libmedia/AudioSystem.cpp
05ce0941649c3cdd7f8034496719e607977fc005 30-Aug-2011 Eric Laurent <elaurent@google.com> 226483: A2DP connected, but music out to speaker

When the A2DP headset is connected, there is a possible
race condition when the audio tracks are moved from
the mixer thread attached to the speaker output to the thread
attached to A2DP output.
As the request to clear the stream type to output mapping cache in
the client process is asynchronous, it is possible that the flag
indicating to the client audio track to re-create the IAudioTrack
on the new thread is processed before the cache is invalidated.
In this case, the track will be attached to the old thread and
music will continue playing over the device speaker instead of being
redirected to A2DP headset.

Change-Id: Ib2ce1eb5320eaff83287b93779061bf4e7a330df
/frameworks/base/media/libmedia/AudioSystem.cpp
6752ec80b25cb1f39507d18745c7e62323772cda 10-Aug-2011 Eric Laurent <elaurent@google.com> Audio effects: track CPU and memory use separately

Before this change, CPU and memory usage for an audio effect were
registered and checked against the limit by audio policy manager
upon effect instantiation. Even if an effect was not enabled
it would prevent another effect to be created if the CPU load budget
was exceeded, which was too restrictive.

This change adds a method to register/unregister CPU load only when
an effect is enabled or disabled.
It also adds a mechanism to place all effects on the global output mix
in suspend state (disabled) when an effect is enabled on a specific session.
This will allow applications using session effects to have the priority
over others using global effects.

Also fixes some issues with suspend/restore mechanism:
- avoid taking actions when an effect is disconnected and was not enabled.
- do not remove a session from the suspended sessions list when corresponding
effect chain is destroyed.

Change-Id: I5225278aba1ae13d0d0997bfe26a0c9fb46b17d3
/frameworks/base/media/libmedia/AudioSystem.cpp
c74b93fdf3ddb6fdab7878edab4d304fb14917f9 02-Aug-2011 Marco Nelissen <marcone@google.com> Keep effects sessions active when the caller dies.

Don't remove effects until the session they are in goes away or all
AudioEffects have been explicitly released. This allows the control
panel process to die without stopping the effects.

Change-Id: I4496e5df080230ca1af149dec95c1309ab8ea888
/frameworks/base/media/libmedia/AudioSystem.cpp
464d5b3da21c84ba13dc69c611d40f6bed49badb 18-Jun-2011 Eric Laurent <elaurent@google.com> Audio framework: support for audio pre processing

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
/frameworks/base/media/libmedia/AudioSystem.cpp
6af763bec7c3f4d50fee8dd0046409bb8a7fe8f6 05-May-2011 Glenn Kasten <gkasten@google.com> Remove dead code related to gettid

The gettid system call is always available now.

Change-Id: Ib78b41781eda182dc8605daf456bbea7ff7c2dc0
/frameworks/base/media/libmedia/AudioSystem.cpp
34bb419e5946ab28112e9e27a4d1b3928d31e0e2 11-May-2011 Dima Zavin <dima@android.com> update for new audio.h header location

Change-Id: Ic4c62c4037800802427eb7d3c7f5eb8b25d18876
Signed-off-by: Dima Zavin <dima@android.com>
/frameworks/base/media/libmedia/AudioSystem.cpp
24fc2fb1c541e954b83fd31ea9f786a5e9b45501 20-Apr-2011 Dima Zavin <dima@android.com> audio/media: convert to using the audio HAL and new audio defs

Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5
Signed-off-by: Dima Zavin <dima@android.com>
/frameworks/base/media/libmedia/AudioSystem.cpp
4dc22e77cfd2a1c3671e5646ee87c5e4c15596a0 20-Apr-2011 Dima Zavin <dima@android.com> libmedia: move AudioParameter out of AudioSystem

Change-Id: I9eb7e002d141936258050d4fa4f0ccd8202bfc54
Signed-off-by: Dima Zavin <dima@android.com>
/frameworks/base/media/libmedia/AudioSystem.cpp
8b4b97a14ad9b5b982d8fe92755efabec8ad0076 04-Feb-2011 Glenn Kasten <gkasten@google.com> Bug 3352047 Wrong message when adjusting volume

Add hidden AudioManager.getDevicesForStream and output device codes.

Change-Id: I4d1c1d3b6a077cd117720817d1f733dda557b947
/frameworks/base/media/libmedia/AudioSystem.cpp
25101b0b9a84571ead15b26e9f4cd9c4298d7823 02-Feb-2011 Eric Laurent <elaurent@google.com> Fix issue 3371080

Modified default volume control logic in AudioService:
1 IN_CALL volume if in video/audio chat
2 NOTIFICATION if notification is playing or was playing less than 5s ago.
3 MUSIC

Modified silent mode:
- now also affect MUSIC stream type
- entering silent mode when VOL- hard key is pressed once while selected
stream volume is already at 0 (except for VOICE_CALL stream).
- exiting silent mode when pressing VOL+ hard key while in silent mode

Play sound FX (audible selections, keyboard clicks) at a fixed volume.

Modified audio framework:
- isStreamActive() method now implemented in AudioPolicyManagerBase (previously AudioFlinger)
- iStreamActive() now specifies a time window during which the stream is considered
active after it actually stopped.

Change-Id: I7e5a0724099450b9fc90825224180ac97322785f
/frameworks/base/media/libmedia/AudioSystem.cpp
1a22bdb01ac4068c2876fe2d02f3c4c729669a1c 09-Nov-2010 Jean-Michel Trivi <jmtrivi@google.com> Add support for audio recording source in generic audio policy mgr.

Update the platform-independent audio policy manager to pass the
nature of the audio recording source to the audio policy client
interface through the AudioPolicyClientInterface::setParameters()
method.

Change-Id: I6b4fd0f8a3acea0d7d30bbad98edd1977dc012bf
/frameworks/base/media/libmedia/AudioSystem.cpp
240677ec68790b9af5fd16a604c0780eb2938bd6 20-Jul-2010 Eric Laurent <elaurent@google.com> resolved conflicts for merge of dd206093 to master

Change-Id: I21dd2321a4839d034d49092baccbf40986f17dae
8ed6ed0b6216a9dfcbcd6a5ba6a62d28a901baec 13-Jul-2010 Eric Laurent <elaurent@google.com> Audio policy manager changes for audio effects

Added methods for audio effects management by audio policy manager.
- control of total CPU load and memory used by effect engines
- selection of output stream for global effects
- added audio session id in parameter list for startOutput() and stopOutput().
this is not used in default audio policy manager implementation.

Modifications of audio effect framework in AudioFlinger to allow moving and reconfiguring
effect engines from one output mixer thread to another when audio tracks in the same session
are moved or when requested by audio policy manager.
Also fixed mutex deadlock problem with effect chains locks.

Change-Id: Ida43484b06e9b890d6b9e53c13958d042720ebdb
/frameworks/base/media/libmedia/AudioSystem.cpp
4b18200b9cc97d22ac4b77634195ec5f48004568 04-Jun-2010 Eric Laurent <elaurent@google.com> am 030a1553: am 2ea200c5: Merge "Issue 2667801: [Audio Effect Framework] AudioFlinger, AudioMixer AudioTrack modifications." into kraken
65b65459e6ac59f8a257009df8014467ae0838ee 02-Jun-2010 Eric Laurent <elaurent@google.com> Issue 2667801: [Audio Effect Framework] AudioFlinger, AudioMixer AudioTrack modifications.

First drop of audio framework modifications for audio effects support.

- AudioTrack/AudioRecord:
Added support for auxiliary effects in AudioTrack
Added support for audio sessions
Fixed left right channel inversion in setVolume()

- IAudioFlinger:
Added interface methods for effect enumeraiton and instantiation
Added support for audio sessions.

- IAudioTrack:
Added method to attach auxiliary effect.

- AudioFlinger
Created new classes to control effect engines in effect library and manage effect connections to tracks or
output mix:
EffectModule: wrapper object controlling the effect engine implementation in the effect library. There
is one EffectModule per instance of an effect in a given audio session
EffectChain: group of effects associated to one audio session. There is one EffectChain per audio session.
EffectChain for session 0 is for output mix effects, other chains are attached to audio tracks
with same session ID. Each chain contains a variable number of EffectModules
EffectHandle: implements the IEffect interface. There is one EffectHandle object for each application
controlling (or using) an effect module. THe EffectModule maintians a list of EffectHandles.

Added support for effect modules and effect chains creation in PlaybackThread.
modified mixer thread loop to allow track volume control by effect modules and call effect processing.

-AudioMixer
Each track now specifies its output buffer used by mixer for accumulation
Modified mixer process functions to process tracks by groups of tracks with same buffer
Modified track process functions to support accumulation to auxiliary channel

Change-Id: I26d5f7c9e070a89bdd383e1a659f8b7ca150379c
/frameworks/base/media/libmedia/AudioSystem.cpp
c6ea35372854521ea059eccaba5958a920228959 26-May-2010 Eric Laurent <elaurent@google.com> Fix issue 2712130: Sholes: problem when playing audio while recording over bluetooth SCO.

The problem is that when an input stream is opened for record over bluetooth SCO, the kernel
mono audio device should be opened in RW mode to allow further use of this same device by an output stream
also routed to bluetooth SCO.
This does not happen because of a bug in AudioSystem::isBluetoothScoDevice() that does not return true
when the device is DEVICE_IN_BLUETOOTH_SCO_HEADSET (input device for blurtooth SCO).

Change-Id: I9100e972931d8142295c7d64ec06e31304407586
/frameworks/base/media/libmedia/AudioSystem.cpp
ef9500fe53b6ec67b610207832b52f8bfbb20cd5 11-Mar-2010 Eric Laurent <elaurent@google.com> Fix issue 2416481: Support Voice Dialer over BT SCO.

- AudioPolicyManager: allow platform specific choice for opening a direct output.
Also fixed problems in direct output management.
- AudioFliinger: use shorter standby delay and track inactivity grace period for direct output
thread to free hardware resources as soon as possible.
- AudioSystem: do not use cached output selection in getOutput() when a direct output
can be selected.

Change-Id: If44b50d29237b8402ffd7a5ba1dc43c56f903e9b
/frameworks/base/media/libmedia/AudioSystem.cpp
47d0a9264fa5297db6333697ad750e6bc06822aa 26-Feb-2010 Eric Laurent <elaurent@google.com> Issue 2071329: audio track is shorter than video track for video capture on sholes

Add API to retrieve number of frames dropped by audio input kernel driver.

Submitted on behalf of Masaki Sato <masaki.sato@motorola.com>
/frameworks/base/media/libmedia/AudioSystem.cpp
9a56aaf12b462a064e81e02386eca8a1e77fe737 22-Feb-2010 Eric Laurent <elaurent@google.com> am 8978547f: am f5fe3949: Fix issue 2459650.

Merge commit '8978547f254b6b6ba2e322794aa044803f3edc2a'

* commit '8978547f254b6b6ba2e322794aa044803f3edc2a':
Fix issue 2459650.
f5fe3949f5db69b19ce3fac7abce2088106f2e2b 22-Feb-2010 Eric Laurent <elaurent@google.com> Fix issue 2459650.

This change fixes a problem where an unwanted tone is generated by audio policy manager when a MT call is answered.
This is because of a policy that replaces high visibility system sounds (ringtones, alarms...) by a beep when in call.
There is a transitory phase while the call is being answered where the phone state is changed to IN_CALL but the
ringtone is still playing. The audio policy manager then mutes the end of the ringtone and starts playing a beep
in replacement because the ringtone is categorized as high visibility.

The fix consists in changing the ringtone stream type from high visibility to low visibility. This is not a problem as
the only actual use case where a ringtone would be generated while in call is if another call is received.
But in this case, the phone system does not generate a ringtone but a call waiting tone instead.
It is therefore not required to handle a ringtone as a high visibiltiy tone that must be somehow signaled to the user
while in call.
/frameworks/base/media/libmedia/AudioSystem.cpp
0986e7907ffc8387b04fb201e285784bcd11b9b7 20-Jan-2010 Eric Laurent <elaurent@google.com> Fix issue 2285561: New AudioFlinger and audio driver API needed for A/V sync

Added getRenderPosition() API to IAudioFlinger to retreive number of audio frames
written by AudioFlinger to audio HAL and by DSP to DAC.

Added getRenderPosition() API to AudioHardwareInterface to retreive number of audio frames
written by DSP to DAC.

Exposed AudioTrack::getPosition() to AudioSink() to make it available to media player.

Removed excessive log in AudioHardwareGeneric.
/frameworks/base/media/libmedia/AudioSystem.cpp
23f25cda0c73f8eb878844dea32fb0bd419edca2 25-Jan-2010 Eric Laurent <elaurent@google.com> Fix issue 2378022: AudioService should direct volume control to STREAM_VOICE_CALL stream when STREAM_VOICE_CALL stream is active.

Modified AudioService.getActiveStreamType() so that STREAM_VOICE_CALL is selected when a track using this stream
type is playing.

Chanded isMusicActive() for a more generic isStreamActive(stream) method in AudioSystem, IAudioFlinger and AudioFlinger.
/frameworks/base/media/libmedia/AudioSystem.cpp
787aa597d497ffd3019fb64c244a1e944a5f8453 25-Jan-2010 Eric Laurent <elaurent@google.com> Fix issue 2363154: Speech synthesis fails to start over A2DP after media server process crash.

The problem is that after a media_server crash, the value of the A2DP output handle can change.
As this value is cached in AudioSystem for all client processes there can be a mismatch between the cached
and actual value after a media_server restart.

The fix consists in clearing the cached output handles and output to stream map values cached
in AudioSystem in AudioFlingerClient::binderDied() which is called when the media_server crashes.
/frameworks/base/media/libmedia/AudioSystem.cpp
415f3e2875b8b0b860d0dd6a69ff6868571c36bb 21-Oct-2009 Eric Laurent <elaurent@google.com> Fix issue 2192181: AudioFlinger must provide separated methods to set VOICE_CALL stream volume and down link audio volume.

Added setVoiceVolume() method to AudioSystem, AudioFlinger, IAudioFlinger, AudioPolicyService.
Removed call to AudioHardwareInterface::setVoiceVolume() from AudioFlinger::setStreamVolume().
/frameworks/base/media/libmedia/AudioSystem.cpp
327c27be19ad333c4835c84397152a0b2cb33081 27-Aug-2009 Eric Laurent <elaurent@google.com> Fix issue 2045911: Camera Shutter tone does not play correctly while listening to music.

Add the possibility to delay routing and volume commands in AudioPolicyClientInterface. The delay is not blocking for the caller.
/frameworks/base/media/libmedia/AudioSystem.cpp
ddb78e7753be03937ad57ce7c3c842c52bdad65e 28-Jul-2009 Eric Laurent <elaurent@google.com> Fix issue 2001214: AudioFlinger and AudioPolicyService interfaces should not use pointers as handles to inputs and outputs.

Use integers instead of void* as input/output handles at IAudioFlinger and IAudioPolicyService interfaces.
AudioFlinger maintains an always increasing count of opened inputs or outputs as unique ID.
/frameworks/base/media/libmedia/AudioSystem.cpp
a553c25b33c99b345cf1c8688f8df0ed8df14e5a 17-Jul-2009 Eric Laurent <elaurent@google.com> Fix issue 1795088 Improve audio routing code

Initial commit for review.
Integrated comments after patch set 1 review.
Fixed lockup in AudioFlinger::ThreadBase::exit()
Fixed lockup when playing tone with AudioPlocyService startTone()
/frameworks/base/media/libmedia/AudioSystem.cpp
0795272aa226f4e965968a03daddc53ce30b7cda 20-May-2009 Mathias Agopian <mathias@google.com> move libbinder's header files under includes/binder
/frameworks/base/media/libmedia/AudioSystem.cpp
3547cc01246059ef52d36e0cc6d4c3877a94d6ed 02-Apr-2009 Eric Laurent <> AI 144097: am: CL 144054 am: CL 144053 Fix issue #1751242 A2DP playback fails first time: Invalid buffer size: minFrameCount 10240, frameCount 4800
The problem comes from the fact that AudioSystem::getOutputFrameCount() calls getOutput() to retrieve the active output (A2DP or Hardware) before calling get_audio_flinger(). If it is the first time AudioSystem::getOutputFrameCount() is called in a given process, getOutput() will return a wrong value because gA2dpEnabled has not yet been updated by get_audio_flinger().
The fix consists in calling get_audio_flinger() in getOutput() to be sure that gA2dpEnabled is valid when getOutput() reads it.
Original author: elaurent
Merged from: //branches/cupcake/...
Original author: android-build
Merged from: //branches/donutburger/...

Automated import of CL 144097
/frameworks/base/media/libmedia/AudioSystem.cpp
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/media/libmedia/AudioSystem.cpp
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/media/libmedia/AudioSystem.cpp
da996f390e17e16f2dfa60e972e7ebc4f868f37e 13-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@131421
/frameworks/base/media/libmedia/AudioSystem.cpp
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/media/libmedia/AudioSystem.cpp
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/media/libmedia/AudioSystem.cpp
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/media/libmedia/AudioSystem.cpp