summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioTrack.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Simplify the MemoryDealer implementationMathias Agopian2010-01-291-1/+0
| | | | | | | | | | | | | | At some point the implementation became complicated because of SurfaceFlinger's special needs, since we are now relying on gralloc we can go back to much simpler MemoryDealer. Removed HeapInterface and AllocatorInterface, since those don't need to be paramterized anymore. Merged SimpleMemory and Allocation. Made SimplisticAllocator non virtual. Removed MemoryDealer flags (READ_ONLY, PAGE_ALIGNED) Removed a lot of unneeded code.
* Issue 2265163: Audio still reported routed through earpiece on sholesEric Laurent2009-11-191-12/+10
| | | | | | | | | | | | | This is a second attempt to fix the audio routed to earpiece syndrom. The root cause identified this time is the crash of an application having an active AudioTrack playing on the VOICE_CALL stream type. When this happens, the AudioTrack destructor is not called and the audio policy manager is not notified of the track stop. Results a situation where the VOICE_CALL stream is considered as always in use by audio policy manager which makes that audio is routed to earpiece. The fix consists in moving the track start/stop/close notification to audio policiy manager from AudioTrack to AudioFlinger Track objet. The net result is that in the case of a client application crash, the AudioFlinger TrackHandle object (which implements the remote side of the IAudioTrack binder interface) destructor is called which in turn destroys the Track object and we can notify the audio policy manager of the track stop and removal. The same modification is made for AudioRecord although no bug related to record has been reported yet. Also fixed a potential problem if record stop is called while the record thread is exiting.
* Improvements for issue 2197683: English IME key-press latency is noticeably ↵Eric Laurent2009-11-111-9/+18
| | | | | | | | | higher on passion than sholes This change goes with a kernel driver change that reduces the audio buffer size from 4800 bytes (~27ms) to 3072 bytes (~17ms). - The AudioFlinger modifcations in change 0bca68cfff161abbc992fec82dc7c88079dd1a36 have been removed: the short sleep period was counter productive when the AudioTrack is using the call back thread as it causes to many preemptions. - AudioFlinger mixer thread now detects long standby exit time and in this case anticipates start by writing 0s as soon as a track is enabled even if not ready for mixing. - AudioTrack::start() is modified to start call back thread before starting the IAudioTrack so that thread startup time is masked by IAudioTrack start and mixer thread wakeup time.
* Fix issue 2203561: Sholes: audio playing out of earpiece.Eric Laurent2009-11-041-60/+103
| | | | | | | | | | | Create a new IAudioTrack interface to AudioFlinger when start() fails due to a broken pipe error. Do the same if start fails due to the same error after time out in obtainBuffer(). Do not indicate that the AudioTrack is started to AudioPolicyManager if IAudioTrack start fails. This avoids that an AudioTrack keeps a dead IAudioTrack after a media server crash. Same modifications for AudioRecord. Add a flag to ToneGenerator indicating that the callback thread can call Java. Without it, when the media server crashes and restarts, the AudioSystem error callback will crash in JNI if the IAudiotrack is created from AudioTrack callback thread.
* Fix problem in AudioTrack with 8 bit PCM and direct output.Eric Laurent2009-08-041-4/+4
| | | | Do not perform 8 to 16 bit conversion in AudioTrack write() and processAudioBuffer() if direct output flag is set.
* Fix issue 1795088 Improve audio routing codeEric Laurent2009-07-231-73/+116
| | | | | | | 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()
* add a ctor to Mutex to specify the type, which can be shared. This is used ↵Mathias Agopian2009-07-131-1/+1
| | | | by sf and af an soon will allow some optimization in the kernel for non shared mutexes
* am 88e209dc: Fix issue 1743700: AudioTrack: setPlaybackRate can not set the ↵Eric Laurent2009-07-071-15/+8
|\ | | | | | | | | | | | | | | | | playback rate to twice of the ouputSR Merge commit '88e209dcf8c2ebddda5c272f46d1bd5478bc639c' * commit '88e209dcf8c2ebddda5c272f46d1bd5478bc639c': Fix issue 1743700: AudioTrack: setPlaybackRate can not set the playback rate to twice of the ouputSR
| * Fix issue 1743700: AudioTrack: setPlaybackRate can not set the playback rate ↵Eric Laurent2009-07-071-15/+8
| | | | | | | | | | | | | | | | to twice of the ouputSR Store sample rate on 32 bits instead of 16 bits in audio_track_cblk_t. Removed sampleRate() methods from AudioTrack and AudioRecord: replaced by getSampleRate(). AudioTrack::setSampleRate() no returns a status.
* | move libbinder's header files under includes/binderMathias Agopian2009-05-201-3/+3
|/
* Fix issue 1745312: Various cleanups in media frameworkEric Laurent2009-04-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | AudioTrack, AudioRecord: - remove useless mAudioFlinger member of AudioTrack and AudioRecord. - signal cblk.cv condition in stop() method to speed up stop completion. - extend wait condition timeout in obtainBuffer() when waitCount is -1 to avoid waking up callback thread unnecessarily AudioFlinger: - remove some warnings in AudioFlinger.cpp. - remove function AudioFlinger::MixerThread::removetrack_l() as its content is never executed. - remove useless call to setMasterVolume in AudioFlinger::handleForcedSpeakerRoute(). - Offset VOICE_CALL stream volume to reflect actual volume that is never 0 in hardware (this fix has been made in the open source): 0.01 + v * 0.99. AudioSystem.java: - correct typo in comment IAudioflinger, IAudioFlingerClient: - make AudioFlinger binder interfaces used for callbacks ONEWAY. AudioHardwareInterface: - correct routeStrings[] table in AudioHardwareInteface.cpp
* Automated import from //branches/donutburger/...@140663,140663Jean-Michel Trivi2009-03-241-2/+13
|
* auto import from //branches/cupcake_rel/...@140373The Android Open Source Project2009-03-181-3/+1
|
* auto import from //depot/cupcake/@136594The Android Open Source Project2009-03-051-1/+8
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+1021
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-1011/+0
|
* auto import from //depot/cupcake/@132589The Android Open Source Project2009-03-031-10/+3
|
* auto import from //depot/cupcake/@137055The Android Open Source Project2009-03-021-3/+10
|
* auto import from //branches/cupcake/...@132276The Android Open Source Project2009-02-191-1/+1
|
* auto import from //branches/cupcake/...@131421The Android Open Source Project2009-02-131-8/+7
|
* auto import from //branches/cupcake/...@130745The Android Open Source Project2009-02-101-5/+9
|
* auto import from //branches/cupcake/...@127101The Android Open Source Project2009-01-201-31/+51
|
* auto import from //branches/cupcake/...@125939The Android Open Source Project2009-01-091-15/+7
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-142/+542
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+596