diff options
author | Haynes Mathew George <hgeorge@codeaurora.org> | 2013-02-21 20:06:04 -0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2013-04-08 23:05:17 -0700 |
commit | 203e28ca88001f2a0f4db7a3018977c687333941 (patch) | |
tree | a73d73163f143d3a842bef7000f8bc7f909a98d8 /services | |
parent | ba8b022736266d6dda1a1cd5986f8f999710db9f (diff) | |
download | frameworks_av-203e28ca88001f2a0f4db7a3018977c687333941.zip frameworks_av-203e28ca88001f2a0f4db7a3018977c687333941.tar.gz frameworks_av-203e28ca88001f2a0f4db7a3018977c687333941.tar.bz2 |
libstagefright: Squashed audio fixes from CodeAurora
libstagefright: Return seek position until seek has been processed
If it so happens that the client to TunnelPlayer (e.g. AwesomePlayer)
queries for the current time before data from the new seek position
is given to the compressed driver, we need to return the seek position
Change-Id: If709e61f67cc8e81d34c14d19145dc61ecd82c2b
CRs-Fixed: 454825
libstagefright: Use 64 bit offsets only when needed.
For enabling >2GB recording, 64 bit offsets are
needed for file writing. So, this feature was turned
on by default. This in turn increased the file size.
With this change, by default this feature will be
off and turned on only when required.
- Use 64 bit offsets for resolutions >= 720p.
- Limit maximum file size for recording to 4GB.
- Set max file size only if no value is set from the client.
- Fix MPEG4Extractor to use 64 bit offsets
CRs-Fixed: 273144, 285785, 288319
(cherry picked from commit 04476a3fb89dfbb025f7852dd4d62cae72385f1a)
Change-Id: I00af2c7cddbbf86c566fe4bb989fe728ca06dd19
libstagefright: TunnelPlayer sync fix
- Allow close on the AudioSink to be called from
the extractor thread and the application thread.
- This fixes a race condition where an onPauseTimeout
event scheduled from the main thread closes the
audio sink while the extractor thread was about
to issue write() on audio HAL. (note: on HAL, not audio sink)
Change-Id: I22a5c655dfcb40f3cbda3765dc23ad8e6f99c9bb
CRs-Fixed: 443205
Frameworks/av: Fix to prevent deadlock in AudioEffects
-Write is blocked waiting for effect chain lock and this causes
decoder thread to wait indefintely.
-Sometimes it is observed that effectschain is locked before
mLPAEffectChain is initialized and but unlocking is skipped if
mLPAEffectChain is initialized in between.Due to this LPA
silence and framework reboot issues are observed as
applyEffectsOn() cannot acquire lock to progress further.
-Use flag to check if all effects have been locked and unlock
accordingly to prevent the deadlock scenario.
(cherry picked from commit 011db22abf565dfbe7f9d0a5c7af7564587b3b48)
Change-Id: I82cfdab045ecf077f0ba0185fc693fc623fa10db
CRs-Fixed: 435661, 435664, 435680, 430309
audio: Use tunnel player only for music stream
- Check stream type before creating tunnel player to
use tunnel player only for STREAM_MUSIC
Change-Id: I6e4b58524e61441ad2e09499bd9187c6dd56cd3d
framework/av: Fix for audio recording test through CTS
- Issue: Failure in stop is observed with the audio recording test
through CTS.
TestScenario: When the audio record test is initiated in the CTS
console, the recording session is force closed with a notification
File Size limit exceeded. Further, the stop fails with the same
message(notification of the File size exceeded error).
- Cause: The calculation of nTotalBytesEstimate for the recording
session exceeds the limit 95 percent of mMaxFileSizeLimitBytes.
As a result of size deficit, the recording is stopped at the
beginning of the recording session notifying
MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED.
- Fix: The factor size used in the calculation of nTotalBytesEstimate
has been updated properly for 64bit file offset setting. The
setParam64BitFileOffset in StagefrightRecorder::prepare() is executed
based on two additional validations so that the factor size is updated
appropriately.
Change-Id: I4749ce8f9735ccc9e1d9e49718c36470837ab27f
CRs-Fixed: 396057
audioflinger: apply volume on direct track when track is active
During back to back tunnel playback, we encounter a race condition
where setVolume can be called when the track is not updated to
active state. Fix to apply the volume on direct track only when the
track is in active state.
Change-Id: I70c289fbf8a9266bae0bd01b04be9f43ad32c70d
CRs-Fixed: 464148
LPAPlayer: Update condition to ignore seek
- Reject seek if the new seek time is greater than the current
position and within an empirical limit (default 60ms).
- This limit must be measured for each target.
Change-Id: I86b44679fb5fe442bb5adb510c62514f6be3d304
CRs-Fixed: 453067
audioflinger: for DirectAudioTrak, call startOutput before stream is active
For LPA and Tunnel playback, when resume is done in paused state, before
starting actual playback, volume should be set through AudioPolicy command
thread.
Change-Id: I7ee1098058c01a35a3e7181d3b291304abf3cac1
CRs-Fixed: 464348
Diffstat (limited to 'services')
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index 88da88c..ed221ed 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -249,6 +249,9 @@ AudioFlinger::AudioFlinger() mNextUniqueId(1), mMode(AUDIO_MODE_INVALID), mBtNrecIsOff(false) +#ifdef QCOM_HARDWARE + ,mAllChainsLocked(false) +#endif { } @@ -6232,16 +6235,17 @@ AudioFlinger::DirectAudioTrack::~DirectAudioTrack() { } status_t AudioFlinger::DirectAudioTrack::start() { + AudioSystem::startOutput(mOutput, (audio_stream_type_t)mOutputDesc->mStreamType); if(mIsPaused) { mIsPaused = false; mOutputDesc->stream->start(mOutputDesc->stream); } mOutputDesc->mActive = true; - AudioSystem::startOutput(mOutput, (audio_stream_type_t)mOutputDesc->mStreamType); return NO_ERROR; } void AudioFlinger::DirectAudioTrack::stop() { + ALOGV("DirectAudioTrack::stop"); mOutputDesc->mActive = false; mOutputDesc->stream->stop(mOutputDesc->stream); AudioSystem::stopOutput(mOutput, (audio_stream_type_t)mOutputDesc->mStreamType); @@ -6290,11 +6294,14 @@ void AudioFlinger::DirectAudioTrack::mute(bool muted) { } void AudioFlinger::DirectAudioTrack::setVolume(float left, float right) { - mOutputDesc->mVolumeLeft = left; - mOutputDesc->mVolumeRight = right; - mOutputDesc->stream->set_volume(mOutputDesc->stream, + ALOGV("DirectAudioTrack::setVolume left: %f, right: %f", left, right); + if(mOutputDesc && mOutputDesc->mActive) { + mOutputDesc->mVolumeLeft = left; + mOutputDesc->mVolumeRight = right; + mOutputDesc->stream->set_volume(mOutputDesc->stream, left * mOutputDesc->mVolumeScale, right* mOutputDesc->mVolumeScale); + } } int64_t AudioFlinger::DirectAudioTrack::getTimeStamp() { @@ -8760,11 +8767,19 @@ void AudioFlinger::ThreadBase::lockEffectChains_l( Vector< sp<AudioFlinger::EffectChain> >& effectChains) { effectChains = mEffectChains; +#ifdef QCOM_HARDWARE + mAudioFlinger->mAllChainsLocked = true; +#endif for (size_t i = 0; i < mEffectChains.size(); i++) { #ifdef QCOM_HARDWARE - if (mEffectChains[i] != mAudioFlinger->mLPAEffectChain) + if (mEffectChains[i] != mAudioFlinger->mLPAEffectChain) { #endif mEffectChains[i]->lock(); +#ifdef QCOM_HARDWARE + } else { + mAudioFlinger-> mAllChainsLocked = false; + } +#endif } } @@ -8773,7 +8788,7 @@ void AudioFlinger::ThreadBase::unlockEffectChains( { for (size_t i = 0; i < effectChains.size(); i++) { #ifdef QCOM_HARDWARE - if (mEffectChains[i] != mAudioFlinger->mLPAEffectChain) + if (mAudioFlinger-> mAllChainsLocked || mEffectChains[i] != mAudioFlinger->mLPAEffectChain) #endif effectChains[i]->unlock(); } |