summaryrefslogtreecommitdiffstats
path: root/media/libmedia
Commit message (Collapse)AuthorAgeFilesLines
* Replace size_t in shared memory by uint32_tGlenn Kasten2014-02-131-6/+13
| | | | | | | Eventually we may want to use uint64_t, but will need to confirm atomicity. Bug: 12381724 Change-Id: Ia2c591d262d22b47b6f7dab4b9d9faa14b86d865
* Make frameworks/av 64-bit compatibleKévin PETIT2014-02-113-10/+10
| | | | | | | | | | | | Contains the necessary changes to make frameworks/av build and work on a 64-bit machine. Signed-off-by: Craig Barber <craig.barber@arm.com> Signed-off-by: Kévin PETIT <kevin.petit@arm.com> Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> Change-Id: I725feaae50ed8eee25ca2c947cf15aee1f395c43
* AudioTrack: Never try to use the fast path if resampling is requiredMartin Storsjo2014-01-311-0/+6
| | | | | | | | | | | | | | | | | | Unless AudioFlinger was built with FAST_TRACKS_AT_NON_NATIVE_SAMPLE_RATE enabled, AudioFlinger would deny using the fast path (and internally fall back to the normal codepath) when it realized that resampling was required. Since the buffer size calculations within AudioFlinger don't take resampling into account properly (see the calculation below "AUDIO_OUTPUT_FLAG_FAST denied" in audioflinger/Threads.cpp, just below the hunk that this patch changes), make sure AudioTrack doesn't try to use the fast path if resampling is required. This removes the possibility to enable FAST_TRACKS_AT_NON_NATIVE_SAMPLE_RATE in AudioFlinger since it AudioTrack now won't even try to use the fast path for content that requires resampling, regardless of the AudioFlinger configuration. Change-Id: Icf0f8ad50bf0fdb84657f518c0120aa0535f23f9
* Do partial reads in MemoryLeakTrackUtilOscar Rydhé2014-01-231-3/+11
| | | | | | | Do partial read in MemoryLeakTrackUtil dumpMemoryAddresses to avoid using more memory than what is allocated. Change-Id: I94feb4e00647407f938571167b981c7371f39e3d
* AudioTrack: fix position callback after restoreEric Laurent2013-12-171-1/+0
| | | | | | | | | | | When restoring an AudioTrack, the next position callback point should not be modified and set ahead of current buffer head. Otherwise, as frames are dropped, the new position is never reached and an application relying on position callbacks to reload the buffer would be stalled. Bug: 11868603. Change-Id: I93b2a311642a0c89944b78bcc0482d4ceed98ae4
* update offloaded audio track sampling rateEric Laurent2013-12-171-0/+13
| | | | | | | | AudioPlayer must read the sampling rate from offloaded audio sinks whenever a new time position is computed as the decoder can update the sampling rate on the fly. Change-Id: I997e5248cfd4017aeceb4e11689324ded2a5bc88
* Merge "Increase kFastTrackMultiplier from 1 to 2"Glenn Kasten2013-12-171-4/+7
|\
| * Increase kFastTrackMultiplier from 1 to 2Glenn Kasten2013-12-041-4/+7
| | | | | | | | Change-Id: I158f147295eebcea96e4047d7618069bc48bdd7d
* | am 9cae2170: Assign blame for playback wakelocks.Marco Nelissen2013-10-262-6/+19
|\ \ | | | | | | | | | | | | * commit '9cae217050aa1347d4ac5053c305754879e3f97f': Assign blame for playback wakelocks.
| * | Assign blame for playback wakelocks.Marco Nelissen2013-10-252-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set a work source for the playback wakelock, so that playback is counted against the requesting app instead of the media server. Cherrypicked from master. b/9464621 Change-Id: I7329f88a288a95a582a78005a1c3d16a5a611e31
* | | am 95c03858: Merge "Allow releaseBuffer after flush" into klp-devGlenn Kasten2013-10-181-3/+7
|\ \ \ | |/ / | | / | |/ |/| * commit '95c03858e2ab4fb693a2bfe47b3caa806e43c044': Allow releaseBuffer after flush
| * Allow releaseBuffer after flushGlenn Kasten2013-10-181-3/+7
| | | | | | | | | | | | | | | | | | | | | | 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 f8f15b05: Merge "Fix race condition in AudioTrack::pause followed by ↵Glenn Kasten2013-10-161-7/+8
|\ \ | |/ | | | | | | | | | | start" into klp-dev * commit 'f8f15b05fe051009945c9042a1a9260280e0feb2': Fix race condition in AudioTrack::pause followed by start
| * Merge "Fix race condition in AudioTrack::pause followed by start" into klp-devGlenn Kasten2013-10-171-7/+8
| |\
| | * Fix race condition in AudioTrack::pause followed by startGlenn Kasten2013-10-161-7/+8
| | | | | | | | | | | | | | | Bug: 11148722 Change-Id: Iec88f00c8510363d4418e4b8d5b34feb06ecf04d
* | | am 120a8847: Merge "AudioTrack: fix head position after restore" into klp-devEric Laurent2013-10-162-1/+24
|\ \ \ | |/ / | | | | | | | | | * commit '120a88471a607c85c4d60300d73c3be0a1e8f8c8': AudioTrack: fix head position after restore
| * | AudioTrack: fix head position after restoreEric Laurent2013-10-162-1/+24
| |/ | | | | | | | | | | | | | | | | | | 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 b3cb72a1: SoundPool: handle new audio track eventEric Laurent2013-10-131-2/+7
|\ \ | |/ | | | | | | * commit 'b3cb72a17d9a472883e9e2faa18b42eac533fe99': SoundPool: handle new audio track event
| * SoundPool: handle new audio track eventEric Laurent2013-10-121-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | If the AudioTrack is torn down, SoundPool will never receive the buffer end event and the track will stay active for ever. The fix consists in stopping the AudioTrack when a new audiotrack event is received. Bug: 11193583. Change-Id: I9876eb2a8f75c601368f669acd67b0accf6e2736
* | am fee4ce33: Merge "Cleanup openRecord error handling" into klp-devGlenn Kasten2013-10-072-2/+19
|\ \ | |/ | | | | | | * commit 'fee4ce338d78eeb58af1f66831ead53322d3859e': Cleanup openRecord error handling
| * Merge "Cleanup openRecord error handling" into klp-devGlenn Kasten2013-10-072-2/+19
| |\
| | * Cleanup openRecord error handlingGlenn Kasten2013-09-242-2/+19
| | | | | | | | | | | | | | | Bug: 10888816 Change-Id: I84897dd7d30b370640b54e928f230604b873cb68
* | | am 56ce7260: IOMX: Add prepareForAdaptivePlayback methodLajos Molnar2013-10-031-0/+34
|\ \ \ | |/ / | | | | | | | | | * commit '56ce726019f700a95ce5b45beebceadae4836e30': IOMX: Add prepareForAdaptivePlayback method
| * | IOMX: Add prepareForAdaptivePlayback methodLajos Molnar2013-10-031-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prepareForAdaptivePlayback is the fallback mechanism to support seamless resolution change for devices that do not support dynamic output buffers. It is up to the codecs to handle this appropriately, but codecs that do not handle dynamic output buffers would request enough buffers up to the requested size in this method to avoid port reconfiguration on resolution changes. Change-Id: I58d4aa8ef1359ea3472735bbe9140c3132039b3d Signed-off-by: Lajos Molnar <lajos@google.com> Bug: 10192531 Related-to-bug: 7093648
* | | am 1adf20ce: Merge "fix volume and effect enable delay on offloaded tracks" ↵Eric Laurent2013-10-012-0/+15
|\ \ \ | |/ / | | | | | | | | | | | | | | | into klp-dev * commit '1adf20ce868b80a24f7387daa6549364d5509c6a': fix volume and effect enable delay on offloaded tracks
| * | fix volume and effect enable delay on offloaded tracksEric Laurent2013-09-302-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Volume: add a method to wake up the mediaserver playback thread when a volume command is received on an offloaded track. Effects: call effect chain process on offloaded playback threads asynchronously from writes to allow effect state updates while waiting for async write callback. Bug: 10796540. Change-Id: Id2747ae88783575d1d7ffd6fc86fbd054ab2c739
* | | am 1c7f35d1: Merge "soundpool: allocate shared memory heap by client" into ↵Eric Laurent2013-09-244-53/+111
|\ \ \ | |/ / | | | | | | | | | | | | | | | klp-dev * commit '1c7f35d1f25eb7160314fdef536463fc34deb1ea': soundpool: allocate shared memory heap by client
| * | soundpool: allocate shared memory heap by clientEric Laurent2013-09-244-53/+111
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current SoundPool implementation allocates the shared memory heap containing decoded PCM samples in mediaserver process. When mediaserver process crashes, the shared memory heaps allocated by AudioCache cannot be mapped anymore in the new instance of mediaserver. This causes a silent failure to end playback of new sounds because AudioFlinger believes the new AudioTracks are opened in streaming mode and not static mode: it sees a NULL shared memory pointer when the track is created. The fix consists in allocating the memory heap in the client process. Thus the heap is not lost when mediaserver restarts. The global memory usage is the same as this is shared memory. Also added a way to detect that a shared memory is passed when the track is created but cannot be mapped on mediaserver side. Also fix a crash in SoundPool when ALOGV is enabled. Bug: 10894793. Change-Id: Ice6c66ec3b2a409d75dc903a508b6c6fbfb2e8a7
* | am 402dfba6: Merge "Add support for level measurements in Visualizer" into ↵Jean-Michel Trivi2013-09-231-0/+68
|\ \ | |/ | | | | | | | | | | klp-dev * commit '402dfba6dcd68f5fd8d8921f9751f3e47eb1449d': Add support for level measurements in Visualizer
| * Merge "Add support for level measurements in Visualizer" into klp-devJean-Michel Trivi2013-09-231-0/+68
| |\
| | * Add support for level measurements in VisualizerJean-Michel Trivi2013-09-231-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | New commands to set a measurement mode and perform peak + RMS measurements. Bug 8413913 Change-Id: Ib25254065c79d365ebb34f9dc9caa0490e2d300d
* | | am 1d2536f4: Merge "AudioTrack: fix music resume" into klp-devEric Laurent2013-09-232-4/+6
|\ \ \ | |/ / | | | | | | | | | * commit '1d2536f460d4678770f423f50cbf6a61a13d4d11': AudioTrack: fix music resume
| * | AudioTrack: fix music resumeEric Laurent2013-09-232-4/+6
| |/ | | | | | | | | | | | | | | Fix regression introduced by commit 5a6cd22 in AudioTrack resume: the callback thread was not signaled if paused internaly. Bug: 10895013. Change-Id: Ic356b115132d6fccbcee2d9bb855e92671dc20c5
* | am 4b701cc0: Merge "Revert "Workaround slow AudioTrack destruction"" into ↵Glenn Kasten2013-09-201-23/+0
|\ \ | |/ | | | | | | | | | | klp-dev * commit '4b701cc041d635e5ec56e382043a4c5d01aedd80': Revert "Workaround slow AudioTrack destruction"
| * Merge "Revert "Workaround slow AudioTrack destruction"" into klp-devGlenn Kasten2013-09-201-23/+0
| |\
| | * Revert "Workaround slow AudioTrack destruction"Glenn Kasten2013-09-201-23/+0
| | | | | | | | | | | | | | | | | | This reverts commit 8bbbd7da02fac3de40139af19f7cf7a7cc3cc824. Change-Id: I269a6c445cbce33451b6a9e74223e36e6abbdbe0
* | | am 3b3cfcfa: Merge "Fix slow AudioTrack and AudioRecord destruction" into ↵Glenn Kasten2013-09-202-48/+59
|\ \ \ | |/ / | | | | | | | | | | | | | | | klp-dev * commit '3b3cfcfa272c8e3e16c89765b8817f5a8de0c505': Fix slow AudioTrack and AudioRecord destruction
| * | Fix slow AudioTrack and AudioRecord destructionGlenn Kasten2013-09-202-48/+59
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two causes for the slowness: When thread was paused, it used nanosleep and sleep. These usually run to completion (except for POSIX signal, which we avoid because it is low-level). Instead, replace the nanosleep and sleep by condition timed wait, as that can be made to return early by a condition signal. Another advantage of condition timed wait is that a condition wait was already being used at top of thread loop, so it is a simpler change. The AudioRecord destructor was missing a proxy interrupt that was correct in AudioTrack. This proxy interrupt is needed in case another thread is blocked in proxy obtainBuffer. Does not address the 1 second polling for NS_WHENEVER. Bug: 10822765 Change-Id: Id665994551e87e4d7da9c7b015f424fd7a0b5560
* | am feb6d27b: Merge "Workaround slow AudioTrack destruction" into klp-devGlenn Kasten2013-09-191-0/+23
|\ \ | |/ | | | | | | * commit 'feb6d27bf61cd266cf753215e9cae16b9bc9dbbd': Workaround slow AudioTrack destruction
| * Workaround slow AudioTrack destructionGlenn Kasten2013-09-181-0/+23
| | | | | | | | | | Bug: 10809586 Change-Id: I5f30d4deb1233e8ade8967568e40684ef680c395
* | am 9a98b6de: Merge "Partial fix for SoundPool not terminating" into klp-devGlenn Kasten2013-09-181-2/+2
|\ \ | |/ | | | | | | * commit '9a98b6de791aeb130192df10744f5b35f8b6ef1a': Partial fix for SoundPool not terminating
| * Partial fix for SoundPool not terminatingGlenn Kasten2013-09-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | SoundPool was waiting for EVENT_UNDERRUN only to indicate end of clip. In J, AudioTrack delivered both EVENT_UNDERRUN followed by EVENT_BUFFER_END. However, as of K, AudioTrack is only delivering EVENT_BUFFER_END (this lack of EVENT_UNDERRUN is another bug which still needs to be fixed). The workaround is to also respond to EVENT_BUFFER_END in SoundPool. Bug: 10787103 Change-Id: Id68a23bddd6dd9df6c49c55138197260d71ca468
* | am 18f86140: Merge "Fix underruns when fast track denied due to SRC" into ↵Glenn Kasten2013-09-172-37/+37
|\ \ | |/ | | | | | | | | | | klp-dev * commit '18f861404efc054da0a2ea6c582e293940f63bc8': Fix underruns when fast track denied due to SRC
| * Fix underruns when fast track denied due to SRCGlenn Kasten2013-09-172-37/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 fc270954: am e56f3c96: Merge "strtok stores its values in thread local ↵Glenn Kasten2013-09-171-2/+3
|\ \ | |/ |/| | | | | | | | | storage. So it can not guarantee works well when multithread environment. AudioFlinger has multithread. so strtok_r is more safe." * commit 'fc270954192ef7e15ac2c88daadd8890d22096e3': strtok stores its values in thread local storage. So it can not guarantee works well when multithread environment. AudioFlinger has multithread. so strtok_r is more safe.
| * am e56f3c96: Merge "strtok stores its values in thread local storage. So it ↵Glenn Kasten2013-09-171-2/+3
| |\ | | | | | | | | | | | | | | | | | | can not guarantee works well when multithread environment. AudioFlinger has multithread. so strtok_r is more safe." * commit 'e56f3c96fa6e7550b67e8b049f999aaa2ada1192': strtok stores its values in thread local storage. So it can not guarantee works well when multithread environment. AudioFlinger has multithread. so strtok_r is more safe.
| | * strtok stores its values in thread local storage.seunghak.han2013-09-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | So it can not guarantee works well when multithread environment. AudioFlinger has multithread. so strtok_r is more safe. Change-Id: I6d77ef9cc49a4478dd856dcdca14e4920ce955c6
| | * Fix SoundPool.play() looping regression in 4.3 DO NOT MERGEGlenn Kasten2013-08-091-1/+3
| |/ | | | | | | | | | | | | | | | | | | The change I7370d6e59a7ef26dfb284a8b058d5ab2e0a42ccf caused a regression in SoundPool looping when using SoundPool's streaming implementation. This reverts a portion of that change. Bug: https://code.google.com/p/android/issues/detail?id=58113 Bug: 10171337 Change-Id: I8af0dc8683a7c7f225c80f0eb4d39770667b52e5
* | Fix SoundPool.play() loopingGlenn Kasten2013-09-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This is done by configuring SoundPool for shared memory and fast track. Previously SoundPool used a streaming track, and looping in streaming mode relied on the ability to loop the most recently enqueued data. That 'feature' was lost in the new implementation of streaming, so we're now switching from streaming mode to shared memory mode. Shared memory mode had always been desired, but was blocked by bug 2801375 which is fixed now. Bug: 10171337 Change-Id: I2a938e3ffafa2a74d5210b4198b50db20ad5da0e
* | Merge "wifi-display: do not use HDCP's encryptNative method if its ↵Chong Zhang2013-09-041-0/+16
|\ \ | | | | | | | | | unsupported" into klp-dev