summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioResampler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* audio: Audio resampler support for 192Khz playbackYamit Mehta2015-10-061-0/+25
| | | | | | | | | | | | | | | | | | | | | Add support for QTI audio resampler audio: Audio resampler support for 192Khz playback Change-Id: Ia8f24a0874ebf6e16ef7bd1f2759a14f47149875 audio: Add audio mixing support for qti resampler Change-Id: Ib657aa12b2a72323564148c302ff8891e1bb7433 AudioMixer: Extend use of QTI resampler for 44.1Khz sampling rate Change-Id: I2a819dbc9f1e3e280cb4fa79328e331883a3e981 AudioMixer: fill 0s at right place when no more buffers available Change-Id: I50504c5a02eb0c69abfc9b047792b0f6f85b9ce8 audioflinger: add channel count check to use QTI resampler Change-Id: I8f76dd82b72a0dd8b77343e77e0d0545e1be2114 Change-Id: Ia8f24a0874ebf6e16ef7bd1f2759a14f47149875
* Return number of frames output from resample methodAndy Hung2015-04-081-10/+13
| | | | Change-Id: Ic297e2ed59839f1788c83e099ef1a9e4af29591f
* __ARM_HAVE_HALFWORD_MULTIPLY is always true for __arm__.Elliott Hughes2014-12-021-4/+1
| | | | | | | And this is the only user of that macro... Bug: 18556103 Change-Id: I1b515a54ac8530b150f4dd93070db60c701a5603
* Add floating point volume handling to AudioMixerAndy Hung2014-07-081-4/+8
| | | | | | | | | | | | | | | Use floating point volume in AudioMixer mixing when floating point input is used with the new mixer engine. AudioResampler is updated to take floating point volume to match. Both legacy integer and floating point mixer engines work. For now, integer volume is used when the new mixer engine runs in integer input mode, for backward compatibility with the legacy mixer. The new mixer engine will generally run in floating point input mode. When the legacy path is removed, the integer volumes will be removed. Change-Id: I79e80c292ae7c8b8bdd0aa371a1b2c3a1b618290
* Replace int bitDepth with audio_format_t in ResamplerAndy Hung2014-07-071-25/+30
| | | | | | | | Remove mBitDepth from class (not used). Replace with audio_format_t in factory method to distinguish between float and pcm 16-bit. Change-Id: I166860796c68285077ef4458d8758d19b82523f9
* Add and enable multichannel for audio resamplerAndy Hung2014-07-021-5/+6
| | | | | Change-Id: I2b86fb73d70abc4c456f7567270a888086b301d4 Signed-off-by: Andy Hung <hunga@google.com>
* Add and enable floating point option for audio resamplerAndy Hung2014-04-091-1/+10
| | | | | | | Can be tested with test-resample. Change-Id: I8339846d7c647444b6025d33cfa145d5d3658121 Signed-off-by: Andy Hung <hunga@google.com>
* Fix resampler to allow output of single frameAndy Hung2014-02-191-2/+2
| | | | | | Bug: 13073201 Change-Id: If7818a3389a191a37277bbd8e96a59ef8ce68509 Signed-off-by: Andy Hung <hunga@google.com>
* Fix clang warnings in AudioFlingerGlenn Kasten2014-02-101-0/+3
| | | | Change-Id: I0fa61025c979709ad7d655bc717df5f194b6089e
* am 5ef74dce: am d66cd743: Merge "audioflinger: conform inline ASM to UAL"Glenn Kasten2014-02-051-2/+2
|\ | | | | | | | | * commit '5ef74dce64a1b70534547c044a6d15533f4a9dca': audioflinger: conform inline ASM to UAL
| * audioflinger: conform inline ASM to UALsynergy dev2014-02-041-2/+2
| | | | | | | | | | | | | | Clang requires some inline ASM to conform to the UAL standards (Unified Assembler Language). This fixes a small issue in this inline asm to allow building. Change-Id: Ifd9b1814343ab5ade636b9401a21d575559dac16
| * reenable the cubic resamplerMathias Agopian2012-10-261-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | cubic resampler was disabled because it hadn't been qualified, however after I did some tests, it does improve significantly the sound quality over the order-1 resampler, even if it is still quite bad. also HIGH_QUALITY resampler was partially disabled, it's now fully enabled. It's a big improvement over the cubic resampler in terms of aliasing noise (it's not as good in the pass-band). Change-Id: I70e3658c255896588642697be9eb594ff4ec0f8b
| * Increase allowed number of VHQ resamplers to 3Glenn Kasten2012-10-221-1/+1
| | | | | | | | | | Bug: 7378660 Change-Id: I69e33ca2eb4bb9bd38e2c63df62cd1130d68baf6
| * Integrate improved coefficient sinc resampler: VHQGlenn Kasten2012-10-041-16/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Very high quality is enabled only for 44.1 -> 48 or 48 -> 44.1, and uses low quality for all other use cases. Track estimated CPU load and throttles the quality based on load; as currently configured it should allow up to 2 instances of very high quality. Medium quality and high quality are currently disabled unless explicitly requested. Details: Only load .so the first time it is needed. Cleanup code style: formatting, indentation, whitespace. Restore medium quality resampler, but it is not used (see next line). Fix memory leak for sinc resampler. Check sample rate in resampler constructor. Add logs for debugging. Rename DEFAULT to DEFAULT_QUALITY for consistency with other quality levels. Renumber VERY_HIGH_QUALITY from 255 to 4. Use enum src_quality consistently. Improve parsing of property af.resampler.quality. Fix reentrancy bug - allow an instance of high quality and an instance of very high quality to both be active concurrently. Bug: 7229644 Change-Id: I0ce6b913b05038889f50462a38830b61a602a9f7
| * audioflinger: use resample coefficients from audio-resampler library.SathishKumar Mani2012-09-261-3/+6
| | | | | | | | | | | | | | | | | | | | | | -Add a separate quality VERY_HIGH_QUALITY in resampler -Use resample coefficients audio-resampler library for quality VERY_HIGH_QUALITY. -This improves the quality of resampled output. Bug: 7024293 Change-Id: Ia44142413bed5f5963d7eab7846eec877a2415e4 Signed-off-by: Iliyan Malchev <malchev@google.com>
* | Enable new dynamic audio resampler as defaultAndy Hung2014-01-301-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | The default may still be overridden by af.resampler.quality in the local or build properties file. For the build properties check the relevant device.mk files. In the absence of being overridden, the 44.1 to 48kHz and 48 to 44.1kHz conversion will use the DYN_MED_QUALITY resamplers and other conversion will use the DYN_LOW_QUALITY resamplers. Change-Id: Icf9a4af5422cddc445e1904eef93984b0abe6a44 Signed-off-by: Andy Hung <hunga@google.com>
* | Remove warnings in Audio mixer resampler compilation.Andy Hung2014-01-291-0/+20
| | | | | | | | | | Change-Id: Ie68766142796772a54a90afdea188d0a5a78d4ac Signed-off-by: Andy Hung <hunga@google.com>
* | Audio resampler update to add S16 filtersAndy Hung2013-12-271-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | This does not affect the existing resamplers. New resampler accessed through additional quality settings: DYN_LOW_QUALITY = 5 DYN_MED_QUALITY = 6 DYN_HIGH_QUALITY = 7 Change-Id: Iebbd31871e808a4a6dee3f3abfd7e9dcf77c48e1 Signed-off-by: Andy Hung <hunga@google.com>
* | Use curly braces in 'if' to make it easier to add logsGlenn Kasten2013-08-131-2/+4
| | | | | | | | Change-Id: I58b33fefdd8bf703647414157a99a3223be3531c
* | reenable the cubic resamplerMathias Agopian2012-10-261-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | cubic resampler was disabled because it hadn't been qualified, however after I did some tests, it does improve significantly the sound quality over the order-1 resampler, even if it is still quite bad. also HIGH_QUALITY resampler was partially disabled, it's now fully enabled. It's a big improvement over the cubic resampler in terms of aliasing noise (it's not as good in the pass-band). Change-Id: I70e3658c255896588642697be9eb594ff4ec0f8b
* | Increase allowed number of VHQ resamplers to 3Glenn Kasten2012-10-221-1/+1
| | | | | | | | | | Bug: 7378660 Change-Id: I69e33ca2eb4bb9bd38e2c63df62cd1130d68baf6
* | Integrate improved coefficient sinc resampler: VHQGlenn Kasten2012-10-041-16/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Very high quality is enabled only for 44.1 -> 48 or 48 -> 44.1, and uses low quality for all other use cases. Track estimated CPU load and throttles the quality based on load; as currently configured it should allow up to 2 instances of very high quality. Medium quality and high quality are currently disabled unless explicitly requested. Details: Only load .so the first time it is needed. Cleanup code style: formatting, indentation, whitespace. Restore medium quality resampler, but it is not used (see next line). Fix memory leak for sinc resampler. Check sample rate in resampler constructor. Add logs for debugging. Rename DEFAULT to DEFAULT_QUALITY for consistency with other quality levels. Renumber VERY_HIGH_QUALITY from 255 to 4. Use enum src_quality consistently. Improve parsing of property af.resampler.quality. Fix reentrancy bug - allow an instance of high quality and an instance of very high quality to both be active concurrently. Bug: 7229644 Change-Id: I0ce6b913b05038889f50462a38830b61a602a9f7
* | audioflinger: use resample coefficients from audio-resampler library.SathishKumar Mani2012-09-261-3/+6
|/ | | | | | | | | | | -Add a separate quality VERY_HIGH_QUALITY in resampler -Use resample coefficients audio-resampler library for quality VERY_HIGH_QUALITY. -This improves the quality of resampled output. Bug: 7024293 Change-Id: Ia44142413bed5f5963d7eab7846eec877a2415e4 Signed-off-by: Iliyan Malchev <malchev@google.com>
* Whitespace and indentationGlenn Kasten2012-03-131-1/+1
| | | | | | | | | | | | | | Fix indentation to be multiple of 4. Make it easier to search: sp< not sp < to "switch (...)" instead of "switch(...)" (also "if" and "while") Remove redundant blank line at start or EOF. Remove whitespace at end of line. Remove extra blank lines where they don't add value. Use git diff -b or -w to verify. Change-Id: I966b7ba852faa5474be6907fb212f5e267c2874e
* Upintegrate Audio Flinger changes from ICS_AAHJohn Grossman2012-02-161-3/+23
| | | | | | | | Bring in changes to audio flinger made to support timed audio tracks and HW master volume control. Change-Id: Ide52d48809bdbed13acf35fd59b24637e35064ae Signed-off-by: John Grossman <johngro@google.com>
* Merge "Disable HQ resamplers for now until qualified"Glenn Kasten2012-02-101-0/+4
|\
| * Disable HQ resamplers for now until qualifiedGlenn Kasten2012-02-091-0/+4
| | | | | | | | | | | | This saves about 6500 bytes. Change-Id: I87102fe561c95c19c9e615dea3de914f96639257
* | No newline or space at end of ALOG format stringGlenn Kasten2012-02-081-12/+12
|/ | | | Change-Id: I0bef580cbc818cb7c87aea23919d26f1446cec32
* Remove dead codeGlenn Kasten2012-02-031-6/+0
| | | | | | | | mFormat is unused in resampler mClientTid is unused local variable pid is unused in dump Change-Id: Ib156e38029366620bfeff2a13e73471867155a5b
* Rename LOG_ASSERT to ALOG_ASSERT DO NOT MERGESteve Block2012-01-091-4/+4
| | | | | | | See https://android-git.corp.google.com/g/157519 Bug: 5449033 Change-Id: I8ceb2dba1b031a0fd68d15d146960d9ced62bbf3
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-081-15/+15
| | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
* Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-031-1/+1
| | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
* Bug 5522189 re-enable ARM opts but disable inlineGlenn Kasten2011-11-171-3/+4
| | | | | | | PIE did not work together with inlining. This change combines (almost all of) the performance benefits of ARM optimizations together with PIE. Change-Id: I4594d33ae5a0a7bac327ae08e30fb35343a06256
* Bug 5522189 temporary workaroundGlenn Kasten2011-10-281-1/+1
| | | | Change-Id: I21d91d7a24df7bb6e7fc3d0fbc4786d55391fc0e
* Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGESteve Block2011-10-261-3/+3
| | | | | | | See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
* AudioResampler: use relative instead of absolute labelsNick Kralevich2011-09-161-8/+8
| | | | | | | This change is needed to allow Android to compile with -fPIE Bug: 5328392 Change-Id: I84d947975776800a7b79c6ac75a881af461a631c
* am 4430670f: am ca7ad44a: Merge "audioflinger: Enable ARMv5TE optimized ↵Brad Fitzpatrick2011-04-111-2/+6
|\ | | | | | | | | | | | | resampler" * commit '4430670f48f75661293371dab8db55865f5f56e0': audioflinger: Enable ARMv5TE optimized resampler
| * audioflinger: Enable ARMv5TE optimized resamplerJim Huang2011-04-071-2/+6
| | | | | | | | | | | | | | | | | | | | Previously, the optimized asm option is only enabled when __ARM_ARCH_5E__ is defined, which is assigned in armv5te.mk rather than armv7-a series targets. This patch checks the ARM CPU feature about half-word multiply instructions to enable ARMv5TE resampler optimization routines properly. Change-Id: I4c5a5d8c932416f23bedb0b389db958349f21ea4
* | Fix issue 3479042.Eric Laurent2011-02-281-0/+6
|/ | | | | | | | | | | | | | | | The problem is that when an AudioRecord using the resampler is restarted, the resampler state is not reset (as there is no reset function in the resampler). The consequence is that the first time the record thread loop runs, it calls the resampler which consumes the remaining data in the input buffer and when this buffer is released the input index is incremented over the limit. The fix consists in implementing a reset function in the resampler. A similar problem was also present for playback but unoticed because the track buffer is always drained by the mixer when a track stops. The only problem for playback was that the initial phase fraction was wrong when restarting a track after stop (it was correct after a pause). Change-Id: Ifc2585d685f4402d29f4afc63f6efd1d69265de3
* move native services under services/Mathias Agopian2010-07-141-0/+595
moved surfaceflinger, audioflinger, cameraservice all native services should now reside in this location. Change-Id: Iee42b83dd2a94c3bf5107ab0895fe2dfcd5337a8