summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioTrack.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Use AudioPlaybackRate to hold TimestretchBufferProvider parameters"Ricardo Garcia2015-04-221-23/+32
|\
| * Use AudioPlaybackRate to hold TimestretchBufferProvider parametersRicardo Garcia2015-04-221-23/+32
| | | | | | | | | | | | | | | | Use this struct to handle the parameters for TimestretchBufferProvider all across the system. Add stretch mode and fallback mode to TimestretchBuffer Provider. Change-Id: I19099924a7003c62e48bb6ead56c785cb129fba2
* | audio policy: fix AudioTrack output device selectionEric Laurent2015-04-221-3/+2
|/ | | | | | | | | | | | | | Have AudioTrack::setOutputDevice() set CBLK_INVALID flag instead of calling restoreTrack_l(). This allows restoreTrack_l() to be called in a safe context. Allow device change while the AudioTrack is active by forcing a new device selection in startOutput() if the output route for this session was changed. Remove some warnings. Change-Id: I2d921a63c9bfa0e122233645e2d6d39f95f5f17d
* libmedia: fix all warning, make warnings errors, use clangLajos Molnar2015-04-171-1/+2
| | | | Change-Id: Ic00d2c5d0bbb1605e96666e25c9ccc22bea6d3ff
* Work around lack of pitch adjustment in TimestretcherAndy Hung2015-04-161-12/+40
| | | | Change-Id: I3e057b97c250a826133248b6aa1ff9ed677d88df
* Merge "AudioRecord::obtainBuffer() can return nonContig like AudioTrack"Glenn Kasten2015-04-141-0/+6
|\
| * AudioRecord::obtainBuffer() can return nonContig like AudioTrackGlenn Kasten2015-04-131-0/+6
| | | | | | | | | | | | And fix error handling in both AudioRecord and AudioTrack. Change-Id: I4853d736cc6d2c05de5b18b0eac62716edfa62ec
* | Add playback rate to AudioTrackAndy Hung2015-04-091-15/+118
| | | | | | | | | | Bug: 19196501 Change-Id: I6411e1d3ce652b711a71a6d9df020cb5f60d4714
* | Adding explicit routing API to AudioTrackPaul McLean2015-04-081-7/+26
|/ | | | Change-Id: I40c048c7644c46f4e4f7103875206c0785c4b1dc
* Reject sample rate changes for fast tracksAndy Hung2015-03-311-3/+7
| | | | | | | This is needed for a SoundPool fix. Bug: 19970735 Change-Id: I46b69e059aabf0d06b16b31ea436bb71f7146750
* set() in AudioRecord and AudioTracks needs no lockGlenn Kasten2015-03-231-2/+1
| | | | Change-Id: I9d61b3d117e9b21fbbfad772d8981a5abb8fafae
* LoggingGlenn Kasten2015-03-231-8/+9
| | | | | | | | | | Move log of latency to where it is first computed. Log more parameters when a fast track is denied by client. Log session ID in destructor. Remove obsolete ALOGV that were for debugging a particular problem. Log more parameters of set(). Change-Id: I0156bceaf397f2faa053214572c57136705685ee
* Merge "Fix position when restoring streaming audio track"Andy Hung2015-03-231-1/+1
|\
| * Fix position when restoring streaming audio trackAndy Hung2015-03-201-1/+1
| | | | | | | | | | Bug: 19802225 Change-Id: I19ca7836bc89627f6cead4961641b94c6b27b5f6
* | Update AudioTrack code to match AudioRecordGlenn Kasten2015-03-231-2/+9
| | | | | | | | | | | | | | session ID check buffer error code check Change-Id: I092a61adfd249122f9127dceedf67c0a3bdcfe7b
* | namespace does not need a closing semicolonGlenn Kasten2015-03-231-1/+1
| | | | | | | | Change-Id: Ie8f9d42fc061f6d558f23b98414e04eb3d14b376
* | Declare and initialize in one statementGlenn Kasten2015-03-231-4/+2
|/ | | | Change-Id: Ie8593692907e67558f9d7654c9a4bf8cbce99bd8
* fix flush on HW A/V sync tracksEric Laurent2015-03-091-0/+3
| | | | | | | | | | | | Fix mismatch between track flags on client and server side when HW A/V sync is requested. The audio track was connected to a direct output by the audio policy manager but the client failed to set the direct flag when creating the track resulting in the direct flag not being set in audio flinger. Bug: 19665934. Change-Id: I0a5257b20bf76c9c4d89bc2ad9b44777b81f13bf
* Allow TRANSFER_OBTAIN to be used for fast tracksGlenn Kasten2015-03-091-1/+3
| | | | Change-Id: I8fa20c26f076567b38210af4a680fe1cb2eacee4
* AudioTrack::obtainBuffer() now returns number of non-contiguous framesGlenn Kasten2015-03-091-2/+2
| | | | Change-Id: I1f61d7e3d057c3254babe456b4aa0f6a1809da55
* AudioTrack::releaseBuffer parameter is const *Glenn Kasten2015-03-091-1/+1
| | | | Change-Id: I31ac20863107de05b83cd7f8cd7dd61bed98e456
* AudioTrack obtain/release buffer commentsGlenn Kasten2015-03-091-0/+1
| | | | Change-Id: I0eb178d1ab4eea7f72f4c55852c19b216ca55f5f
* Change AudioTrack resampling buffers from 3 to 2Andy Hung2015-02-061-59/+23
| | | | | | | | | | | | | Move computation of minimum AudioTrack buffer size to server for normal streaming PCM tracks. Use server-side computation to exactly determine requirements for the resampler to avoid triple buffering. This reduces latency for normal audio tracks that require resampling, and makes things consistent with the minimum buffer size. Change-Id: I2f2ca0e599ee20e16559bc5c5dab61ed100da16c
* Allow AUDIO_FORMAT_PCM_8_BIT AudioTrack buffersAndy Hung2015-01-141-46/+15
| | | | | | | | Previously conversion to AUDIO_FORMAT_PCM_16_BIT was required. Client shared memory for static tracks and AudioFlinger track creation and buffer delivery now use native 8 bit PCM data. Change-Id: I485c07a4971fde9a25442bd43fed95019d39abcc
* Fix cumulative error in setPositionNotificationPeriodAndy Hung2015-01-071-2/+3
| | | | | | | | Time for AudioTrackThread sleep due to periodic notification needs to be computed from actual position. External reported AOSP issue 65807. Change-Id: Ic46b64588e6c5803afcd8252cde8837eb3fbf6ff
* Event driven wake for AudioTrackThread notification changesAndy Hung2015-01-061-2/+25
| | | | | | Used for setMarkerPosition and setPositionUpdatePeriod. Change-Id: I0d94b929438a5cd94b295d7c1884f876fae8b5e7
* Improve AudioTrack EVENT_LOOP_END and EVENT_BUFFER_END accuracyAndy Hung2015-01-061-11/+40
| | | | | | | | Fix timing computation to consider current position. Fix EVENT_LOOP_END count accuracy (some could be dropped before) for non-infinite loop static AudioTracks. Change-Id: I255f692915b55ab6f08ccd6a2365fee3f5d0a4fe
* Fix loop and position restoration in static AudioTracksAndy Hung2015-01-061-27/+26
| | | | | | | | Allow restoration of loop and position. Make position and loop synchronously readable. Bug: 17964637 Change-Id: I8cfb5036e665f55fdff5c67d27e1363ce9a8665d
* Fix loop and position setting in static AudioTracksAndy Hung2015-01-051-16/+21
| | | | | | | Allow independent setting of position and loop. Bug: 17964637 Change-Id: I8b3bd97a244b932728b68da7684044f2636984a5
* am d33712d7: am 145cf5d8: Merge "audioflinger: implement pause/resume for ↵Eric Laurent2014-12-171-0/+5
|\ | | | | | | | | | | | | direct outputs" into lmp-mr1-dev * commit 'd33712d7ec5dcf427cc0be9b7d2ca1c99823c8e6': audioflinger: implement pause/resume for direct outputs
| * audioflinger: implement pause/resume for direct outputsEric Laurent2014-12-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend pause/resume support to direct output threads (was only for offload threads). If the HAL implements pause/resume, track pause/resume is forwarded to the HAL. Pause, flush, resume sequence is respected by executing the HAL calls in the playback thread (same as offload). Make sure the track flags on client side are consistent with the flags on server side. Bug: 17883772. Change-Id: I89b360d69818f7a9204bd36e3ec63a79e106ecf1
* | am c49d9cda: am 2dda40d6: Merge "audio policy: add support for custom mixes" ↵Eric Laurent2014-12-101-0/+8
|\ \ | |/ | | | | | | | | | | into lmp-mr1-dev * commit 'c49d9cda49dab8b7dd0376cf56476b3e1895d5c6': audio policy: add support for custom mixes
| * audio policy: add support for custom mixesEric Laurent2014-12-091-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for custom mixes in AudioPolicyManager. Two methods are added to register or unregister a list of custom mixes with their attributes and format. getOutputForAttr() and getInputForAttr() first look for a match in registered mixes before defaulting to normal output/input selection Remote submix device connection disconnection now takes address into account to identify the correspnoding custom mix. Bug: 16009464. Change-Id: I3f1c2a485a0fb71b1f984ed0adc9b68aa971e408
| * Track volume should be maintained even if track is restoredseunghak.han2014-12-051-1/+5
| | | | | | | | | | | | | | | | If track is restored when it set its volume to a non-unity value (such as mute), the volume was forced to unity again. Now, the previous volume is restored. Bug: 18570664 Change-Id: I79f34c6c7d6f535baba813fd3b8ba8e55cac8ad7
* | am bde85d05: am 5458756a: Merge "Track volume should be maintained even if ↵Glenn Kasten2014-12-021-1/+5
|\ \ | | | | | | | | | | | | | | | | | | track is restored" * commit 'bde85d05414cdd3888071635dd05e9ff78679d5e': Track volume should be maintained even if track is restored
| * | Track volume should be maintained even if track is restoredseunghak.han2014-12-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | If track is restored when it set its volume to a non-unity value (such as mute), the volume was forced to unity again. Now, the previous volume is restored. Bug: 18570664 Change-Id: I79f34c6c7d6f535baba813fd3b8ba8e55cac8ad7
* | | am 390ef843: am f20c4356: Merge "AudioRecord: use audio attributes instead ↵Eric Laurent2014-11-271-1/+5
|\ \ \ | | |/ | |/| | | | | | | | | | | | | of audio source." into lmp-mr1-dev * commit '390ef84373b7edd1397381f780ca235326357094': AudioRecord: use audio attributes instead of audio source.
| * | AudioRecord: use audio attributes instead of audio source.Eric Laurent2014-11-251-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added AudioRecord constructor with audio attributes. Replaced AudioPolicymanager::getInput() by getInputForAttr(). No new functionality for now. Also: - Fixed warnings in AudioPolicyManager - Allocate audio session ID before calling getOutputForAttr() in AudioTrack. Bug: 16006090. Change-Id: I15df21e4411db688e3096dd801cf579d76d81711
* | | am bf14c62e: am 72bf901c: Merge "audio policy: new getOutputForAttr() ↵Eric Laurent2014-11-261-177/+25
|\ \ \ | |/ / | | | | | | | | | | | | | | | prototype." into lmp-mr1-dev * commit 'bf14c62e7973ed793a3b00c2c67beca4484c1c7a': audio policy: new getOutputForAttr() prototype.
| * | Merge "audio policy: new getOutputForAttr() prototype." into lmp-mr1-devEric Laurent2014-11-261-177/+25
| |\ \
| | * | audio policy: new getOutputForAttr() prototype.Eric Laurent2014-11-251-177/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update getOutputForAttr() prototype and group all logic dealing with audio attributes to stream type conversion in audio policy manager. getOutputForAttr(): - specifies the audio session (for future use) - returns a status code - receives either stream type (for legacy) or audio attributes - returns an updated streamtype Remove logic dealing with legacy stream types to attributes conversion from AudioTrack. Use correct type for audio sessions in other APIs (startOutput() ...). releaseOutput() specifies the audio session (for future use). Bug: 18067208. Change-Id: I1bfbe9626c04c7955d77f8a70aecfad2cb204817
* | | | am 1e18795a: am d325005e: Merge "Fix AudioTrack loop mode to play audio from ↵Andy Hung2014-11-261-2/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | buffer start" into lmp-mr1-dev * commit '1e18795a4847e9368baa7ecee146d3901b283cd0': Fix AudioTrack loop mode to play audio from buffer start
| * | | Merge "Fix AudioTrack loop mode to play audio from buffer start" into ↵Andy Hung2014-11-251-2/+1
| |\ \ \ | | |/ / | |/| | | | | | lmp-mr1-dev
| | * | Fix AudioTrack loop mode to play audio from buffer startAndy Hung2014-11-241-2/+1
| | | | | | | | | | | | | | | | | | | | Bug: 18217633 Change-Id: Ica77acf0a32832d9b04eb657ef2f4f5329f8fbda
* | | | am 1a475921: am 223fd5c9: audio: new routing strategies and stream typesEric Laurent2014-11-261-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | * commit '1a475921c0577a4650d1bbe40a85b732d1766939': audio: new routing strategies and stream types
| * | | audio: new routing strategies and stream typesEric Laurent2014-11-211-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | am bfa77b5c: am 8cd37d67: Merge "audio policy: do not prevent routing to ↵Eric Laurent2014-11-181-0/+5
|\ \ \ | |/ / | | | | | | | | | | | | | | | A2DP when suspended." into lmp-mr1-dev * commit 'bfa77b5c687f217e26267693306aaa6cc8a63672': audio policy: do not prevent routing to A2DP when suspended.
| * | audio policy: do not prevent routing to A2DP when suspended.Eric Laurent2014-11-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow A2DP sink selection even if A2DP is suspended. It is not because use of A2DP is temporarily disabled by SCO selection that the policy rule routing a given use case to A2DP should be altered. The source will be routed to A2DP but it will remain silent until suspend condition is cleared which is the purpose of suspend mode. Also make sure that accessibility prompts are audible while in call by forcing stream type to STREAM_VOICE_CALL. Fix inconsistent logic between AudioTrack::setStreamTypeFromAttributes() and AudioPolicyManager::getStrategyForAttr() Bug: 18095151. Change-Id: I1c75dd8288ed3dd494eb942060eac9c9660dca50
* | | resolved conflicts for merge of e78a27ca to lmp-mr1-dev-plus-aospMarco Nelissen2014-11-171-3/+3
|\ \ \ | |/ / |/| / | |/ Change-Id: If10a9cc17245f95d5e10b1507445abbb4020670e
| * Update calls to IInterface::asBinder()Marco Nelissen2014-11-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | to use the new static version. Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a Conflicts: media/libmedia/IAudioFlinger.cpp media/libmedia/IMediaPlayer.cpp media/libstagefright/CameraSource.cpp