summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Bug 3388299 Fix stack buffer overruncm-7.1.0gingerbread-releasegingerbreadgb-release-7.2Glenn Kasten2011-01-261-3/+5
| | | | Change-Id: Ie8c525ddee862b32f2055cb89c10a680f0c14f97
* Merge "Bug 3326605: AudioRecorder uses wrong channel mask" into gingerbreadGlenn Kasten2011-01-233-3/+13
|\
| * Bug 3326605: AudioRecorder uses wrong channel maskGlenn Kasten2011-01-223-3/+13
| | | | | | | | Change-Id: I2121211b0202bc39100d74232d63be94c7e8a8de
* | Bug 3360707Glenn Kasten2011-01-221-1/+1
|/ | | | Change-Id: Ib40d8813ac713d09ed7b298521fada1a35ecb1d4
* Merge "Fix bug 3112893 in handling of container size" into gingerbreadGlenn Kasten2010-10-221-10/+6
|\
| * Fix bug 3112893 in handling of container sizeGlenn Kasten2010-10-221-10/+6
| | | | | | | | Change-Id: Iafa1f823351e5849501ffc613f06940be27e9c6b
* | Merge "Bug 3101247 - move track ownership" into gingerbreadGlenn Kasten2010-10-222-7/+31
|\ \
| * | Bug 3101247 - move track ownershipGlenn Kasten2010-10-222-7/+31
| | | | | | | | | | | | | | | | | | Preliminary fix for torture test failure - move track ownership Change-Id: I4c9de6a85cc0bd594f16bdb1a5de61f5f268cfdb
* | | Bug 3102561 - Tests onlyGlenn Kasten2010-10-228-30/+1061
|/ / | | | | | | | | | | | | | | | | | | Make the multi-thread test more stressful, to crash more often. New tests: playbq, srcsink, monkey. In monkey, re-enable destroy at difficult times. Add support for testing player insert reverb to the reverb test. Note: building playbq is disabled by default because it needs libsndfile. Change-Id: I592ea5f567bddc61174e7d41bc5b36ce32d2b6b8
* / Bug# 3111274 - Dump raw audio to file for automated audio quality analysisAdam Momtaz2010-10-193-2/+43
|/ | | | | | | | | This change is compiled for userdebug builds only. The change enables raw audio capture of transcoded music. The capture is written to file and used for audio quality analysis against the source audio. This capture feature is OFF by default even for userdebug builds and requires setting a system property to enable it. Change-Id: I6d895a2fe3ef9741fea490fe2513404a50c4d4b7
* Fix bug 3106530 Don't report unhandled AudioTrack events as errorsJean-Michel Trivi2010-10-181-0/+3
| | | | | | | | Unhandled AudioTrack events were reported as errors, which is a bug. Added case for EVENT_BUFFER_END and EVENT_LOOP_END. This covers all events an AudioTrack is expected to generate. Change-Id: I9ee067f3d42c1d545286001a5702bc606233df9d
* Merge "Fix bug 3101835 - play state crash" into gingerbreadGlenn Kasten2010-10-151-0/+4
|\
| * Fix bug 3101835 - play state crashGlenn Kasten2010-10-151-0/+4
| | | | | | | | | | | | | | If a prefetch fails due to invalid data source, then the application sets play state to PLAYING, it used to crash. Change-Id: Iaba98c596005715ca6c057de543fa0921225e74c
* | Bug 3102561 - Tests and examples onlyGlenn Kasten2010-10-1517-139/+728
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note: the modifications in directory libopensles aid testing, but have no affect on production builds because they are related to tracing, which is is disabled by default. Update feedback test to be more reliable. Update slesTestPlayUri to exit on prefetch error. Clean up error and termination handling. Add comment to record test on how to use it. Reduce global symbol dependencies when trace is enabled. Split OpenSLESUT into two files: part that uses printf, and another part that doesn't. Add SL_RESULT_ prefix to result strings. slesutResultToString returns NULL for unknown value. Add multithread torture test. Compile stream test for non-Android as a no-op. Improve API test coverage. Enable assertion checks on test programs. Change-Id: I6b82026cfa19d2f08cda4c11137e0706e8ff4b8c
* | Fix bug 3101211, partial fix for bug 3101247Glenn Kasten2010-10-159-40/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Bug 3102561 - Clean up reverb test" into gingerbreadGlenn Kasten2010-10-151-35/+66
|\ \
| * | Bug 3102561 - Clean up reverb testGlenn Kasten2010-10-151-35/+66
| |/ | | | | | | Change-Id: If573c06134810eafd4d41efeb938fa23ae77c2da
* / Include the framework copy of the OpenMAX headers instead of referencing ↵Andreas Huber2010-10-151-1/+1
|/ | | | | | | external/opencore. Change-Id: I935b8f2851f4bfc244178131acaa913377efa1c2 related-to-bug: 3101573
* Fix bug 3094729 Support AAC+ in OpenSL ESJean-Michel Trivi2010-10-133-15/+100
| | | | | | | | | | | | | | | When playing an AAC+ stream, StageFright will report a change of configuration in the stream between the prepare phase and the start of the playback. The fix consists in retrieving the new configuration in SfPlayer, create a new AudioTrack with the new parameters, and notify AudioPlayer that SfPlayer has a new AudioTrack to use. AudioPlayer will then delete its current AudioTrack, and use the new one from SfPlayer, after configuring it with the current AudioPlayer settings. Change-Id: I23e3ecb2c144b7c4eefae7a970581695545982d4
* Merge "Make log less noisy" into gingerbreadGlenn Kasten2010-10-132-14/+13
|\
| * Make log less noisyGlenn Kasten2010-10-122-14/+13
| | | | | | | | Change-Id: I6a7cb4c8bfca51eae71fb312b8ff43ce663a4c11
* | Fix bug 3090610 Report an error on AAC+Jean-Michel Trivi2010-10-121-2/+4
|/ | | | | | | | Notify an error occured during prefetching when StageFright reports that a read error was encountered (other than EOS), and stop playback. Change-Id: I0c00ee76b148bd80a26679648322633d6e5533da
* Enable aux effect attachment before the AudioTrack creation.Jean-Michel Trivi2010-10-124-2/+34
| | | | | | | | | | | | | | | | | | When an OpenSL ES AudioPlayer is playing content from a URI or FD, the AudioTrack it plays on is only created once prefetching is far along enough that the playback properties are known (channel count, word size and sample rate). This happens after Realize() is called on the AudioPlayer. If, before the AudioTrack is created, the SLEffectSendItf interface is used to configure the aux send for that player, there is no AudioTrack to configure. The fix consists in keeping track of the effect the track needs to be attached to, and with what level. Once the track is created, and it gets configured (volume, mutes, channel solos, marker callbacks) we also attach it to the aux effect if necessary. Change-Id: I12230a8cbf7dc3876d3713a006b9702d44e9d6e5
* Stop preparing the player if an audio track cannot be found.Jean-Michel Trivi2010-10-111-1/+2
| | | | | | | | The bug consisted in not exiting from prepare() if an audio track couldn't be retrieved from the content to play. This is for instance the case with unsupported file formats. Change-Id: Ic48ef5c3bfbfc7d16b241eaacfd26fe1b34e1044
* Merge "Notify when prefetching fails" into gingerbreadJean-Michel Trivi2010-10-113-3/+43
|\
| * Notify when prefetching failsJean-Michel Trivi2010-10-113-3/+43
| | | | | | | | | | | | | | | | | | | | | | There is no event in the SLPrefetchStatus event callback in OpenSL ES 1.0 to indicate a prefetch error. So we signal it by sending simulataneously two events: - SL_PREFETCHEVENT_FILLLEVELCHANGE with a level of 0 - SL_PREFETCHEVENT_STATUSCHANGE with a status of SL_PREFETCHSTATUS_UNDERFLOW Change-Id: I399ea3474e6cc7796c940401306ca9a076fac4e2
* | Workaround for build error on sim-engGlenn Kasten2010-10-112-1/+7
|/ | | | | | | | | | | This is not a good long-term fix. target SharedLib: libOpenSLES (out/host/linux-x86/pr/sim/obj/SHARED_LIBRARIES/libOpenSLES_intermediates/LINKED/libOpenSLES.so) out/host/linux-x86/pr/sim/obj/SHARED_LIBRARIES/libOpenSLES_intermediates/IAndroidEffect.o:(.data.rel.ro._ZTIN7android12SortedVectorINS_16key_value_pair_tImPNS_11AudioEffectEEEEE[typeinfo for android::SortedVector<android::key_value_pair_t<unsigned long, android::AudioEffect*> >]+0x10): undefined reference to `typeinfo for android::SortedVectorImpl' collect2: ld returned 1 exit status make: *** [out/host/linux-x86/pr/sim/obj/SHARED_LIBRARIES/libOpenSLES_intermediates/LINKED/libOpenSLES.so] Error 1 Change-Id: Iea6678d31d0f747651285e76f2c2e616937bfbd7
* Add support for 8-bit and 48 kHz PCMGlenn Kasten2010-10-101-3/+4
| | | | Change-Id: I9e4ab432dc966d0eb531457b0ca2661d0626255a
* Fix build warningsGlenn Kasten2010-10-105-3/+5
| | | | Change-Id: I449da85b97901a632591dd16a52cb924a2722883
* Test cleanupGlenn Kasten2010-10-1022-265/+100
| | | | | | | | | | | | | | | Fix bug in QueryEffect test - was not re-initializing the name length. Add QueryEffect test for over-writing the name buffer. Don't create output with VOLUME or NULL interfaces. Use <stdlib.h> symbolic names for exit codes instead of 0 and 1. Remove Android-style logging from examples; use only printf. Remove extra blank lines in test output. Remove the MAX_NUMBER_OUTPUT_DEVICES macro. Use <unistd.h> to declare usleep. Remove obsolete #include statements. Fix build warnings. Change-Id: I8d198a317246b3894f104edf7c9f317a51593d07
* More tests and bug fixesGlenn Kasten2010-10-0810-98/+568
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New tests: - urimime.c tests audio player with URI data source and MIME data format - dim.c tests DynamicInterfaceManagement - engine.c new test cases: - create more than one engine simultaneously - exit application without destroying engine first Bug fixes: - Can't request SLBufferQueueItf or its alias SLAndroidSimpleBufferQueueItf if the data source is not a buffer queue. - BufferQueue interface is explicit on AudioPlayer. - OutputMixExt is unavailable (internal) on AudioPlayer. - There was a nested mutex lock when resuming a non-suspended interface. - This implementation supports at most one engine, so check for that - Class configuration table had wrong entry for DynamicInterfaceManagement on 4 of 10 classes. Restore most of the infrastructure for removing interfaces (code review): - DynamicInterfaceManagement is included, but body of RemoveInterface is compiled out, and replaced by FEATURE_UNSUPPORTED until all our deinit hooks are clean. - Remove hook must be called with mutex locked, rather than unlocked as before. The remove hook is called during IDynamicInterfaceManagement::RemoveInterface and Object::Destroy, so the entry conditions must be the same. - Add NULL remove hooks to the interface hook table. Change-Id: I328dd254ed24a32b220996a6d9592cc8c0f4e943 Miscellaneous: - Always memset object to garbage in Object::Destroy to catch broken applications. - Add comments about how GetInterface manipulates the v-table pointer (code review). - Re-enable DynamicInterfaceManagement for testing the example code.
* Interface testing and bug fixesGlenn Kasten2010-10-0715-67/+419
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add some new tests, and fix the bugs they found. New and improved tests: Added output mix API test with focus on interfaces. Add mute solo and seek test cases to the automated buffer queue test. Buffer queue configuration test is now listenable: Buffer queue configuration test now generates a sequence of sine waves in order so that the listener can tell if each format is supported correctly. Bug fixes: Engine::Create... was not checking if the interface was available for a particular class. Fixing that bug showed some other bugs in the class/interface configuration tables. The effects interfaces is available on an output mix. The Volume interface is not available on an output mix. The Object interface can do GetInterface before realized. OutputMix interface is available on an OutputMix; needed by the demos/examples in back of book OutputMix::ReRoute fails if number of output device IDs is not 1. Improve interface checks on a buffer queue source. Don't allow mute solo interface on a mono buffer queue. The earlier code to check for seek interface on a buffer queue compared by address, which didn't work if application used a private copy of the GUID. Now compares using the MPH which will work in all cases. Buffer queue, effect send, and mute solo are explicit interfaces on audio player. slCreateEngine was not publishing the engine object. Miscellaneous cleanup: Removed the hard-coded fake device ID constants in OutputMix::ReRoute that were there just for testing. In Engine::Create..., log an error for all unsupported interfaces, not just the first one. Make hash generator build again: It turns out interfaces.c is needed, even though it duplicates OpenSLESUT.c. Restore from 1a6bb4f8e738c9387dc9629db294ea5de618a53c. Remove some redundant comments. Change-Id: Iddabe73e298b69a44f3b43ed224c918eb95961a1
* Object an interface initialization/destroy cleanupGlenn Kasten2010-10-0525-246/+444
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this, object and interface fields were being initialized and deinitialized in random places. This resulted in some real and potential leaks, especially in the case of partial object construction. There were even some places where fields were not being initialized at all. Details: Move destructor for AndroidEffectCapabilities from CEngine::Destroy to IAndroidEffectCapabilities deinit hook. Move destructor for equalizer preset names from CEngine::Destroy to IEngine deinit hook. In Object::Destroy, call deinitializer for each initialized interface, regardless whether it was ever exposed. Remove double initialization of mStepSize in IPlaybackRate constructor. Remove obsolete logs. Add expose hooks that are called when interface is requested in Engine::Create... or by DynamicInterface::AddInterface. Always initialize all interfaces, even if not exposed Fix typos in same-line comments on INTERFACE_ constants. Add new interface state INITIALIZED: uninitialized -> initialized -> exposed. DynamicInterface::Remove sets interface state to initialized (but not exposed), instead of uninitialized. Add explicit constructor calls to initialize fields in C structs (e.g. smart pointers), using placement new. See also build warning which was turned off with -Wno-invalid-offsetof. Add comments about per-instance fields not associated with an interface. Add default initializations for all per-instance fields that are not associated with an interface, in case the object is only partially constructed and then needs to be destroyed due to an error. Add placement new comments. Update comments on private per-instance fields not associated with an interface. Move effect clears from the containing object destructor (CAudioPlayer_Destroy and COutputMix_Destroy) to the interface destructor. In this process this caught a bug that environmental reverb and preset reverb were not being destroyed properly for an audio player. Add comments on interface hooks. Add entries for interface destructors. Add placement new (explicit constructor) and explicit destructor calls for C++ fields in C struct. Fix template instantiation error. Move explicit calls to IBufferQueue_Destroy (now renamed to IBufferQueue_deinit) from CAudioPlayer_Destroy and CAudioRecorder_Destroy to be implicit via the BufferQueue interface deinit hook. ThreadSync interface destructor now logs a warning if ThreadSync::EnterCriticalSection was active at Engine::Destroy Add some comments. Clean up gMonitorFp close code. Fix typo in log message. Fix DynamicInterface to handle distinction between UNINITIALIZED and INITIALIZED states for an interface, and to call the optional expose hook. Do not use memset per interface, because the size of the last interface is unknown. Set the v-table pointer while lock is held. Add curlies to if statements. Log errors if interfaces active during Object::Destroy, instead of asserting. Log a warning if interface requests an interface but it is not available, and is optional. Add log with the class name and address of each new object. Mark only interfaces with init hooks as INITIALIZED; others are UNINITIALIZED. Change-Id: Ibb9c1b5f21e6195af6b20b2f7a5c7157905b735b
* Add new test, fix bugs found by test & code reviewGlenn Kasten2010-10-0414-68/+425
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bugs: - EnvironmentalReverb::GetEnvironmentalReverbProperties left mutex unlocked at end. - buffer queue configuration test revealed not checking enough combinations - would have failed conformance test in a couple places - replace peek locks by shared locks for SMP - undocumented symbols were being exported by library - fix handling of EffectSend for MIDI player New test: - Add reverb test Miscellaneous: - Move some FIXME to to-do list where they are easier to organize - Fix typos in name of profile constant - EffectSend::IsEnabled sets enabled = false for unsupported aux effect. - Add curlies to if statements. - Add more error logging. - Fix indentation in switch statement. - Add comments to makefile. Details: - Reduce visibility of libOpenSLESUT symbols. - Use LOCAL_STATIC_LIBRARIES := libOpenSLESUT where needed in applications. - Move FIXME for OEM configuration, interface, SDL, Sndfile, buffer queue, destroy to to-do list - For SDL, disallow buffer queue with source not 44.1 kHz because it is hard-wired to 44.1 kHz and there is no sample rate converter. - return successful result for enabled effect send on unsupported MIDI player for future conformance testing Change-Id: I39cb543169996f78c16e3ac363ea6157a9242743
* Merge "Add buffer queue configuration test" into gingerbreadGlenn Kasten2010-09-292-4/+250
|\
| * Add buffer queue configuration testGlenn Kasten2010-09-292-4/+250
| | | | | | | | | | | | Add comments to makefile for each test Change-Id: I8741d93e7aadb02c4b75e3a0a7a81d593dfa7f97
* | Lock tweak between interface and objectJean-Michel Trivi2010-09-295-37/+41
| | | | | | | | | | | | | | | | | | | | When locking the interface for the prefetch status, lock the object instead of the prefetch interface, as it updates the android object state. Fix the playState test app. Change-Id: Ib4e0e99a4cf0720e2b7ebd920fe92f69377f19d9
* | Code cleanup: function name unification.Jean-Michel Trivi2010-09-295-15/+19
|/ | | | Change-Id: I37790738d81bb8d6b5496467a93c17c6f1385b8f
* Fix issues with SLPlaybackRateItf interfaceJean-Michel Trivi2010-09-2911-29/+419
| | | | | | | | | | | | | | | Set rate was not applied when the AudioTrack is created after prepare completed. Modified playback rate functions in AudioPlayer to pass a CAudioPlayer pointer, rather than a pointer to IPlaybackRate so the rate update function can be queried from the CAudioPlayer. Added test that exercises the SLPlaybackRateItf interface as well as content looping. Simplified evaluation of delay between decode and render to use a fixed (small) delay that balances time to run the event looper, and prevents clicks. Change-Id: I598e9a96e93ef7a7c3603c8467f9d6b36dacd26d
* Merge "Add MuteSolo checks for audio player and fix bugs" into gingerbreadGlenn Kasten2010-09-287-38/+126
|\
| * Add MuteSolo checks for audio player and fix bugsGlenn Kasten2010-09-287-38/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The specification says "This [SLMuteSoloItf] interface cannot be exposed on a player whose audio format is mono." This has a lot of implications ... Deny an explicit interface request for SLMuteSoloItf at audio player creation time if the player is known pre-realize to have mono channel count (e.g. PCM buffer queue). Deny a GetInterface on MuteSolo if channel count is known to be mono, but allow it if the channel count is still unknown. When DynamicSource (or its replacement) is implemented, it will be possible for the application to have done a GetInterface successfully, and then to change the source such that the MuteSolo interface is no longer valid. In that case, return SL_RESULT_FEATURE_UNSUPPORTED for most MuteSolo operations, if called when channel count is unknown or is mono. We _do_ allow MuteSolo::GetChannelCount to succeed if channel count is known to be mono. Enhance the URI-based mute solo test to check some of the above, and the interactive buffer queue test to get and test the channel count. Add curly braces to if statements. Other bug fixes: - Do not rely on peek locks; they don't work on SMP. - Channel count and sample rate were not being set correctly for buffer queue data source audio players. - CreateAudioPlayer and AudioRecorder were both referring to application pointers more than once, with the possibility of reading inconsistent data. Change-Id: Ie0109cbddc0aff8a56c0b53d989fb2be823e627b
* | Merge "Fix bug 3004701 do not prefetch during Realize." into gingerbreadJean-Michel Trivi2010-09-286-120/+179
|\ \ | |/ |/|
| * Fix bug 3004701 do not prefetch during Realize.Jean-Michel Trivi2010-09-286-120/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed unused Android object states in enum, not used in play state machine. Made SfPlayer responsible for the creation of its AudioTrack once it knows the sample rate and number of channels of the content to play once it's done preparing. Added notification from SfPlayer to signal when it's done preparing. This informs of the audio characteristics and kicks off the content prefetching. In the AudioPlayer realize: - do not start the prefetching, do it when the player is set to PAUSED - don not create the AudioTrack, do it when SfPlayer is done preparing. Change-Id: Ic345040e71cef0e5953ea47366930d1dfbc5e761
* | Enable and test more interface ID queriesGlenn Kasten2010-09-288-25/+247
| | | | | | | | | | | | | | | | | | | | | | Enable Engine::IEngine_QueryNumSupportedInterfaces and Engine::QuerySupportedInterfaces. Add object ID test. Return SL_RESULT_FEATURE_UNSUPPORTED from Engine::Create... if the corresponding class is not configured.. Add slesutObjectIDToString to utility toolkit. Change-Id: I28b8beff71d65e7eccd558e586652bb606c89848
* | Add engine interface testGlenn Kasten2010-09-272-0/+114
|/ | | | Change-Id: I5c1fd1e8ab6dc050f416f28708e3ef218910cd8d
* Merge "Destroy for an unrealized engine was hanging" into gingerbreadGlenn Kasten2010-09-271-7/+14
|\
| * Destroy for an unrealized engine was hangingGlenn Kasten2010-09-271-7/+14
| | | | | | | | Change-Id: Ib11b15fe40726d2f9aad0c54fa66382824c95cfa
* | Remove old stream type code that's not used anymore.Jean-Michel Trivi2010-09-272-50/+0
|/ | | | Change-Id: I66e0d93ffa8fbf8fd64642d5554026513d561153
* Initialize mEffects if audio player partly createdGlenn Kasten2010-09-273-1/+7
| | | | | | | | | See https://android-git.corp.google.com/g/70088 File opensles/libopensles/android_AudioPlayer.cpp Line 1111: if (NULL != pAudioPlayer->mAndroidEffect.mEffects) { mAndroidEffect.mEffects is not initialized to NULL. Change-Id: Ic6b952748c7a8024c797d7bec4a26cb138fa8840
* Fix AudioTrack sessionId bugJean-Michel Trivi2010-09-271-2/+10
| | | | | | | | The sessionId associated with an AudioPlayer is initialized during its creation. The sessionId was not passed to the AudioTrack constructor. Change-Id: I9ccafd707313367f8da78013575cd6048637f240