summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioMixer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* audio: QTI resampler supports for 32 bit input formatZhou Song2016-04-131-1/+2
| | | | | | | | | | | Configure QTI resampler as 32 bit input format to avoid losing precision. audioflinger: add channel count check to use QTI resampler Change-Id: I8f76dd82b72a0dd8b77343e77e0d0545e1be2114 CRs-Fixed: 940287 Change-Id: I7e1b8582cd6bb106ab0bd25f9bc1bd9e4092318b
* Revert "AudioMixer: delete reformatBuffer provider in proper order"Ashish Jain2016-02-011-2/+2
| | | | | | This reverts commit 415bcac8afac7aef3e9853cfe4a0f2a0eb2f04ad. Change-Id: Ibbc35f16ef8cd17ead72498178c3e7bca1dff3cc
* AudioMixer: Clear bufferProviders in correct orderAshish Jain2016-02-011-9/+5
| | | | | | | | | | | | | | | | | | | | | Issue: While switching between clips with different track properties, when earlier track is cleared, postDownMixerBufferProvider tries to release a buffer to serverProxy instead of the original owner i.e. downMixBufferProvider. This illegal releaseBuffer call to serverProxy results in an assert in AudioTrackShared. -In issue scenario, data flow path in AudioMixer is, ServerProxy-->-->DownMixer-->PostDownMixer-->Resampler, - Clear for downMixerBufferProvider ensures that all serverproxy buffers are returned back. -This also causes the postDownMixer to get connected with serverProxy. -Hence on delete of postDownMixer illegal releaseBuffer for serverProxy gets executed. Fix: Clear PostDownMixerBufferProvider before clearing DownMixerBufferProvider to ensure that buffers are release to right owners. Change-Id: I982366660d0a1e04be8cca6dabe758221dedf9b1
* AudioMixer: delete reformatBuffer provider in proper orderSharad Sangle2016-01-181-2/+2
| | | | | | | | | | | If mixer is creating reformatBufferProvider and downMixerBufferProvider while adding a track it first creates downMixerProvider then reformatBufferProvider. While deleting track it first deletes downMixerBufferProvider and then reformatBufferProvider, which should be in reverse order, the object created last should be deleted first. Change-Id: I844e7862280fe37c3167b31e92bbb27aa9463315
* audio: Audio resampler support for 192Khz playbackYamit Mehta2015-10-061-0/+13
| | | | | | | | | | | | | | | | | | | | | 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
* Using centralized isAudioPlaybackRateValid to validate parametersRicardo Garcia2015-06-221-7/+3
| | | | | | | Centralized validation code bug: 20701446 Change-Id: I9d9941c7639c05b2afe069ff4f858c693c910bfe
* Improve volume input check for AudioMixerAndy Hung2015-05-211-23/+88
| | | | Change-Id: I5b656b123847529f2b76af2a68bd4e9b691882f4
* Merge "Update sampling rate to 192kHz for devices" into mnc-devAndy Hung2015-05-121-4/+3
|\
| * Update sampling rate to 192kHz for devicesAndy Hung2015-05-121-4/+3
| | | | | | | | Change-Id: I0a83206be51d7ae18ccf85b94b2127356307be69
* | AudioMixer: fix for volume ramp in float modeEric Laurent2015-05-081-1/+2
|/ | | | | | Bug: 20912450. Bug: 19952126. Change-Id: I1ff3c3f4c0dd673bbbc17ce8da14d446fdb7e8a8
* Merge "Fix single channel playback that does not use AUDIO_CHANNEL_OUT_MONO"Andy Hung2015-04-221-2/+3
|\
| * Fix single channel playback that does not use AUDIO_CHANNEL_OUT_MONOAndy Hung2015-04-211-2/+3
| | | | | | | | | | | | | | | | Mono channel playback without resampling and not using AUDIO_CHANNEL_OUT_MONO can show low frequency garbling. Bug: 20463456 Change-Id: I0c1bbf957ea439bb8d8da57b9e78938e1acb4793
* | Use AudioPlaybackRate to hold TimestretchBufferProvider parametersRicardo Garcia2015-04-221-20/+26
|/ | | | | | | | 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 AudioMixerAndy Hung2015-04-091-1/+56
| | | | | Bug: 19196501 Change-Id: I42d1f90e6297cf3f1304860d1691a5dfedd4c37d
* Factor out buffer provider code from AudioMixerAndy Hung2015-04-081-320/+1
| | | | | | | In preparation for playback rate support and timestretching. Bug: 19196501 Change-Id: I435accb852d32110dd0b3a9917488522c567ba80
* Merge "Enable full floating point path in AudioMixer"Andy Hung2015-03-201-3/+3
|\
| * Enable full floating point path in AudioMixerAndy Hung2014-11-071-3/+3
| | | | | | | | Change-Id: I7becce859d6e8db413e6a7c3193ae0f2af273599
* | Remove redundant semicolon from namespace closingGlenn Kasten2015-03-031-1/+1
| | | | | | | | Change-Id: I163f9d3d216c283ae1160ce4802e5247cf44fba7
* | Add channel index mask to AudioMixerAndy Hung2015-02-271-6/+44
|/ | | | Change-Id: Ifbcb61cc24111b7efab5e8d119d44dab26ba1778
* Fix AudioMixer floating interaction with downmixerAndy Hung2014-11-071-18/+50
| | | | | | | | | | | | | | | Previously _if_ the full floating point mixer is enabled, a downmixer would force the mixer input for a session submix to integer, breaking other mixer inputs to the same submix that were in float. Use another ReformatBufferProvider after the downmixer to solve this issue. Update the test-mixer app and the mixer_to_wave_tests shell script to detect this issue. Bug: 17363939 Change-Id: I74a56333f9ee75ddde39a75392c021c5eebddbef
* Move AudioMixer buffer provider preparation into trackAndy Hung2014-11-071-66/+60
| | | | | Bug: 17363939 Change-Id: I1f0f597b008f7369df87ba369fabaa93dec08ea1
* Fix AudioMixer MONO muted track handlingAndy Hung2014-08-251-5/+21
| | | | | | | | Incorrect handling caused "stereo" mode to be used. Augmented error handling to print more debug info. Bug: 17208475 Change-Id: I5bcaf0ba5bd5a4f7d4885f8cce43bbf42e5f1e6b
* Remove unused TwoTrack process mode from AudioMixerAndy Hung2014-08-041-103/+0
| | | | | | Legacy code that has not been hooked up. Change-Id: Ic01a4eddfa1020089d5bc42f58b6a4697698c27a
* Add multichannel capability to AudioFlingerAndy Hung2014-07-241-1/+4
| | | | | | But not enabled (kEnableExtendedChannels == false). Change-Id: I62f7e31fbd29ad703a9a02f5d1a280b6972dd423
* Add multichannel capability to AudioMixerAndy Hung2014-07-241-131/+298
| | | | | | | | tests/test-mixer updated to handle multichannel. New mixer path is still disabled (kUseNewMixer = false). Subsequent CL will enable multichannel capability. Change-Id: I71dafa94cc1d9af567c285e0ded7c5c94e3ff926
* Add RemixBufferProvider to AudioMixerAndy Hung2014-07-181-0/+34
| | | | | | | This is used to convert between channel masks for input AudioTrack data. Change-Id: Iedffaeccb99c7053992152e7b1cb6b2d33b12eef
* Update DownmixerBufferProvider to use CopyBufferProviderAndy Hung2014-07-181-144/+143
| | | | Change-Id: I6b1a8755a1e6c29b916662fd376e9509cda5df55
* Add CopyBufferProvider class for AudioMixerAndy Hung2014-07-181-86/+112
| | | | | | | | AudioMixer::ReformatBufferProvider now uses it as a base class. Fix ReformatBufferProvider object leak. Change-Id: If196f844eaaa124a173ffa27afe88098023c2ff9
* Add floating point volume handling to AudioMixerAndy Hung2014-07-081-70/+172
| | | | | | | | | | | | | | | 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-13/+1
| | | | | | | | 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 new AudioMixer processing hooksAndy Hung2014-06-301-44/+364
| | | | | | | | This change adds new process and thread hooks for multi-format handling. It is enabled by setting kUseNewMixer = true. Change-Id: I262a3d2e4411f8cef7370a497b77a34eb55f1f86
* Change parameter type for volume to float in AudioMixerAndy Hung2014-05-301-6/+14
| | | | Change-Id: I4da1505ce852505f86f8e5b87f60e8edceeb30e0
* Rename UNITY_GAIN to UNITY_GAIN_INT in AudioMixerAndy Hung2014-05-301-5/+5
| | | | Change-Id: Ic040311305026f0b4c4280a5b3bef7a447ac1da3
* Refactor setVolumeRampVariables in AudioMixerAndy Hung2014-05-301-30/+42
| | | | Change-Id: I8fcf3101bcea292de7c65433fa578f1c9cdd0974
* Fix floating point output from mixerAndy Hung2014-05-301-6/+7
| | | | | | | | | A buffer pointer was being erroneously reset to buffer start, potentially causing an audio glitch. The floating point output mode is not enabled at this time, but will be in the future. Change-Id: If8b6414d232f064f3a2e2c5a6da889a91b27fb24
* Avoid resetting BufferProviders in mixer unnecessarilyAndy Hung2014-05-291-0/+3
| | | | Change-Id: Iad85c4dfd21be1dbf89dc11906106b34219376f8
* Add multiple format capability to AudioMixerAndy Hung2014-05-231-26/+167
| | | | | Change-Id: I04ac1cafd90b6ed652f8d51888ad07576678f0bc Signed-off-by: Andy Hung <hunga@google.com>
* Add format parameter to getTrackName() and track_tAndy Hung2014-05-191-2/+7
| | | | | Change-Id: Ia152a839014e235fbfb656104c15d7c1b456d02e Signed-off-by: Andy Hung <hunga@google.com>
* Update AudioMixer::getTrackName to save channelMaskAndy Hung2014-05-161-7/+8
| | | | | Change-Id: I4fb4abbff1b05bdd0f6e21b5f5f4c3f2a57ae28d Signed-off-by: Andy Hung <hunga@google.com>
* Use new channel count functions for audio masksAndy Hung2014-05-161-2/+2
| | | | | Change-Id: Ia658ab4b6320d19fdb50f123c930918724ff0ef3 Signed-off-by: Andy Hung <hunga@google.com>
* Change references of Q19.12 to Q4.27 for clarityAndy Hung2014-04-021-4/+4
| | | | | Change-Id: I5beb7daf6ff9bc123ff3582f7c294edcaf8652f6 Signed-off-by: Andy Hung <hunga@google.com>
* Use LOG_ALWAYS_FATAL instead of LOG_FATALGlenn Kasten2014-03-261-4/+4
| | | | | | | LOG_FATAL is compiled out in most builds, so the assertion checks were not being performed. Change-Id: I774f0985ab9c5ccecd8989a0f1c940386b73fc35
* Rename mSinkFormat to mMixerFormat for AudioMixer::track_tAndy Hung2014-03-011-12/+12
| | | | | | | AudioMixer::SINK_FORMAT also changes to AudioMixer::MIXER_FORMAT Change-Id: Ic3f8be77d2c75c082c4fd140bc907e30c304d285 Signed-off-by: Andy Hung <hunga@google.com>
* Use float_from_q19_12 conversion in AudioMixerAndy Hung2014-02-281-3/+4
| | | | | Change-Id: Idbe84fb9610c7e636a84468f2e2402a913435ca9 Signed-off-by: Andy Hung <hunga@google.com>
* Add Track Sink Format to AudioMixerAndy Hung2014-02-261-22/+68
| | | | | | | | | Track Sink Format now allows both AUDIO_FORMAT_PCM_FLOAT and AUDIO_FORMAT_PCM_16_BIT (default). The float case is not enabled now. Change-Id: Ibee70cab4725c8bc9905e49f1f9a9c2448f76e00 Signed-off-by: Andy Hung <hunga@google.com>
* resolved conflicts for merge of 566be7c3 to masterNarayan Kamath2014-02-111-3/+4
|\ | | | | | | Change-Id: I7b1cc71057b2bd4f771e7bcf508a8c3abd6017ce
| * Make frameworks/av 64-bit compatibleKévin PETIT2014-02-111-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Enable new dynamic audio resampler as defaultAndy Hung2014-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge "Remove warnings in Audio mixer resampler compilation."Andy Hung2014-01-301-7/+7
|\ \
| * | Remove warnings in Audio mixer resampler compilation.Andy Hung2014-01-291-7/+7
| | | | | | | | | | | | | | | Change-Id: Ie68766142796772a54a90afdea188d0a5a78d4ac Signed-off-by: Andy Hung <hunga@google.com>