summaryrefslogtreecommitdiffstats
path: root/include/private
Commit message (Collapse)AuthorAgeFilesLines
* Use AudioPlaybackRate to hold TimestretchBufferProvider parametersRicardo Garcia2015-04-221-18/+8
| | | | | | | | 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
* Add playback rate to AudioTrackAndy Hung2015-04-091-2/+34
| | | | | Bug: 19196501 Change-Id: I6411e1d3ce652b711a71a6d9df020cb5f60d4714
* Update commentsGlenn Kasten2015-03-131-2/+2
| | | | Change-Id: I37d3c4ce22b74fe8581a886fe5a7f9fef8266dad
* Merge "Move roundup from frameworks/av to system/media"Glenn Kasten2015-01-121-1/+1
|\
| * Move roundup from frameworks/av to system/mediaGlenn Kasten2015-01-071-1/+1
| | | | | | | | Change-Id: I1083ab739e445e5bd3e3082fc1d3a20cc19601d5
* | Fix loop and position restoration in static AudioTracksAndy Hung2015-01-061-7/+29
| | | | | | | | | | | | | | | | 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-052-41/+47
|/ | | | | | | Allow independent setting of position and loop. Bug: 17964637 Change-Id: I8b3bd97a244b932728b68da7684044f2636984a5
* Line length 100Glenn Kasten2014-12-301-1/+2
| | | | Change-Id: I6c8fe626a3825fa9e139319656d682a57b887c97
* Fix missing loop count for static tracks.Andy Hung2014-11-181-1/+8
| | | | | | | | | | | | | | | | | StaticAudioTrackServerProxy::framesReady() previously returned only the contiguous frames, update to return the total available frames. This resolves short-count looping in SoundPool for FastTracks. Also (1) Removes the racy condition of reading two variables and (2) Fixes buffer->mNonContig to return the correct value and (3) Restores behavior that loop count of 1 goes back to loopStart once during playback. Bug: 11830751 Bug: 12070295 Bug: 17456842 Change-Id: I64906e6036bb00a1d7375b03efe6deb69d6478ca
* Fix VideoFrame class layout for 64/32 bitMarco Nelissen2014-10-091-1/+4
| | | | | | | | | This structure is passed between 64 and 32 bit processes via shared memory, so ensure it's the same size, and that the members we care about are in the same place. Bug: 17569156 Change-Id: Id776bc825af1fbf43a6dd3407cca064f6d932902
* audio flinger: add patch connection between hw modulesEric Laurent2014-07-241-7/+7
| | | | | | | | | | | | | | | | | | Add support for audio device connections between different audio hw modules. The patch is performed by creating a bridge between the playback thread connected to the sink device and the record thread connected to the source device using a pair of specialized PlaybackTrack and RecordTrack. - Added PatchTrack and PatchRecord classes. - Added TrackBase type to indicate more clearly the track behavior. - A TrackBase can allocate the buffer or reuse an existing one. - Factored some code in openOutput() and openInput() for internal use by PatchPanel. Bug: 14815883. Change-Id: Ib9515fcda864610458a4bc81fa8f59096ff4d7db
* am 2a8270e6: am c323737d: Merge "Offer a type-safe album art interface."Elliott Hughes2014-06-121-58/+0
|\ | | | | | | | | * commit '2a8270e6944fb3addfcba87f6885aaad196b8b88': Offer a type-safe album art interface.
| * Offer a type-safe album art interface.Elliott Hughes2014-06-111-58/+0
| | | | | | | | | | Bug: 15514223 Change-Id: Iddfc33a00e6cd3779ca09c01a55f62b151f6ec95
| * Replace size_t in shared memory by uint32_tGlenn Kasten2014-02-132-6/+18
| | | | | | | | | | | | | | Eventually we may want to use uint64_t, but will need to confirm atomicity. Bug: 12381724 Change-Id: Ia2c591d262d22b47b6f7dab4b9d9faa14b86d865
* | Pass stereo gains as packed minifloatGlenn Kasten2014-05-191-8/+6
| | | | | | | | | | | | | | | | | | | | This will allow (eventually) a greater dynamic range for gains. However there are still a few remaining places in effects and mixer that will also need to be changed in order to get the full benefit. Also fixes a minor bug: was not checking for NaN in AudioTrack C++. Change-Id: I63bce9e82e0a61546d8ff475fb94bcb700d99c96
* | Replace size_t in shared memory by uint32_tGlenn Kasten2014-01-282-6/+18
| | | | | | | | | | | | | | Eventually we may want to use uint64_t, but will need to confirm atomicity. Bug: 12381724 Change-Id: Ia2c591d262d22b47b6f7dab4b9d9faa14b86d865
* | Replace control block frameCount_ by explicit in/out parameterGlenn Kasten2013-12-201-5/+1
| | | | | | | | | | | | in IAudioFlinger::createTrack and IAudioFlinger::openRecord Change-Id: I09c644c80e92c8e744b1b99055988a2588b2a83d
* | am 77177fa2: am 95c03858: Merge "Allow releaseBuffer after flush" into klp-devGlenn Kasten2013-10-181-2/+3
|\ \ | |/ | | | | | | * commit '77177fa20773d02b4f9c4147ecb98107f019fa7d': Allow releaseBuffer after flush
| * Allow releaseBuffer after flushGlenn Kasten2013-10-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | After AudioTrack start checks for pending flush, allow releaseBuffer on any previously obtained buffer. For example, this can happen if the resampler has obtained a buffer but not released the whole buffer yet. Note that the resampler will be reading obsolete data. Bug: 11285590 Change-Id: I0614fbb62e43604aac3089cce4b7797c87a306b5
* | am 7f8c3973: am 120a8847: Merge "AudioTrack: fix head position after ↵Eric Laurent2013-10-161-0/+2
|\ \ | |/ | | | | | | | | | | restore" into klp-dev * commit '7f8c397378a7ee5abd395413be71388ad36d3ed2': AudioTrack: fix head position after restore
| * AudioTrack: fix head position after restoreEric Laurent2013-10-161-0/+2
| | | | | | | | | | | | | | | | | | | | The head position transfered to the new track by restoreTrack_l() must take into account the frames that are dropped from the old track to avoid a non recoverable offset in the playback head position returned to applications. Bug: 11230062. Change-Id: I51143a08b95e8f264ed709ae2054360315f2b8b1
* | am 11454092: am 18f86140: Merge "Fix underruns when fast track denied due to ↵Glenn Kasten2013-09-171-2/+0
|\ \ | |/ | | | | | | | | | | SRC" into klp-dev * commit '11454092e4a94d3c8b4576c981595339abdfac0d': Fix underruns when fast track denied due to SRC
| * Fix underruns when fast track denied due to SRCGlenn Kasten2013-09-171-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenSL ES requests a fast track. If sample rate conversion is needed, the request is denied by server, and a larger client buffer is used to handle the higher latency of a normal track. However the client notification period was calculated based on buffer being divided into 2 sub-buffers. That resulted in the notification period being too long. The server pulls chunks that are smaller than half the total buffer. So now the client uses 3 sub-buffers when there is SRC. Also removed the 'defer wake' optimization because it was incorrect. This optimization attempted to reduce the number of wakeups of client, when server releaseBuffer knows that another releaseBuffer will be following. But there is no way for the first releaseBuffer to predict how soon the second releaseBuffer will occur. In some cases it was a long time, and the client underran. So now the client is woken up immediately if the total number of available frames to client is >= the minimum number the client wants to see (the notification period). Also fix bug where minimum frame count was not being used in the calculation of notification period. Bug: 10342804 Change-Id: I3c246f4e7bc3684a344f2cf08268dc082e338e2a
* | am 908d3c09: am 51ec03c2: Merge "Implement Track::getTimestamp()" into klp-devGlenn Kasten2013-08-291-0/+3
|\ \ | |/ | | | | | | * commit '908d3c09ca7f2ccb280aa5dc8d876099ff9a9d0f': Implement Track::getTimestamp()
| * Implement Track::getTimestamp()Glenn Kasten2013-08-291-0/+3
| | | | | | | | | | | | | | using a new timestamp latch in PlaybackThread, and AudioTrackServerProxy::framesReleased() which returns mServer. Change-Id: I1ebfba968c773faaab95648c272fd3ebd74718d6
* | WhitespaceGlenn Kasten2013-08-131-1/+1
|/ | | | Change-Id: Id3ccc183a03421330d0498faaa62a45915cdc3d6
* Report underruns for fast tracks alsoGlenn Kasten2013-07-311-0/+9
| | | | | | | | | | | | | | | | | | | | | | | This fixes a regression that was introduced earlier by commit 9f80dd223d83d9bb9077fb6baee056cee4eaf7e5 called "New control block for AudioTrack and AudioRecord". That commit broke underrun reporting for fast tracks. Also remove Track::mUnderrunCount, which counted the number of underrun events, and was only used by dumpsys media.audio_flinger. Now dumpsys media.audio_flinger reports the number of underrun frames, Isolated underrun-related control block accesses via the proxy, so that the server is not directly poking around in the control block. The new proxy APIs are AudioTrackServerProxy::getUnderrunFrames() and AudioTrackServerProxy::tallyUnderrunFrames(). getUnderrunFrames() returns a rolling counter for streaming tracks, or zero for static buffer tracks which never underrun, but do a kind of 'pause' at end of buffer. tallyUnderrunFrames() increments the counter by a specified number of frames. Change-Id: Ib31fd73eb17cbb23888ce3af8ff29f471f5bd5a2
* Move control block mName to createTrack() outputGlenn Kasten2013-07-301-3/+1
| | | | | | | This is part of a series of CLs to clean up the shared memory control block, by removing any fields that don't have to be there. Change-Id: I6e51003a1293b6800258c31b22cff2eba42162e7
* Rename control block flags to mFlagsGlenn Kasten2013-07-301-1/+2
| | | | Change-Id: I7b6d31e24531954ab1ecdf3ed56c19433700bd89
* Rename control block server to mServer and add commentsGlenn Kasten2013-07-301-3/+6
| | | | Change-Id: Ieabd91acee92d0e84e66fbd358df5282b856306e
* libmedia: offloaded playback supportRichard Fitzgerald2013-07-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | - start() returns a status so that upper layers can recreate a non offloaded track in case of error. - Added states to handle offloaded tracks specific: - waiting for stream end (drain) notification by audio flinger - allow pause while waiting for stream end notification - getPosition() queries the render position directly from audio HAL. - disable APIs not applicable to offloaded tracks - Modified track restoring behavior for invalidated offloaded tracks: just send the callback and wait for upper layers to create a new track. - Added wait for stream end management in audio track client proxy. Similar to obtainBuffer and should be factored in. Change-Id: I0fc48117946364cb255afd653195498891f622bd Signed-off-by: Eric Laurent <elaurent@google.com>
* AudioFlinger: offload playback, non-blocking writeEric Laurent2013-07-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | - Added specialized playback thread class for offload playback, derived from directoutput thread. This thread type handles specific state transitions for offloaded tracks and offloading commands (pause/resume/drain/flush..) to audio HAL. As opposed to other threads, does not go to standby if the track is paused. - Added support for asynchronous write and drain operations at audio HAL. Use a thread to handle async callback events from HAL: this avoids locking playback thread mutex when executing the callback and cause deadlocks when calling audio HAL functions with the playback thread mutex locked. - Better accouting for track activity: call start/stop and release Output methods in audio policy manager when tracks are actually added and removed from the active tracks list. Added a command thread in audio policy service to handle stop/release commands asynchronously and avoid deadlocks with playback thread. - Track terminated status is not a state anymore. This condition is othogonal to state to permitted state transitions while terminated. Change-Id: Id157f4b3277620568d8eace7535d9186602564de
* AudioTrackShared cleanupGlenn Kasten2013-07-021-2/+2
| | | | | | | | Maintain unreleased frame count on client side also (was already there on server side). Assertion failure instead of BAD_VALUE status for incorrect usage of APIs. Clean up error handling code. Change-Id: I23ca2f6f8a7c18645309ee5d64fbc844429bcba8
* Public API changes for audio offload support.Richard Fitzgerald2013-06-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: this does _not_ include all private member variables added to classes as part of offload support. Only public/protected functions and stubs functions/variables needed to make the changes buildable. - isOffloadSupported() added to audio policy service A stub implementation is required to build, this always returns false - setParameters() added to IAudioTrack A stub implementation is required to build, this always returns INVALID_OPERATION - CBlk flag for stream end - Change AudioSystem::getRenderPosition() to take an audio_output_t so caller can specify which output to query - Add AudioSystem::isOffloadSupported() This is fully implemented down to the AudioFlinger function AudioPolicyServer::isOffloadSupported() which is just a stub that always returns false. - Add EVENT_STREAM_END to AudioTrack interface. STREAM_END is used to signal when the hardware has actually finished playing all the data it was sent. - Add event type enumeration to media player interface AudioSink callbacks so that the same callback can be used to handle multiple types of event. For offloaded tracks we also have to handle STREAM_END and TEAR_DOWN events - Pass audio_offload_info_t to various functions used for opening outputs, tracks and audio players. This passes additional information about the compressed stream down to the HAL when using offload. For publicly-available APIs this is an optional parameter (for some of the internal and low-level APIs around the HAL interface it is mandatory) - Add getParameters() and setParameters() API to AudioTrack Currently dummy implementations. - Change AudioPlayer contructor so that it takes a set of bitflags defining what options are required. This replaces the original bool which only specified whether to use deep buffering. - Changes to StageFright class definition related to handling tearing-down of an offloaded track when we need to switch back to software decode - Define new StageFright utility functions used for offloaded tracks Currently dummy implementations. - AudioFlinger changes to use extended audio_config_t. Fills in audio_offload_info_t member if this info is passed in when opening an output. - libvideoeditor changes required to add the new event type parameter to AudioSink callback functions - libmediaplayerservice changes required to add the new event type parameter to AudioSink callback functions Change-Id: I3ab41138aa1083d81fe83b886a9b1021ec7320f1 Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Eric Laurent <elaurent@google.com>
* Use mFutex as an event flag rather than semaphoreGlenn Kasten2013-06-241-1/+2
| | | | | | | | An event flag can be more fault-tolerant in case of loss of synchronization, as it cannot overflow. It also allows more bits to be used in the future. See http://en.wikipedia.org/wiki/Event_flag Change-Id: I01ca25d951eb263124da54bb4738f0d94ec4a48b
* New control block for AudioTrack and AudioRecordGlenn Kasten2013-06-121-124/+267
| | | | | | | | Main differences between old and new control block: - removes the mutex, which was a potential source of priority inversion - circular indices into shared buffer, which is now always a power-of-2 size Change-Id: I4e9b7fa99858b488ac98a441fa70e31dbba1b865
* Add template class SingleStateQueueGlenn Kasten2013-03-051-0/+35
| | | | Change-Id: If7e2bc9b2a216524ee9cbb68682e2634933b4973
* Start isolating control block accesses in a proxyGlenn Kasten2012-12-121-45/+183
| | | | | | | | | | | | | | | | | | | | | The proxy object will eventually be the only code that understands the details of the control block. This should make it easier to change the control block in the future. Initial set of control block fields that are isolated: - sample rate - send level - volume Prepare for streaming/static separation by adding a union to the control block for the new fields. Fix bug in handling of max sample rate on a track. It was only checking at re-configuration, not at each mix. Simplify OutputTrack::obtainBuffer. Change-Id: I2249f9d04f73a911a922ad1d7f6197292c74cd92
* am ba6b1bc3: am e7550eb2: Merge "Initialize and copy mRotationAngle in ↵Andreas Huber2012-11-301-1/+3
|\ | | | | | | | | | | | | VideoFrame" * commit 'ba6b1bc38e0c355277f69af286469adb5f02e876': Initialize and copy mRotationAngle in VideoFrame
| * Initialize and copy mRotationAngle in VideoFrameChrister Fletcher2012-11-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | When thumbnails were generated they could be generated at random angles as the mRotationAngle variable was not initialized to any value. This variable would have to be explicitly overwritten to not cause random rotation. Changed the implementation to initialize the value to 0 (no rotation). mRotationAngle was also missing in the copy constructor. Change-Id: I67a5340fdd807c6ab3a3da5eecb09b5b9d5f4666
* | Don't use control block frame count after createGlenn Kasten2012-11-161-11/+18
| | | | | | | | | | | | This is part of a series to clean up the control block. Change-Id: I7f4cb05aef63053f8e2ab05b286d302260ef4758
* | Update audio commentsGlenn Kasten2012-11-141-1/+2
| | | | | | | | Change-Id: I85d7d2f6381b251db5695202fec75128883a8662
* | Simplify AudioRecord::restoreTrack_l()Glenn Kasten2012-11-131-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Finish removing CBLK_RESTORING and CBLK_RESTORED from control block flags, and remove constant RESTORE_TIMEOUT_MS. Also minor cleanup: - Cache mCblk in local variable cblk and make cblk allocatable in a register. - Use "iMem" for sp<IMemory>. - Add missing error log to AudioRecord; it was already in AudioTrack. This is part of a series to clean up the control block. Change-Id: Ia5f5ab4763c392bc06a45851b167ddaee29e3455
* | Move frame size out of the control blockGlenn Kasten2012-11-121-5/+2
| | | | | | | | | | | | This is part of a series to clean up the control block. Change-Id: Ifab1c42ac0f8be704e571b292713cd2250d12a3f
* | Move buffers pointer out of the control blockGlenn Kasten2012-11-081-4/+5
| | | | | | | | | | | | This is part of a series to clean up the control block. Change-Id: Ie474557db7cb360f2d9a0f11600a68f5a3d46f07
* | Simplify AudioTrack::restoreTrack_l()Glenn Kasten2012-11-081-0/+2
| | | | | | | | | | | | | | | | | | Remove CBLK_RESTORING and CBLK_RESTORED from control block flags, for AudioTrack only. They are still used by AudioRecord. This is part of a series to clean up the control block. Change-Id: Iae4798f5b527c492bdaf789987ff3a1dadd0cb37
* | Remove CBLK_DIRECTION from control block flagsGlenn Kasten2012-11-071-12/+26
| | | | | | | | | | | | This is part of a series to clean up the control block. Change-Id: I0265fece3247356b585d4d48fbda6f37aea8a851
* | Remove CBLK_FAST from control block flagsGlenn Kasten2012-11-061-1/+0
| | | | | | | | | | | | This is part of a series to clean up the control block. Change-Id: Ic881a3560d9547cb63fcc0cefec87aa3da480e0d
* | Simplify control block flag namesGlenn Kasten2012-11-051-22/+9
| | | | | | | | | | | | Use only one symbol per flag Change-Id: Ia3582e2134abd60c896d11337face65383e79c7c
* | Line length 100Glenn Kasten2012-11-011-2/+4
|/ | | | Change-Id: Ib28fd7b9ce951a6933f006e7f8812ba617625530