History log of /system/media/opensles/libopensles/COutputMix.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
227b8b5fe36d5385bbb23d63198bc8e72bfda5d3 15-Oct-2010 Glenn Kasten <gkasten@google.com> Fix bug 3101211, partial fix for bug 3101247

IEngine.c: fixed numerous problems found by API test in
Engine::QueryNumSupportedExtensions
Engine::QuerySupportedExtension
Engine::IsExtensionSupported

sles.c:
failed engine create due to resource error did not return correct value

locks.c:
The mutex lock log usually indicates there is a deadlock. However,
it can also happen when there is heavy lock contention, such as
during the multithread torture test. Since it may be may be normal
behavior, I downgraded this log to a warning.

CEngine.c, ThreadPool.h, sles_allinclusive.h, sync.c, Android.mk:
Thread torture test was crashing on all platforms. Partial fix for Android:
- disable sync thread on Android
- disable async realize and async add interface on Android as they are not well tested

COutputMix.c:
Multiple output mixes were incorrectly handled on desktop. The
changed lines are under a non-Android conditional, so don't affect
production builds. But they are necessary in order to develop the
multithread torture test and measure code coverage using it.

Change-Id: I9003e97e0f84d9dc106622b0c925384c8ed61a7e
/system/media/opensles/libopensles/COutputMix.c
51cb31b09f6af53402b3fbe7e9de29badc1155a2 21-Sep-2010 Glenn Kasten <gkasten@google.com> As part of API review, disable incomplete profiles

Don't compile dead code relating to unsupported features, but keep profiles for CT.
Move whole file conditionals from the source code to Android.mk,
by just not compiling the module for unsupported features.
There must an interface initialization hook present to expose an
interface implicitly or explicitly at object creation time, or
to dynamically add an interface after the object is created. As
a safety check, we also double-check for the initialization hook
when the application does a GetInterface.

Miscellaneous bug fixes:
- Fix warning "variable may be used uninitialized in this function".
- Fix build errors on SDL.
- Was using the wrong conditional for SDL.
- Fix typo mInterfaceContinued -> mInterfaceStates2 in AudioRecorder.
- Fix typo in IEngineCapabilities_init.

Other cleanup:
- Move ugly SDL-specific stuff out of the portable code.
- Combine duplicated code in CAudioPlayerDestroy and
CAudioRecorder_Destroy for freeing buffer queue memory.
- Add curlies to if and do statements.
- Line length 100.
- Decrease engine voices from 32 to 30 (based on max of 32 objects, 1 engine, 1 output mix).
- Disable IRecord_init log.
- Add symbolic link for Android configuration header file.
- Enable trace on Android.
- sl_int64_t is now unconditionally defined rather than only if
ANDROID defined, because it is used by OpenSLES_Android.h which
might be included by SDL also.
- Removed symlink for Android headers

Change-Id: I1a6389257bca09e3819923129a1193473e16669b
/system/media/opensles/libopensles/COutputMix.c
31df22b193ea7c7c331d26a27fa6756a89c8ec3c 17-Sep-2010 Glenn Kasten <gkasten@google.com> Improve reliability of Object::Destroy / Create

Separated object construction from publishing, for better safety
with respect to the sync and debugger thread. Unpublished objects
exist and have an ID slot reserved, but the ID is not assigned.
Destroy of an unpublished object does the right thing.

Add pre-destroy checks:

- COutputMix all platforms: add check for players attached to
output mix. Object:: Destroy on an output mix that has at least
one attached player is a no-op, but will log an error.

- COutputMix for SDL: now asks the mixer callback to unlink output
mix from engine, and then blocks until SDL mixer callback
acknowledges the request; this avoids a race condition where the
SDL thread calls the mixer during destroy.

- C3DGroup: add check for players in group.
Object::Destroy on a 3D group that contains at least one player
is a no-op, but will log an error.

Object::Destroy on an audio player that is part of a 3D group now
removes the player from the 3D group during destroy.

Remove redundant field:

- CAudioPlayer.mOutputMix duplicated a field in DataSink.DataLocator_OutputMix;
removed mOutputMix and replaced by function CAudioPlayer_GetOutputMix
which gets the output mix from the data sink.

Remove dead code:

- IOutputMixExt_Destroy was obsolete.

Miscellaneous changes not related to destroy:
- Fixed an ancient bug in the class table for Listener object -
was using wrong offset for interfaces.
- Add curly braces around if, else, for bodies
- Add parentheses around complex conditionals
- Add some logging
- Fix indentation.
- Line length 100

Change-Id: I0035fe356e2a28c1932b5d265f881377aa77dc58
/system/media/opensles/libopensles/COutputMix.c
4f924ff768d761f53db6fa2dbfb794ba7a65e776 10-Sep-2010 Glenn Kasten <gkasten@google.com> Fix some race conditions and deadlocks.

Use strong reference counts to fix race conditions in these object dependencies:
- audio player on 3D Grouping
- MIDI player (or more specifically, the data sink locator) depends on LED or Vibra device
- audio player (or more specifically, the data sink locator) depends on output mix
Fix build errors on non-Android platforms.
Fix incorrect result code for EnvironmentalReverb::SetDensity.
Continue work on making Destroy more reliable:
- Destroy calls a pre-destroy hook, e.g. for Android audio players.
- Add new internal object state DESTROYING which is set when the pre-destroy hook returns.
- Abort (called by Destroy) now blocks until all async operations complete or are aborted.
Add curly braces around simple if and for statements.
Add extra parentheses around complex if expression in if statements.
Add more error logging in checkDataLocator.
Add Doxygen comments.
Remove spurious log entry when SL_DATALOCATOR_ANDROIDFD used.
Disable the unused Resume hooks, which are currently unused.
Remove some dead code in audio player create for Android.
Line length 100.
Prepare for fixing race condition in OutputMixExt by
moving mActiveMask and mTracks from IOutputMix to IOutputMixExt.
Update comments.
Continued work on Destroy reliability:
Do not poke around in mixer's data structures directly during
Object::Destroy for an audio player; instead ask the mixer nicely
and wait for it to do the job.
Move master copy of computed gains from Track to AudioPlayer, and then
let the mixer copy the gains locally when it needs them.
Add resume and predestroy hooks everywhere.
Predestroy hook returns a boolean.
/system/media/opensles/libopensles/COutputMix.c
dc098b54cd7df1b79b4560ae0570d88e4b9f751e 30-Aug-2010 Jean-Michel Trivi <jmtrivi@google.com> Add support for auxiliary effects.

- Implement the OutputMix object.

- Modify the interface of the Android effect initialization since
an effect can be attached to a player (insert) or to an OuputMix
(aux)
- fix bug in EQ where SL_RESULT_CONTROL_LOST was returned on a
properly initialized EQ effect.

- Add a test application which creates an EQ on an OutputMix
- Remove unused constant in test apps.

Change-Id: Id9e4633d0e44e8a784f1154ce1a6df1357b72966
/system/media/opensles/libopensles/COutputMix.c