summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/FastMixer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* audioflinger: clear mMixerBuffer if frame is not readyMohan Kumar2016-03-221-3/+15
| | | | | | | | Clear the mMixerBuffer if frame is not ready before the FastMixer starts processing. Otherwise it might result in large glitches on output device due to junk data present in the mixbuffer. Change-Id: I9f025234d4ac100f85d2ec67c06a8df4195bea98
* Fix FastMixer high bit depth Hal supportAndy Hung2015-06-191-0/+4
| | | | | Bug: 21959591 Change-Id: Ia3351ea5644b36852a1f0dad1314beac97d840e1
* Update commentsGlenn Kasten2015-03-131-0/+1
| | | | Change-Id: I37d3c4ce22b74fe8581a886fe5a7f9fef8266dad
* Remove redundant this->Glenn Kasten2015-03-031-6/+6
| | | | Change-Id: Iaa11bcce94dd331425197aab49065939e226a6a2
* Add "m" prefix to fieldsGlenn Kasten2015-03-031-121/+121
| | | | Change-Id: Ifdb8fa886d1ff53cd7c8aff3c2f8286e6e18dec2
* Rename FAST_MIXER_STATISTICS to FAST_THREAD_STATISTICSGlenn Kasten2015-03-021-2/+2
| | | | Change-Id: Idb5f5bf0c20bffff8536cf4a46f696e12e99e81b
* Warmup cycles must be in range and consecutiveGlenn Kasten2015-02-191-2/+4
| | | | Change-Id: Ie8a40ec3547bdd62a1e2e05b11fb107c25841784
* Include what you useGlenn Kasten2015-02-191-0/+1
| | | | Change-Id: I1967861f383bb5ed6743fb69e3bd439907ed7033
* Pull out FastCaptureDumpState and FastMixerDumpStateGlenn Kasten2015-02-191-219/+0
| | | | Change-Id: I8e44dbfe02338622eb69193b234743b50f0dd79f
* Line length 100Glenn Kasten2014-12-301-1/+2
| | | | Change-Id: I6c8fe626a3825fa9e139319656d682a57b887c97
* Restore the ability to build tee sink for debuggingGlenn Kasten2014-09-021-1/+1
| | | | | | | | | | | | This changelist does not enable tee sink, but makes it possible to do so. Tee sink had suffered some bit rot since it is not built by default. Also fixes a crash for > 2 byte per sample or > 2 channels. Still does not write correct header for floating-point; that will be best solved by moving to libsndfile. Bug: 16990102 Change-Id: I8e92c588ccc513d7802d696fcfb324e815772df6
* Add multichannel capability to AudioFlingerAndy Hung2014-07-241-5/+24
| | | | | | But not enabled (kEnableExtendedChannels == false). Change-Id: I62f7e31fbd29ad703a9a02f5d1a280b6972dd423
* Change parameter type for volume to float in AudioMixerAndy Hung2014-05-301-10/+8
| | | | Change-Id: I4da1505ce852505f86f8e5b87f60e8edceeb30e0
* Add multiple format capability to FastMixerAndy Hung2014-05-291-5/+33
| | | | | | | Floating point data from MixerThread into FastMixer. Multiple output format capability from FastMixer to Sink. Change-Id: I0da17810ee71381a39a006c46faec71108d22c26
* Merge "Rename mixBuffer to mMixerBuffer in FastMixer"Andy Hung2014-05-271-18/+18
|\
| * Rename mixBuffer to mMixerBuffer in FastMixerAndy Hung2014-05-231-18/+18
| | | | | | | | | | | | | | Likewise mixBufferState becomes mMixerBufferState. This harmonizes with the naming in AF::MixerThread. Change-Id: I1255d7c07cc2c6ee925d7430925236d2bd163122
* | Merge "Add multiple format capability to AudioMixer"Andy Hung2014-05-271-1/+5
|\ \ | |/
| * Add multiple format capability to AudioMixerAndy Hung2014-05-231-1/+5
| | | | | | | | | | Change-Id: I04ac1cafd90b6ed652f8d51888ad07576678f0bc Signed-off-by: Andy Hung <hunga@google.com>
* | Merge "Add format parameter to getTrackName() and track_t"Andy Hung2014-05-231-1/+2
|\ \ | |/
| * Add format parameter to getTrackName() and track_tAndy Hung2014-05-191-1/+2
| | | | | | | | | | Change-Id: Ia152a839014e235fbfb656104c15d7c1b456d02e Signed-off-by: Andy Hung <hunga@google.com>
* | am 79262cfc: am 5b756bfd: am 8b187f4a: Merge "Move frameworks/av off ↵Elliott Hughes2014-05-231-1/+0
|\ \ | | | | | | | | | | | | | | | | | | <sys/atomics.h>." * commit '79262cfc14a9d8b5aa29d43e84ea91eedb9492ba': Move frameworks/av off <sys/atomics.h>.
| * | Move frameworks/av off <sys/atomics.h>.Elliott Hughes2014-05-221-1/+0
| | | | | | | | | | | | | | | Bug: 14903517 Change-Id: I92cdfc618d83fd914cfb558a07b1deae0255fccb
* | | resolved conflicts for merge of f285c91e to masterElliott Hughes2014-05-221-31/+31
|\ \ \ | |/ / | | | | | | Change-Id: I4c995e297d09c0854a42142cc57dce8b771acf65
| * | Move frameworks/av from fdprintf to POSIX dprintf.Elliott Hughes2014-05-221-25/+25
| | | | | | | | | | | | | | | Bug: 11156955 Change-Id: Ia98cd16b4c1f7be87cf060b7456de4f40896bacb
| * | Restore accidentally-removed NULL timeout.Elliott Hughes2014-05-211-1/+1
| | | | | | | | | | | | Change-Id: I933c80fea50950243f109acf8d6350013aaa811f
| * | Move frameworks/av off private API.Elliott Hughes2014-05-211-1/+1
| | | | | | | | | | | | | | | Bug: 11156955 Change-Id: Ib3bb9d66a2bf92977c2445b62aa074a2d7a45aea
* | | Merge "Update AudioMixer::getTrackName to save channelMask"Andy Hung2014-05-201-5/+1
|\ \ \ | | |/ | |/|
| * | Update AudioMixer::getTrackName to save channelMaskAndy Hung2014-05-161-5/+1
| | | | | | | | | | | | | | | Change-Id: I4fb4abbff1b05bdd0f6e21b5f5f4c3f2a57ae28d Signed-off-by: Andy Hung <hunga@google.com>
* | | Pass stereo gains as packed minifloatGlenn Kasten2014-05-191-5/+7
|/ / | | | | | | | | | | | | | | | | | | 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
* | Start pulling bits of FastMixer up to FastThreadGlenn Kasten2014-04-281-561/+327
| | | | | | | | Change-Id: I4c6f7b8f88fcf107bb29ee6432feecd4ab6554d2
* | Fix regression in FastMixer statisticsGlenn Kasten2014-04-071-0/+1
| | | | | | | | | | | | | | | | | | At some point, the mSampleRate in FastMixerDumpState stopped being initialized correctly. I'm not sure when this happened, it doesn't seem to be introduced in recent CLs. This lack of initialization caused some of the FastMixer statistics based on sample rate to be useless. Change-Id: Id2a96d606130a90c4c4f1bddd59778f6c6428a9c
* | Use LOG_ALWAYS_FATAL instead of LOG_FATALGlenn Kasten2014-03-261-1/+1
| | | | | | | | | | | | | | LOG_FATAL is compiled out in most builds, so the assertion checks were not being performed. Change-Id: I774f0985ab9c5ccecd8989a0f1c940386b73fc35
* | resolved conflicts for merge of 566be7c3 to masterNarayan Kamath2014-02-111-6/+6
|\ \ | |/ | | | | Change-Id: I7b1cc71057b2bd4f771e7bcf508a8c3abd6017ce
| * Make frameworks/av 64-bit compatibleKévin PETIT2014-02-111-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | am 5a458ede: am 5930e8eb: Merge "AudioFlinger: Remove code for supporting ↵Glenn Kasten2014-02-101-23/+4
|\ \ | |/ | | | | | | | | | | resampling in fast tracks" * commit '5a458ede3b7d303723fde4b856532bdc3b94971b': AudioFlinger: Remove code for supporting resampling in fast tracks
| * AudioFlinger: Remove code for supporting resampling in fast tracksMartin Storsjo2014-02-051-23/+4
| | | | | | | | | | | | This isn't used at the moment. Change-Id: I4e0fb2af5f7d959dbafd5ddb7defa1c6b8e8636a
* | Pretty up audioflinger dumpsysMarco Nelissen2014-02-101-19/+25
| | | | | | | | Change-Id: I57e44b4c36b99f7149542bbcf9645521c6152dfa
* | Use Format_isValid() and Format_isEqual() instead of direct comparisonGlenn Kasten2014-02-031-1/+1
| | | | | | | | Change-Id: Ie87607aa514976947540a77775e6425c4e56e7d9
* | am 97992cc7: am 732845c7: FastMixer computes presentation timestamps for ↵Glenn Kasten2013-09-031-1/+46
|\ \ | |/ | | | | | | | | | | fast tracks * commit '97992cc71fd0bbd4aa22e5195ee7e5cde09ac254': FastMixer computes presentation timestamps for fast tracks
| * FastMixer computes presentation timestamps for fast tracksGlenn Kasten2013-09-031-1/+46
| | | | | | | | | | | | and forwards them to each track's ExtendedAudioBufferProvider::onTimestamp(). Change-Id: I06fb9586bb7e20d5c0289abdc8cac6cd3fd2f6e8
* | Use curly braces in 'if' to make it easier to add logsGlenn Kasten2013-08-131-1/+2
|/ | | | Change-Id: I58b33fefdd8bf703647414157a99a3223be3531c
* HAL stream format for mixer output threads must be stereo 16-bit PCMGlenn Kasten2013-07-251-3/+5
| | | | | | | | | | | | | | | | | | | | Direct and tunnel output threads can support various HAL stream formats, included encoded. But currently there are stereo 16-bit PCM assumptions in several places for mixer and duplicating output threads: - mMixBuffer and mixBuffer() - AudioMixer including resampler - FastMixer's mixBuffer - effects - NBAIO_Format - anywhere FCC_2 is used - possibly other places Until those assumptions are removed, this CL enforces stereo 16-bit PCM in mixer and duplicating threads at the place where the HAL format is read. It was already being checked in checkForNewParameters_l(), but not in readOutputParameters(). Change-Id: Ibe344cc922743da234299097aa1bb1f54795cc9b
* Use AudioSystem::setLowRamDevice() to configure memoryGlenn Kasten2013-07-191-13/+29
| | | | | Bug: 9798886 Change-Id: I9321e3f369f1ed9429ae222e3926ebdeb012b8b0
* Make AudioFlinger::instantiate() more resilient when called from separate moduleGlenn Kasten2013-07-191-0/+7
| | | | | Bug: 8834855 Change-Id: I4cd842cdfb09d2aaaaab9df9ac3bec6179709bd3
* Fix indentationGlenn Kasten2013-07-101-74/+74
| | | | Change-Id: Ia28720a7d0fad8cf110c2448b967d5648d42e017
* Remove timing jitter during startup of audioGlenn Kasten2013-04-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression introduced recently, that increased timing jitter during the startup of the FastMixer and AudioTrack callback threads. The regression was to make requestPriority() asynchronous as a way to avoid an apparent priority inversion in system_server. This means that the target thread could run briefly with the initial priority, before the new priority takes effect. This change removes the startup jitter for FastMixer, by making the requestPriority() synchronous again for that case. It doesn't matter that this restores the priority inversion involving normal mixer thread, because it happens during startup of both threads. The change also removes the startup jitter for the AudioTrack callback thread, by having the target thread check whether the requestPriority() has completed yet. If not, the target thread blocks with a timeout until the priority boost finishes. Finally, we now log an error message if the expected priority boost doesn't happen. Bug: 8698989 Change-Id: Id590e9a274b70ec1ba85b44a585ee37a22e41cbc
* Miscellaneous cleanupGlenn Kasten2013-03-041-3/+3
| | | | | | | | | | Abbreviation framesReady to fRdy for new systrace. Put inline const on one line. Use local copy of mState in state. Improve logging. Line length 100. Change-Id: I8201c3ce0e53fd464fd33d02544e52c342d40b68
* media.log cleanupGlenn Kasten2013-03-011-17/+7
| | | | | | | | | | | | | | Remove almost all of the specific logs, but leave the media.log logging infrastructure in place for the next time we need it. Re-apply a few good changes that were reverted earlier: - check logf format vs. argument list compatibility - distinguish potentially modified and actually modified tracks in FastMixer - fix benign bug where sq->end() was called more than once - fix a build warning Bug: 6490974 Change-Id: I02d3e83646c738acaebb415bd0d6b548638b4ef5
* Revert "Temporary additional logging to investigate bug"Glenn Kasten2013-02-151-89/+4
| | | | | | This reverts commit 32584a7d672864b20ab8b83a3cb23c1858e908b7 Change-Id: I9dc680578b955b1af462eeb7a49d61a0d45eb81b
* Temporary additional logging to investigate bugGlenn Kasten2013-02-151-4/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug appears related to continuing to use an invalid buffer provider in fast mixer after track destruction, so focus the added logs in that area. Also includes a bug fix: was calling log in an unsafe place near Threads.cpp AudioFlinger::PlaybackThread::createTrack_l line 1250. Details: - include caller pid or client pid where appropriate - increase log buffer size - log mFastIndex when AudioMixer sees an invalid bufferProvider. - log both potentially modified and actually modified tracks in FastMixer. - fix benign bug where sq->end() was called more than once. - log StateQueue push() call and return. - increase StateQueue size from 4 to 8 entries - log mixer->enable(), bufferProvider, and currentTrackMask - log buffer provider addresses - increase fast mixer log buffer again - check logf format vs. argument list compatibility - add logging to AudioMixer - add checking of magic field in AudioMixer to detect overwrites - add bool AudioMixer::enabled() - increase log buffer sizes yet again - enable assertion checking without ALOGV - improve a few log messages - check for corruption in more places - log in all the process hooks - add new mixer APIs so we can check for corruption of mixer state - fix a build warning Bug: 6490974 Change-Id: Ib0c4a73dcf606ef9bd898313b3b40ef61ab42f51