210 Commits

Author SHA1 Message Date
Steve Block
ec193dec4d Rename LOG_ASSERT to ALOG_ASSERT DO NOT MERGE
See https://android-git.corp.google.com/g/157519

Bug: 5449033
Change-Id: I8ceb2dba1b031a0fd68d15d146960d9ced62bbf3
2012-01-09 21:36:22 +00:00
Glenn Kasten
4e7191448d Merge "By convention const goes before the type specifier" 2012-01-09 11:59:17 -08:00
Glenn Kasten
26f260a167 Use cached reference to media.player service
This save unnecessary binder calls

Change-Id: I93a60efc54d9c8fb8fab706cd4477bbfd00ffec8
2012-01-09 11:57:07 -08:00
Glenn Kasten
07d7d5a22d Merge "Replace loop by __builtin_ctz" 2012-01-09 10:25:00 -08:00
Glenn Kasten
f5c491651f Merge "suspended() and isSuspended() are const" 2012-01-09 10:24:09 -08:00
Steve Block
3762c31172 Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
2012-01-08 13:19:13 +00:00
Glenn Kasten
99c2fd36dc By convention const goes before the type specifier
Change-Id: I70203abd6a6f54e5bd9f1412800cc01212157e58
2012-01-06 08:00:59 -08:00
Steve Block
8564c8da81 Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
2012-01-06 10:07:54 +00:00
Glenn Kasten
c1d810d1d0 Replace loop by __builtin_ctz
Using the builtin is faster on some platforms, for example on ARM it's
19 instructions instead of 13, and is O(1) instead of O(n).  Of course,
track creation is an inherently slow operation, so this doesn't matter
much now.  But if we add support for virtual tracks, then physical tracks
will be allocated/freed more frequently.  Also just on principle ...

Change-Id: I3f590934092bd7a1869cbedbc7357928aa5cc8ff
2012-01-05 15:31:19 -08:00
Steve Block
bd47cac4df Merge "Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE" 2012-01-05 14:07:02 -08:00
Glenn Kasten
1dce841996 suspended() and isSuspended() are const
Change-Id: I04b95970b5a645b64e7e64fffd46d868354dda66
2012-01-05 10:51:02 -08:00
Glenn Kasten
6b14d58580 Merge "Remove the notion of "active track" from mixer" 2012-01-05 08:20:10 -08:00
Glenn Kasten
a8719ad9d5 Merge "Use the standard CC_LIKELY and CC_UNLIKELY macros" 2012-01-05 07:38:29 -08:00
Glenn Kasten
e80a4ccd2b Use the standard CC_LIKELY and CC_UNLIKELY macros
Several source files privately defined macros LIKELY and UNLIKELY in terms
of __builtin_expect. But <cutils/compiler.h> already has CC_LIKELY and
CC_UNLIKELY which are intended for this purpose.  So rename the private
uses to use the standard names.

In addition, AudioFlinger was relying on the macro expanding to extra ( ).

Change-Id: I2494e087a0c0cac0ac998335f5e9c8ad02955873
2012-01-05 07:33:45 -08:00
Eric Laurent
dc8627e7dc resolved conflicts for merge of 1a4b9939 to master
Change-Id: I0c910d391a38a916d8431f7d1f5b82e39e1a66c2
2012-01-04 17:39:12 -08:00
Steve Block
6215d3ff4b Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
2012-01-04 20:05:49 +00:00
Steve Block
5baa3a62a9 Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
2012-01-03 22:38:27 +00:00
Eric Laurent
72dafb20e0 audioflinger: fix clicks on 48kHz audio.
The calculation done in prepareTracks_l() for the minimum amount
off frames needed to mix one output buffer had 2 issues:
- the additional sample needed for interpolation was not included
- the fact that the resampler does not acknowledge the frames consumed
immediately after each mixing round but only once all frames requested have been used
was not taken into account.
Thus the number of frames available in track buffer could be considered sufficient although
it was not and the resampler would abort producing a short silence perceived as a click.

Issue 5727099.

Change-Id: I7419847a7474c7d9f9170bedd0a636132262142c
2011-12-22 16:08:41 -08:00
Glenn Kasten
68deb15a2b Remove the notion of "active track" from mixer
This is a first step towards making the mixer more object-oriented.

Change-Id: Ifd445d0e471023a7f5c82e934736ffc95ba1b05b
2011-12-20 16:29:21 -08:00
Glenn Kasten
bdb0cee0ef Merge "Remove dead code" 2011-12-20 10:29:49 -08:00
Eric Laurent
0ca16d6ba6 Merge "audio effects: rename configure command" 2011-12-19 17:26:24 -08:00
Eric Laurent
4abf88244b audio effects: rename configure command
Renamed audio effect library interface command for audio format
configuration from EFFECT_CMD_CONFIGURE to EFFECT_CMD_SET_CONFIG.
This makes the naming more consistent with other exixsting commands
and allow adding a new command to get the configuration (EFFECT_CMD_GET_CONFIG).
Same change for reverse channel configuration renamed from
EFFECT_CMD_CONFIGURE_REVERSE to EFFECT_CMD_SET_CONFIG_REVERSE.

Implemented EFFECT_CMD_GET_CONFIG in exisitng effect libraries.

Change-Id: Ia7b1c620f13797fe5aceb3b0b4acbacce09fb067
2011-12-19 17:08:31 -08:00
Glenn Kasten
31ba2e5541 Remove dead code
Change-Id: Icf23f7f90fdeb660f4015f22cf239e6d05f5d03c
2011-12-19 15:55:47 -08:00
Glenn Kasten
279f872167 Merge "Use constants for 2 and 32" 2011-12-16 15:10:36 -08:00
Glenn Kasten
d9de2d21ef Merge "Extract out audio DSP code to utility library" 2011-12-16 15:02:30 -08:00
Glenn Kasten
1f6f05da93 Use constants for 2 and 32
Change-Id: If820dfd58b6df258570750610a07af99598d9e53
2011-12-16 14:55:05 -08:00
Glenn Kasten
586995afe6 Merge "Use switch in AudioMixer::setParameter" 2011-12-16 13:31:33 -08:00
Glenn Kasten
bde164abbc Use switch in AudioMixer::setParameter
Replace series of if/then/elses by easier-to-read switch.  Also return
void instead of status_t, since callers weren't checking it. Assert on
bad input parameters.

Change-Id: Ie1f0a297977b28501d20e1af819afed9b4750616
2011-12-16 13:28:33 -08:00
Glenn Kasten
b371925125 deleteTrackName now asserts on bad input parameter
This is safe, as the input parameter is always track->name(),
which must be valid.

Change-Id: Iea8ea3a5706c27026335526ba8851030d00681f8
2011-12-16 13:22:41 -08:00
Glenn Kasten
490909d2c0 Extract out audio DSP code to utility library
Change-Id: Ib8ce72028a7ea30e82baa518e381370e820ebbd0
2011-12-16 11:42:03 -08:00
Glenn Kasten
f96272c3cd Merge "setActiveTrack and setBufferProvider can't fail" 2011-12-16 07:30:14 -08:00
Glenn Kasten
844756be54 Merge "Simplify enable/disable mixing" 2011-12-16 07:29:57 -08:00
Glenn Kasten
cf45596da3 Merge "Improve resistance to leaks for ConfigEvent" 2011-12-15 16:17:04 -08:00
Glenn Kasten
2efd1184f9 Merge "Use NULL not 0 for pointers" 2011-12-15 16:16:55 -08:00
Glenn Kasten
afb40b5fcf setActiveTrack and setBufferProvider can't fail
Return void, not status_t, from setActiveTrack and setBufferProvider.

These methods returned status_t, but the callers never checked the
return value.  Since these aren't externally visible APIs, they now
return void, and assert on bad input parameters.

Change-Id: I530ed29484596ae41e8659826ca425149c51c2a1
2011-12-15 15:55:51 -08:00
Glenn Kasten
af62dbca02 Simplify enable/disable mixing
The MIXING enum isn't needed, and now returns void instead of status_t.

Change-Id: Ibe4ec24081d75ad4ab78b9c7191fc9077959c4e9
2011-12-15 15:00:28 -08:00
Glenn Kasten
4b220f0a7b Improve resistance to leaks for ConfigEvent
A Vector of pointers is risky, as there is no ownership (and the
ThreadBase destructor was not deleting them, so if there were any left
over at end it would leak).  Replaced by a Vector of values.

Change-Id: Iddde72dc30134adfcf724dec26cbe0a742509b8c
2011-12-15 12:51:52 -08:00
Glenn Kasten
c434c90cc2 Use NULL not 0 for pointers
Change-Id: Iab3f9abbdab617dc5a599e657ec46a0b0a002eef
2011-12-15 09:18:17 -08:00
Glenn Kasten
25adf47477 Merge "Fix indentation and whitespace" 2011-12-14 17:35:36 -08:00
Glenn Kasten
927cc6c7e8 Merge "Improve AudioFlinger error logging" 2011-12-14 17:35:24 -08:00
Glenn Kasten
a55d4f9dab Merge "AudioMixer uninitialized simple fields" 2011-12-14 17:35:14 -08:00
Glenn Kasten
a763b44ee1 AudioMixer uninitialized simple fields
Change-Id: I47e3849f048d4d990c9634f9c8a2ca2de0339e93
2011-12-14 17:25:28 -08:00
Glenn Kasten
9818a9da59 Improve AudioFlinger error logging
Change-Id: I8ce9aff4038cd7fa0067600faa8080b137db1939
2011-12-14 17:22:40 -08:00
Glenn Kasten
da7923ac29 Merge "Audio C++ comments" 2011-12-14 16:56:31 -08:00
Glenn Kasten
fb2ab9efc3 Fix indentation and whitespace
Use git diff -w to verify.

Change-Id: Ib65be0a1ecf65d6cad516110604e3855bf68a638
2011-12-14 16:54:05 -08:00
Glenn Kasten
3e62a5bd8c Merge "Use const char correctly in AudioFlinger" 2011-12-14 15:40:35 -08:00
Glenn Kasten
478e37d60c Merge "Use units after all times" 2011-12-14 15:40:27 -08:00
Glenn Kasten
46f54359b6 Merge "Remove redundant clear()" 2011-12-14 15:40:01 -08:00
Glenn Kasten
e5fb263a36 Audio C++ comments
Change-Id: I84906ebb9dfcfa5b96b287d18364b407f02a30c1
2011-12-14 14:38:26 -08:00
Glenn Kasten
778170d705 Fix includes
Remove unused #include dlfcn.h

Add #include String8.h
Forward class declaration is only for references and pointers.
In this case, we need the full class declaration,
and were incorrectly depending on another header file to do it.

Change-Id: Iff65cceb3982698cc1ebaeec405695fc190c03ff
2011-12-14 13:33:51 -08:00