Extend MONO_HACK to multi-channel output.
Mono track will have only one channel output on multi-channel devices.
Since ARC++ exposed a 4-channel output device and downmix track in
ChromeOS, we need to add this feature to support mono track sample
expansion.
Add support for both re-sample and non-resample path.
For resample path, we need to add MIXTYPE_STEREOEXPAND in
AudioMixerOps.h since AudioResampler will upmix mono track to stereo
track.
Bug: 120222604
Bug: 112341269
Bug: 117116052
Bug: crbug.com/890560
Test: Play mono tracks without re-sampling on ARC++
Test: Play mono tracks with re-sampling on ARC++
Test: Play normal stereo tracks on ARC++
(cherry picked from commit 9b79e0752e6536c31430aa31838a9de1b7b56f9f)
Change-Id: I51f5914c41dd0196db9c6a2e1a99b44e5d87c0d6
Split AudioMixer into the base part which doesn't rely on
the framework and can be used in vendor code and the derived part
which is intended to be used by Audioflinger.
Test: A/B compare output from test scripts, manual testing on the phone
Change-Id: I24c390f67f20baa8109902099359ca6e34eebcfd
Combine adjust channels buffer provider and adjust channels non-destructive
buffer provider.
When contracting mono + haptic channels to mono, do not use
adjust_channels to avoid mixing haptic channel into audio channel.
Bug: 125915810
Test: play audio-haptic coupled files
Change-Id: I39916a3e0628a44ed4a148c265564af7135a2176
Use the same logic in VibrationEffect.scale to control the intensity of
haptic playback in audio framework. Note that as the maximum amplitude
of vibrator is 255, convert the haptic data to pcm_8_bit before doing
scaling.
Test: Manually
Change-Id: I6136d27c9255a215834b6e3092aa8ad696fbae04
When trying to play with haptic channel mask, use adjust channels
buffer provider to make the haptic channel the same as the output one.
If haptic playback is supported, use adjust channel non destructive
buffer provider to output haptic data to the end of the sink buffer.
Otherwise, haptic data will be ignored.
Test: Manually
Bug: 111454766
Change-Id: Ic5f780de48c1e71de6ba5c4774d1ed2e9c8c51a0
1. Add adjust channels buffer provider, which will expand or contract
sample data from one interleaved channel format to another. Expanded
channels are filled with zeros and put at the end of each frames.
Contracted channels are omitted from the end of each audio frame.
2. Add adjust channels non destructive buffer provider, which could
expand or contract sample data from one interleaved channel format to
another while not destructing the buffer. Extra expanded channels are
interleaved in from the end of the input buffer. Contracted channels are
copied to the end of the output buffer. Contracted channels could be
written to an output buffer with certain audio format.
Test: Manually
Bug: 111454766
Change-Id: I3f963307e73b3f7aa662d4127f78f0c61ac84510
Error found with clang static analyzer after
making ALOGV_IF to use its parameters.
Bug: 111850071
Test: build with WITH_TIDY
Change-Id: I35bdfd6583a106d82f30063cbd629bcff1d58289
the Resampler is recreated only if mixer channel count has changed.
I removed the criteria since resampler need recreation when
track channel count has changed.
This issue is due to the previous resampler still working with
the previous channel mask settings.
Test: self-tested more then 50 times when a voice call ended
and there is an incoming Skype/LINE ringtone.
Bug: 78199280
Change-Id: I042fb9214d07f198704cef3c96bf290c7d203461
Always prepareForReformat() when channelmask has changed,
no matter needing a downmix or not.
Since ReformatBufferProvider would need to reset when
channelmask has changed.
Test: self-tested more then 50 times when a voice call ended
and there is an incoming Skype/LINE ringtone.
Bug: 78199280
Test: bug is fixed.
Change-Id: I08c74b00fcbaf8aacef7b1d1c1e840cae347accb
Signed-off-by: Yung Ti Su <andysu@google.com>
For security reason, float buffers provided by application must be
clamped to FLOAT_NOMINAL_RANGE_HEADROOM.
With the new all float pipeline, float are no longer clamped by their
conversion to fixed point.
This patch adds a float buffer provider that clamps float samples
as they are copied to audio pipeline.
Test: Play music, play video in chrome (opensles format float),
play float pcm audio file specially crafter with >> 1 samples.
Bug: 68099072
Change-Id: I220b436d9982bc43a75715a030efd0e6a0c79fa3
Signed-off-by: Kevin Rocard <krocard@google.com>
As part of change:
Remove track name offset by TRACK0.
Move track name management to the Tracks class.
Sync mixer track name to FastMixer track index.
Fixes regression introduced by commit 8ed196a.
Test: SoundPool, AudioTrack CTS, Usability
Bug: 72937362
Bug: 73004420
Change-Id: I2f1a33f6f0da66bcd7aa91e2a4b663ff822df645
Client apps can have 40 tracks, up from 14 tracks
Related code cleanup:
a) Removed State nested class
b) Moved static functions to Track member functions
c) Moved static function hooks to pointer-to-member-function hooks
d) Some reorganization of touched code for recent C++ style
Test: test-mixer native mixer test
Test: SoloTester effect test
Test: SoundPool with many tracks
Test: CTS AudioTrackTest
Bug: 64161002
Change-Id: I0d09620acd715d577e776bb6f76e94e87e554520
When the desired number of frames is not a multipler of blocksize,
process__genericNoResampling will ask for 0 frames and crash.
Fix it.
BUG: 70902559
Test: cts-tradefed run cts -m CtsMediaTestCases -t
android.media.cts.AudioTrackLatencyTest#testOutputLowLatency
Change-Id: Id2ce771ee8a4e49fe6ea82e500017324c8918a73
(cherry picked from commit e38b72e410def6c44f090d149879cb620fcc7955)
Reset mPostDownmixReformatBufferProvider before changing
downmixerBufferProvider.
Test: Play Music with multichannel files
Bug: 27526910
Change-Id: I5803e169cb9da4e7681bc8caf1452e79e5a4d1d5