OSDN Git Service

android-x86/system-media.git
13 years agoHide media player looper from AudioPlayer.
Jean-Michel Trivi [Sun, 12 Sep 2010 18:06:51 +0000 (11:06 -0700)]
Hide media player looper from AudioPlayer.

The ALooper that takes care of the rendering loop in SfPlayer is
 only used inside SfPlayer. This CL makes SfPlayer manage the
 lifecycle of its rendering looper.

Change-Id: Ia4d5e02ce0a44bcf79021f428b490612a9fead9c

13 years agoImplement the SLAndroidEffectSendItf.
Jean-Michel Trivi [Fri, 10 Sep 2010 17:47:17 +0000 (10:47 -0700)]
Implement the SLAndroidEffectSendItf.

This enables sends from an AudioPlayer to an OutputMix
that's using the generic effect interface (SLAndroidEffectItf).
Since there is a single aux bus, the effect ID is only used
to verify the effect referred to in the send is actually
attached to the OutputMix. Also there is a single send
level value and enable flag for the interface, even though
the interface definition supports discerning between multiple
effects (so it scales on platform with multiple aux buses).

Dry (direct) level is now stored in the AudioPlayer,
as it is shared between SLEffectSendItf and
SLAndroidEffectSendItf.

Change-Id: I3dd34c4c045d8ac2961a325e10b181a789bf4913

13 years agoDefinition of SLAndroidEffectSendItf
Jean-Michel Trivi [Thu, 9 Sep 2010 18:26:22 +0000 (11:26 -0700)]
Definition of SLAndroidEffectSendItf

Define the SLAndroidEffectSendItf interface which mirors the
SLEffectSendItf interface, but uses an SLInterfaceID parameter
to identify the effect the AudioPlayer is sending to.

Change-Id: Iec0ddf315a6974fafedecd566bd01c7231183312

13 years agoFix aux reverb issues:
Jean-Michel Trivi [Thu, 9 Sep 2010 00:56:50 +0000 (17:56 -0700)]
Fix aux reverb issues:

- when creating an effect, only pass the effect type to the
 AudioEffect framework so it selects whether to use an insert
 or aux effect based on the session.
- SL ES aux reverb effects don't have an explicit SetEnabled()
 function, so enable the effect upon creation, or based on the
preset for the preset reverb effect.

Add a test for SLEffectSend.

Change-Id: I683331cac19cf1fb9628d636569ab3d342c02820

13 years agoFixed the make file which it can build all the sub-dir.
Yu Shan Emily Lau [Wed, 8 Sep 2010 22:59:03 +0000 (15:59 -0700)]
Fixed the make file which it can build all the sub-dir.
Remove the samples temporary until it's fixed.

Change-Id: I6dd9b15a16c3dcc22ecee1fd1acecaebbd59262f

13 years agoFix automated tests testPlayAbsPath and testPlayfilePath
Jean-Michel Trivi [Wed, 8 Sep 2010 18:18:30 +0000 (11:18 -0700)]
Fix automated tests testPlayAbsPath and testPlayfilePath

Do not rewind when reaching the end of the stream.

Change-Id: I98fa7cebc2b2d8fa8d10d371cfb78f24fb1ab277

13 years agoSupport SLAndroidEffectItf on the OutputMix object.
Jean-Michel Trivi [Wed, 8 Sep 2010 17:06:49 +0000 (10:06 -0700)]
Support SLAndroidEffectItf on the OutputMix object.

Change-Id: I098dc047ce91848781c9ba18beec5a33abd50e68

13 years agoFinish implementing the SLEnvironmentalReverbItf interface.
Jean-Michel Trivi [Wed, 8 Sep 2010 01:03:26 +0000 (18:03 -0700)]
Finish implementing the SLEnvironmentalReverbItf interface.

Change-Id: I02bbc6a08607c328253257cbdb6a45b675b9d3ff

13 years agoCleanup SLAndroidEffectCapabilitiesItf example.
Jean-Michel Trivi [Tue, 7 Sep 2010 22:16:57 +0000 (15:16 -0700)]
Cleanup SLAndroidEffectCapabilitiesItf example.

Change-Id: I3b73d089fde7f8ada5387f6e030869356a918b4a

13 years agoFix bug 2947094
Jean-Michel Trivi [Tue, 7 Sep 2010 21:48:49 +0000 (14:48 -0700)]
Fix bug 2947094

"multiplay" is a test that creates an AudioPlayer for each file to
 play. When a player reaches the paused state, SetPosition (ISeekItf)
 is called with a value of 0 (beginning of file). The bug was that
 on Android, the player would stop playing after playing the file
 once or twice.
The bug was caused by the logic in ISeek.c which checks that the
 new seek position is different than the previous one before issuing
 a seek command to the player. The fix consists in not checking
 the old requested seek position so the command is always issued.
 It works on the desktop because the SndFile version was resetting
 the mPos field to SL_TIME_UNKNOWN each time SetPosition was called.

 While investigating this bug, it was also found that the player
 should reset its decode position to 0 each time it reaches the end of
 the stream.

Change-Id: I22f2d6480c62ab6e56c28c7ccae2c117888a7639

13 years agoFix deadlock when stopping the player while destroying.
Jean-Michel Trivi [Tue, 7 Sep 2010 19:11:06 +0000 (12:11 -0700)]
Fix deadlock when stopping the player while destroying.

Do not acquire an exclusive lock on the player when querying play
 callback and event mask, or updating the playstate.

Not related to fix:
Do not notify the end of the stream has been reached once the player
 is stopped.

Change-Id: I9c7e1d96c28d1472ff18174c97544faa8deb0e88

13 years agoStore decoded buffer in player instance.
Jean-Michel Trivi [Fri, 3 Sep 2010 22:14:52 +0000 (15:14 -0700)]
Store decoded buffer in player instance.

Do not store decoded buffer reference in message sent from decoder
to renderer, but rather in player instance. This allows access
to buffer between decoding and playback so the media source can
be correctly stopped.

Change-Id: I7f583366d9895db039ca7d0d9e22f36d0d429f55

13 years agoImplement SLAndroidEffectItf and SLAndroidEffectCapabilities.
Jean-Michel Trivi [Fri, 3 Sep 2010 00:48:22 +0000 (17:48 -0700)]
Implement SLAndroidEffectItf and SLAndroidEffectCapabilities.

Change-Id: Ia2cf6e3f0178189b0ed010690bc9906b61a746a7

13 years agoFix OpenSL ES effect test durations based on audio file duration.
Jean-Michel Trivi [Thu, 2 Sep 2010 23:49:09 +0000 (16:49 -0700)]
Fix OpenSL ES effect test durations based on audio file duration.
Fix make file to build the EQ test.

Change-Id: I509d1f0cea775c4f955c8c23fc27ba313995dd5b

13 years agoImprove test app portability for other platforms
Glenn Kasten [Wed, 1 Sep 2010 21:04:02 +0000 (14:04 -0700)]
Improve test app portability for other platforms

Change-Id: I8793b7e6f6ebd0f83ff8e5bd534234cd1f4166a2

13 years agoMore error logging. Correct error code.
Glenn Kasten [Wed, 1 Sep 2010 00:09:13 +0000 (17:09 -0700)]
More error logging. Correct error code.

Normalize error messages to use similar wording, remove "Error:".

Change-Id: I8746d28c0c0ada43e691f7859d0aaeed25a82dbb

13 years agoMerge "Verify that no extant objects at engine shutdown" into gingerbread
Glenn Kasten [Wed, 1 Sep 2010 21:01:11 +0000 (14:01 -0700)]
Merge "Verify that no extant objects at engine shutdown" into gingerbread

13 years agoVerify that no extant objects at engine shutdown
Glenn Kasten [Wed, 1 Sep 2010 16:22:23 +0000 (09:22 -0700)]
Verify that no extant objects at engine shutdown

Log the total count and ID numbers of any stragglers.
Fix the order of steps in engine shutdown.
Add more comments.

Change-Id: I12b531bcd43c288f9988768193274bad6984748a

13 years agoUse AudioSystem constant for global effect session ID, instead of 0.
Jean-Michel Trivi [Wed, 1 Sep 2010 02:30:08 +0000 (19:30 -0700)]
Use AudioSystem constant for global effect session ID, instead of 0.

Change-Id: Ib3d236e81da7f0764983fba37ffaa76058aa935c

13 years agoSupport auxiliary effects on OutputMix, and direct and send levels
Jean-Michel Trivi [Wed, 1 Sep 2010 00:51:38 +0000 (17:51 -0700)]
Support auxiliary effects on OutputMix, and direct and send levels
 on AudioPlayer.

added global function for mB to attenuation conversion.

Change-Id: Ib7f92397786e4b2e21d6ad51585ac1b542ffab6c

13 years agoUse standard filenames for tests.
Glenn Kasten [Wed, 1 Sep 2010 00:44:17 +0000 (17:44 -0700)]
Use standard filenames for tests.

Change-Id: I0bfc8bd98f00ce1dd9d7e36d402d4cd422cb8ea6

13 years agoFix problems found by the mute solo test.
Glenn Kasten [Tue, 31 Aug 2010 04:37:44 +0000 (21:37 -0700)]
Fix problems found by the mute solo test.

Bug fixes for USE_OUTPUTMIXEXT (desktop):
 - SL_PLAYEVENT_HEADATNEWPOS was broken
 - GetPosition is now accurate, with or without seeking
 - Fix race condition between AudioPlayer and Track
 - Duration is updated if initial estimate is too low (e.g. if unknown is reported as zero)
 - GetPosition while pending Seek now returns that value so the Seek appears synchronous
 - Remove useless code to retry Enqueues; now drop decoded data if Enqueue fails
For all source files touched, add curlies to the "if" statements.

Change-Id: I1f70d8e683bc92831848af20857347d45c6407a9

13 years agoAdd support for auxiliary effects.
Jean-Michel Trivi [Mon, 30 Aug 2010 17:16:06 +0000 (10:16 -0700)]
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

13 years agoBuffer queue automated test update
Glenn Kasten [Fri, 27 Aug 2010 22:35:35 +0000 (15:35 -0700)]
Buffer queue automated test update

Make it run on desktop as well as Android, so we can use desktop driver
  for comparison, and get test coverage using gcov.
Use slesutResultToString for error reporting.
Run each test case for all valid numbers of buffers.

Change-Id: If7753a0e77f4a906a41eae90135e1bc84531f2fc

13 years agoFix compile-problem on desktop, and SDL bug.
Glenn Kasten [Fri, 27 Aug 2010 20:51:59 +0000 (13:51 -0700)]
Fix compile-problem on desktop, and SDL bug.

Fix bug caught by using gtest on desktop: SDL was not being shutdown properly when engine destroyed.
Fix compile problems on desktop for BassBoost, Equalizer, and Virtualizer.
Add new OpenSLESUT function: slesutResultToString.
Rename SDL_start to SDL_open to match SDL naming conventions.
Add SDL_close.
Add symlink for applications to use OpenSLESUT.h.

Change-Id: I6ef9895adc508b3b9570c79302c7a3046ca8246f

13 years agoImplement the SLVirtualizerItf interface.
Jean-Michel Trivi [Thu, 26 Aug 2010 23:44:28 +0000 (16:44 -0700)]
Implement the SLVirtualizerItf interface.

Add example for the SLVirtualizerItf.

Unify how an effect interface checks whether a valid effect is
  attached to the interface.

In implementation of SLEqualizerItf, ensure the effect is accessed
  only if its valid (just like for BassBoost and Virtualizer).

Change-Id: I03032de2925488bc78502f23a83972e666435a8b

13 years agoFix bugs found by clang (part of clang fix-it)
Glenn Kasten [Thu, 26 Aug 2010 23:27:40 +0000 (16:27 -0700)]
Fix bugs found by clang (part of clang fix-it)

Serious bugs:
 - SLEqualizerItf::GetPreset was returning wrong preset index.
 - SLEngineCapabilities::QueryVibraCapabilities was returning wrong status code.
Another variable was initialized unnecessarily, but was not a serious bug.

Change-Id: Ifebbae1d457fa800e5adfb09decede4222b60aa1

13 years agoFix bugs in BufferQueue automated test and related
Glenn Kasten [Thu, 26 Aug 2010 17:46:17 +0000 (10:46 -0700)]
Fix bugs in BufferQueue automated test and related

Fix test bugs:
Clean up the player, mixer, and the engine (must be done in that order).
Re-enable 2 more tests; all 9 tests pass now.

Fix engine bugs:
IObject now has a de-init hook, which cleans up condition variable and mutex.
Run the de-initializers in reverse order so that IObject de-init hook is run last.
Replace the dedicated mEngine.mShutdownCond by the shared IObject condition variable.
Forgot to iniitalize mShtudownAck.
Unlocking the object mutex during CEngine_Destroy was bogus.

Miscellaneous logging and debugging improvements:
Track the source code location of the most recent mutex unlock.
Add more trace log options for detailed leave reasons.
Improve performance of trace log when disabled.
Turn on assert checking.
Check return value of pthread_cond_destroy and pthread_mutex_destroy.
Add comment.
Line length 100.

Change-Id: I23b7b495d439894b2fd31295a38cb73ef7b6be2e

13 years agoRefactor effect parameter setting and getting to prepare support
Jean-Michel Trivi [Thu, 26 Aug 2010 17:35:47 +0000 (10:35 -0700)]
Refactor effect parameter setting and getting to prepare support
 for additional effects.
Add support for Virtualizer parameters.

Change-Id: I39c69e883457af6444e49ba64e390213898cd55c

13 years agoSet decode and render thread priority to ANDROID_PRIORITY_AUDIO.
Jean-Michel Trivi [Thu, 26 Aug 2010 01:25:28 +0000 (18:25 -0700)]
Set decode and render thread priority to ANDROID_PRIORITY_AUDIO.

Change-Id: I91843747fd1f51c0eca2d344a22a77d8df853015

13 years agoFix bug in BufferQueue::Clear
Glenn Kasten [Tue, 24 Aug 2010 22:37:38 +0000 (15:37 -0700)]
Fix bug in BufferQueue::Clear

BufferQueue::Clear must clear playIndex also -- see pg 423 section 9.1.5.
Only print a lock error message if delayed 100 ms.
Object lock debugging did not take into account that cond_wait also releases the lock.
Improve error reporting for recursive locks.
Reduce the noisy output of sawtooth test.

Change-Id: I66a959445de7e0763440e22251465c796bb1883b

13 years agoImplement the SLBassBoostItf on an AudioPlayer
Jean-Michel Trivi [Tue, 24 Aug 2010 17:38:51 +0000 (10:38 -0700)]
Implement the SLBassBoostItf on an AudioPlayer
Prevent the SLEqualizerItf to use an EQ effect that wasn't
  successfully initialized.

Change-Id: I4cdb07fc4deebba1cb591f0ca96fc3f494e37080

13 years agoFix bug with nested lock.
Glenn Kasten [Mon, 23 Aug 2010 17:23:26 +0000 (10:23 -0700)]
Fix bug with nested lock.

Add object lock debugging.
Replace !NDEBUG by USE_DEBUG.
Remove $(JNI_H_INCLUDE) and $(TOP).

Change-Id: I61217b82a7edc42d37dacf443ad0ca852ee0dfe9

13 years agoTest reorganization
Glenn Kasten [Fri, 20 Aug 2010 23:06:26 +0000 (16:06 -0700)]
Test reorganization

Change-Id: I0fb84afd72fe6839773937fdaece3276bba1b952

13 years agoExercise more functions of the SLEqualizerItf interface.
Jean-Michel Trivi [Fri, 20 Aug 2010 22:05:46 +0000 (15:05 -0700)]
Exercise more functions of the SLEqualizerItf interface.
Refactor EQ effect descriptor initialization in an effect neutral
 function so it can be reused for other effects.

Change-Id: I72d71f7e05f19f0be3541440c1f67269c179b5cc

13 years agoMerge "Clean up interface visibility." into gingerbread
Glenn Kasten [Wed, 18 Aug 2010 00:29:55 +0000 (17:29 -0700)]
Merge "Clean up interface visibility." into gingerbread

13 years agoClean up interface visibility.
Glenn Kasten [Tue, 17 Aug 2010 01:47:13 +0000 (18:47 -0700)]
Clean up interface visibility.

Fix the interface visibility for occurences of an instance within an object.
Check all known interface codes in switch statements for safer error
  detection in case of future changes to the list of enum constants.
Replace USE_CONFORMANCE by USE_BASE, USE_GAME, USE_MUSIC, USE_PHONE, USE_OPTIONAL.
Move comment to Khronos bug

Change-Id: I11892db12590db6d2d6db5191aac5b62ab4f67bd

13 years agoMerge "Re-org the bufferQueue unit tests." into gingerbread
Yu Shan Emily Lau [Tue, 17 Aug 2010 21:59:59 +0000 (14:59 -0700)]
Merge "Re-org the bufferQueue unit tests." into gingerbread

13 years agoRe-org the bufferQueue unit tests.
Yu Shan Emily Lau [Tue, 17 Aug 2010 18:08:20 +0000 (11:08 -0700)]
Re-org the bufferQueue unit tests.

Change-Id: I55d63ca25e98a6b89634c9ec496a07dacb9c71b6

13 years agoFix the MimeUri test:
Jean-Michel Trivi [Tue, 17 Aug 2010 18:41:22 +0000 (11:41 -0700)]
Fix the MimeUri test:
- some logs were reported as errors
- the SLPrefetchItf was declared as required, but not requested in
  the creation of the AudioPlayer.

Change-Id: I33f07ec532ef1d8151aa1bda4f7cfa4d3e64c8ec

13 years agoSupport SLPrefetchStatusItf on an AudioPlayer pulling from a BufferQueue
Jean-Michel Trivi [Mon, 16 Aug 2010 18:57:49 +0000 (11:57 -0700)]
Support SLPrefetchStatusItf on an AudioPlayer pulling from a BufferQueue
- Make SLPrefetchStatusItf explicit on Android as per spec.
- Signal prefetch status underflow when queue becomes empty, and
 sufficient data when filled again.

Change-Id: I0e0ae9dc305fe6d83dd4497741f9271ca465edd5

13 years agoMake internal implicit interfaces safer.
Glenn Kasten [Fri, 13 Aug 2010 20:57:26 +0000 (13:57 -0700)]
Make internal implicit interfaces safer.

Add IsInterfaceInitialized.
Don't directly manipulate a buffer queue.
Call the interface via it's named entry points, not the v-table as it may not be initialized/available.
GetInterface enables the v-table not init.
Update Doxygen comments.
Line length 100.
Allow bool, true, and false in C code.
Add a verbose option to seek torture test.

Change-Id: I37c42834422759b881d2ffe4b171d9aa284fde98

13 years agoAdd CleanSpec.mk
Jean-Baptiste Queru [Fri, 13 Aug 2010 22:50:40 +0000 (15:50 -0700)]
Add CleanSpec.mk

Change-Id: Ie58a8059aa0259d1aa76880930bf15fdcfb8456f

13 years agoWhen enqueuing a buffer in an empty buffer queue on an AudioPlayer
Jean-Michel Trivi [Fri, 13 Aug 2010 22:04:21 +0000 (15:04 -0700)]
When enqueuing a buffer in an empty buffer queue on an AudioPlayer
 in playing state, restart the associated AudioTrack which was
 stopped when the queue became empty.

Change-Id: I0361a3229fa2bd56c282a8a762f102c7ae23a4c7

13 years agoAdd support for SL_PLAYEVENT_HEADATEND event for AudioPlayer that
Jean-Michel Trivi [Fri, 13 Aug 2010 17:39:36 +0000 (10:39 -0700)]
Add support for SL_PLAYEVENT_HEADATEND event for AudioPlayer that
is fed by a buffer queue.

Change-Id: I573fdadd540d2ee127234299ec9a906504d72cbf

13 years agoMerge "Update use of audio effect framework in OpenSL ES to reflect latest updates...
Jean-Michel Trivi [Fri, 13 Aug 2010 15:34:15 +0000 (08:34 -0700)]
Merge "Update use of audio effect framework in OpenSL ES to reflect latest updates." into gingerbread

13 years agoImplement getPosition for an AudioPlayer reading from a URI or FD.
Jean-Michel Trivi [Thu, 12 Aug 2010 22:56:59 +0000 (15:56 -0700)]
Implement getPosition for an AudioPlayer reading from a URI or FD.

For getPosition, return the last decoded position as the current
 position. This is not accurate but will do for a first pass. Since
 this requires knowing whether it's seeking, a lock is introduced
 to guard against reading the seek flag in getPositionMsec(), and
 it being written in the player looper.

Change-Id: I2af6daa7f1415d8b6463d114a7b61c266fd98c97

13 years agoImplement seeking logic as a state updated in the message looper of
Jean-Michel Trivi [Wed, 11 Aug 2010 22:24:25 +0000 (15:24 -0700)]
Implement seeking logic as a state updated in the message looper of
the player, so no locks are required.

Change-Id: I14f30ab1e3f3cde5d31c4a6d121d1951c1a11995

13 years agoMerge "Cleanup AudioPlayer destroy sequence. Fix seek bug where audio wouldn't play...
Jean-Michel Trivi [Wed, 11 Aug 2010 17:20:22 +0000 (10:20 -0700)]
Merge "Cleanup AudioPlayer destroy sequence. Fix seek bug where audio wouldn't play, or played delayed after a seek." into gingerbread

13 years agoCleanup AudioPlayer destroy sequence. Fix seek bug where audio
Jean-Michel Trivi [Wed, 11 Aug 2010 17:05:29 +0000 (10:05 -0700)]
Cleanup AudioPlayer destroy sequence. Fix seek bug where audio
wouldn't play, or played delayed after a seek.

Change-Id: Id132ddf27774465af3df272707151876bc22f70d

13 years agoMerge "Permute is a tool used by seek torture test." into gingerbread
Glenn Kasten [Tue, 10 Aug 2010 21:58:04 +0000 (14:58 -0700)]
Merge "Permute is a tool used by seek torture test." into gingerbread

13 years agoPermute is a tool used by seek torture test.
Glenn Kasten [Tue, 10 Aug 2010 17:42:01 +0000 (10:42 -0700)]
Permute is a tool used by seek torture test.

Change-Id: Ifd077cda90f89c11011c8dd606a766d8b0ed5797

13 years agoPrevent consecutive decode operations by discarding
Jean-Michel Trivi [Tue, 10 Aug 2010 19:51:15 +0000 (12:51 -0700)]
Prevent consecutive decode operations by discarding
the next one if the decode buffer hasn't been released yet.

Change-Id: I4b9ebed899f6cead5b2ce0619dbb95ec0e1d3b64

13 years agoAfter stopping an AudioPlayer, playback should resume from the start.
Jean-Michel Trivi [Tue, 10 Aug 2010 16:18:17 +0000 (09:18 -0700)]
After stopping an AudioPlayer, playback should resume from the start.

Change-Id: Id524c1b9c74c89813c5699d25288509fa60d7aa5

13 years agoMerge "Do not initialize effect descriptors if the audio player couldn't be initializ...
Jean-Michel Trivi [Tue, 10 Aug 2010 15:54:54 +0000 (08:54 -0700)]
Merge "Do not initialize effect descriptors if the audio player couldn't be initialized." into gingerbread

13 years agoAdd command-line options to loop test.
Glenn Kasten [Mon, 9 Aug 2010 23:54:53 +0000 (16:54 -0700)]
Add command-line options to loop test.

Fix file permissions (no execute).
Line length 100.

Change-Id: If9a3e435ce5a48684a281c8f68488894dcefbe6f

13 years agoDo not initialize effect descriptors if the audio player couldn't
Jean-Michel Trivi [Mon, 9 Aug 2010 23:41:42 +0000 (16:41 -0700)]
Do not initialize effect descriptors if the audio player couldn't
be initialized.

Test playback behavior after stop.

Change-Id: I67d78b73f5392948e00af99eaa9335f76256df14

13 years agoUpdate use of audio effect framework in OpenSL ES to reflect latest updates.
Jean-Michel Trivi [Mon, 9 Aug 2010 19:35:38 +0000 (12:35 -0700)]
Update use of audio effect framework in OpenSL ES to reflect latest updates.

Rely on returned status from Audio Effect framework when enabling
or disabling an effect now that an error is not returned when
setting the same enabled state twice.

Effect command and command size are now unsigned.

Change-Id: I421ef5b2c06429a65797d4489f927da210ceab12

13 years agoThis version works but has high latency.
Glenn Kasten [Mon, 9 Aug 2010 18:47:38 +0000 (11:47 -0700)]
This version works but has high latency.

Change-Id: I7dc4e81cf78aa5c1c251d097f083b9428cb34984
Problems: mismatch of channel counts, too many buffers, buffers too large.

13 years agoUse paranthesis in macro for buffer size.
Jean-Michel Trivi [Sat, 7 Aug 2010 00:16:02 +0000 (17:16 -0700)]
Use paranthesis in macro for buffer size.
Use stderr for error display.

Change-Id: I83d41377f58e10ac494522bea15bafe41ca84982

13 years agoAdd a demo app showcasing the use of the BufferQueue interface on
Jean-Michel Trivi [Fri, 6 Aug 2010 23:22:07 +0000 (16:22 -0700)]
Add a demo app showcasing the use of the BufferQueue interface on
an AudioRecorder object to record PCM samples to a file.

Change-Id: Ia27465a6540b81962266951800da1a81ef0794d1

13 years agoDoxygen generator.
Glenn Kasten [Wed, 4 Aug 2010 01:57:12 +0000 (18:57 -0700)]
Doxygen generator.

Change-Id: I9160878dad17baa7193240e3dcc31e22a14068e3

13 years agoAdd the record to play loop test (broken)
Glenn Kasten [Wed, 4 Aug 2010 00:55:10 +0000 (17:55 -0700)]
Add the record to play loop test (broken)

Change-Id: I2b50501fef8a110d97d3cac69a0fec807b9de422

13 years agoAdd the seek torture test
Glenn Kasten [Wed, 4 Aug 2010 00:51:09 +0000 (17:51 -0700)]
Add the seek torture test

Change-Id: Icd4ef20283f6f0ac499901a7ffa8e9416abb2798

13 years agoA \n should continue to be mapped to \r\n
Glenn Kasten [Wed, 4 Aug 2010 00:46:30 +0000 (17:46 -0700)]
A \n should continue to be mapped to \r\n

Change-Id: I84a2c215e53d77a5a38fc9527b3111c1db76dfe6

13 years agoWorkaround assumption of prefetch interface
Glenn Kasten [Wed, 4 Aug 2010 00:44:00 +0000 (17:44 -0700)]
Workaround assumption of prefetch interface

Change-Id: I2548dc5f2d3e8cff41f2d1d129082e2b6bfefc5e

13 years agoUpdate logging.
Glenn Kasten [Wed, 4 Aug 2010 00:40:39 +0000 (17:40 -0700)]
Update logging.

Change-Id: I41f47c400adc1fb13a6d8ba88715a09c52855de4

13 years agoMerge "Fix broken build for sim-eng." into gingerbread
Glenn Kasten [Sat, 31 Jul 2010 16:29:50 +0000 (09:29 -0700)]
Merge "Fix broken build for sim-eng." into gingerbread

13 years agoFix broken build for sim-eng.
Glenn Kasten [Sat, 31 Jul 2010 16:27:13 +0000 (09:27 -0700)]
Fix broken build for sim-eng.

Change-Id: Ie1b1eaa93819bede1e024b1930de86c0b9772138

13 years agoMerge "Automated test for buffer queues." into gingerbread
Glenn Kasten [Fri, 30 Jul 2010 18:36:41 +0000 (11:36 -0700)]
Merge "Automated test for buffer queues." into gingerbread

13 years agoAudio effects: aligned Equalizer API argument types on OpenSL ES SLEqualizerItf.
Eric Laurent [Fri, 30 Jul 2010 16:25:14 +0000 (09:25 -0700)]
Audio effects: aligned Equalizer API argument types on OpenSL ES SLEqualizerItf.

Modified types of some arguments and returned values of the Equalizer class from int to short
to match those defined by OpenSL ES SLEqualizerItf interface.

Change-Id: Iaa975378d10f52362c04b464d6dbf354604d288d

13 years agoAutomated test for buffer queues.
Glenn Kasten [Fri, 30 Jul 2010 01:22:23 +0000 (18:22 -0700)]
Automated test for buffer queues.

Change-Id: If59517d83bbb6c3e985e72303e6503301d091dda

13 years agoFix build warning on Linux native.
Glenn Kasten [Thu, 29 Jul 2010 16:38:39 +0000 (09:38 -0700)]
Fix build warning on Linux native.

Change-Id: Id994888dc4be9cf9df44c3cf6222847d6422543b

13 years agoMerge "Hash generator." into gingerbread
Glenn Kasten [Wed, 28 Jul 2010 23:38:20 +0000 (16:38 -0700)]
Merge "Hash generator." into gingerbread

13 years agoHash generator.
Glenn Kasten [Wed, 28 Jul 2010 22:34:47 +0000 (15:34 -0700)]
Hash generator.

Change-Id: I20865784fe8f27c0ffbb814257283c5498acbec1

13 years agoFix build (invalid cast)
Jean-Michel Trivi [Wed, 28 Jul 2010 22:59:11 +0000 (15:59 -0700)]
Fix build (invalid cast)

Change-Id: I2be55bd2993e8f441f56ec3c8792b07b0a014725

13 years agoFirst implementation of the generic audio effect interface for
Jean-Michel Trivi [Wed, 28 Jul 2010 02:09:38 +0000 (19:09 -0700)]
First implementation of the generic audio effect interface for
OpenSL ES.

SLAndroidAudioEffectItf is an explicit interface, exposed on AudioPlayer

Change-Id: I41f86fd64650db7b3cb2d220cdb043d2dcbbcc21

13 years agoUse LOG macros instead of fprintf for logging
Glenn Kasten [Wed, 28 Jul 2010 16:42:35 +0000 (09:42 -0700)]
Use LOG macros instead of fprintf for logging

Line length 100
Details on logging:
    fprintf stderr -> SL_LOGE
    fprintf stdout -> SL_LOGV
    printf -> SL_LOGV
    // fprintf stderr -> // SL_LOGE or LOGV depending
    // fprintf stdout -> // SL_LOGV
    // printf -> // SL_LOGV
    newline is appended by the LOG macro

Change-Id: I5340249529784ec26cfdb2656fc30a2f4650cc11

13 years agoAdd symlinks for apps that don't follow standard.
Glenn Kasten [Wed, 28 Jul 2010 16:43:58 +0000 (09:43 -0700)]
Add symlinks for apps that don't follow standard.

Change-Id: I65bb243dc983d869b958cb90e62621026882cd88

13 years agoKhronos recommendation: include "SLES/OpenSLES.h"
Glenn Kasten [Wed, 28 Jul 2010 15:32:57 +0000 (08:32 -0700)]
Khronos recommendation: include "SLES/OpenSLES.h"

Change-Id: Iaa36d08f313a29ad2914e7459448bf9418e8c6c8

13 years agoVerify output mix is in realized state
Glenn Kasten [Wed, 28 Jul 2010 00:17:25 +0000 (17:17 -0700)]
Verify output mix is in realized state

Change-Id: Ie76de7bb68f31688cf96cf3621fe4b812030e59e

13 years agoRename the utility toolkit static library.
Glenn Kasten [Tue, 27 Jul 2010 22:45:20 +0000 (15:45 -0700)]
Rename the utility toolkit static library.

Change-Id: I8809aa5db6a259a0eb308f0e926e1922f9c9ea16

13 years agoBack port to Eclair.
Glenn Kasten [Tue, 27 Jul 2010 21:39:24 +0000 (14:39 -0700)]
Back port to Eclair.

Change-Id: Ib5fbb2f877a02891c0cd8f55c0fa2a46a12adffb

13 years agoFix leak of track slot when audio player destroyed
Glenn Kasten [Tue, 27 Jul 2010 18:14:47 +0000 (11:14 -0700)]
Fix leak of track slot when audio player destroyed

Move the link from audio player to associated output mix / track
  from the effect send interface up to the audio player class.
Add some more comments.
Line length 100.

Change-Id: I4e2de5e673709e686f066d0bd852bac17996810f

13 years agoImprove platform portability.
Glenn Kasten [Tue, 27 Jul 2010 15:50:43 +0000 (08:50 -0700)]
Improve platform portability.

Fix build errors and warnings on other platforms.

Change-Id: I0adf9fbabe274c7ebcc1c0b11d598b65feb3efc8

13 years agoUse recording settings of the PCM Buffer Queue sink of an SL ES
Jean-Michel Trivi [Thu, 22 Jul 2010 16:56:25 +0000 (09:56 -0700)]
Use recording settings of the PCM Buffer Queue sink of an SL ES
 AudioRecorder to configure AudioRecord.

- check, for Android only, that when creating an AudioRecorder,
 its data sink is a BufferQueue.
- move all inline SL ES to Android conversions to a separate file.
- in checkDataSink() function, take into account the type of
 the object whose sink is being inspected.

Change-Id: Id452cf20a8a184904043aceaacbd70d835f68130

13 years agoFlatten the tests/mimeUri directory.
Glenn Kasten [Mon, 26 Jul 2010 18:09:44 +0000 (11:09 -0700)]
Flatten the tests/mimeUri directory.

Change-Id: Ib8056ec7a4a167e6afdce7f020468381126c657e

13 years agoAdd and update comments and use typedefs more.
Glenn Kasten [Fri, 23 Jul 2010 22:45:09 +0000 (15:45 -0700)]
Add and update comments and use typedefs more.

Add Doxygen-style comments and convert some existing comments to Doxygen style.
Use typedef instead of struct as type name, e.g. rename struct Track to Track.

Change-Id: I251476c68304c9734210fcc5fe01d89544345af2

14 years agoFix build
Jean-Michel Trivi [Fri, 23 Jul 2010 01:00:24 +0000 (18:00 -0700)]
Fix build

Change-Id: I5c3f5e34836a3c2e4ea560d7925e84b550dfb0bb

14 years agoMerge "Initialize audio player for EffectSend." into gingerbread
Glenn Kasten [Fri, 23 Jul 2010 00:35:58 +0000 (17:35 -0700)]
Merge "Initialize audio player for EffectSend." into gingerbread

14 years agoInitialize audio player for EffectSend.
Glenn Kasten [Thu, 22 Jul 2010 23:21:20 +0000 (16:21 -0700)]
Initialize audio player for EffectSend.

During creation of an audio player, record the associated output
  mix for later use by the EffectSend interface.
Dummy prefetch level and MIDI duration for testing.
Line length 100.

Change-Id: Ic0a5a0539f902fbbe8b3d10288c08c6a2d150670

14 years agoMerge "Add test to exercise the SLEqualizerItf interface." into gingerbread
Jean-Michel Trivi [Fri, 23 Jul 2010 00:06:43 +0000 (17:06 -0700)]
Merge "Add test to exercise the SLEqualizerItf interface." into gingerbread

14 years agoAdd test to exercise the SLEqualizerItf interface.
Jean-Michel Trivi [Fri, 23 Jul 2010 00:01:32 +0000 (17:01 -0700)]
Add test to exercise the SLEqualizerItf interface.

Change-Id: I8c23516cee834e05911f890a89671fb1acd4a8e4

14 years agoUpdate the rear pointer when enqueuing a closure.
Glenn Kasten [Thu, 22 Jul 2010 22:56:42 +0000 (15:56 -0700)]
Update the rear pointer when enqueuing a closure.

Change-Id: Ibc800b5384adbaa45b9d7418bc8e7be6df8f5bb6

14 years agoBuffer queue and audio player maintenance.
Glenn Kasten [Sat, 17 Jul 2010 00:37:20 +0000 (17:37 -0700)]
Buffer queue and audio player maintenance.

Known problems on Android only (SDL is ok):
  High latency on first enqueue, or first after buffer underrun
  Play after stop does not resume the current buffer.

Improvements:
Implement BufferQueue::Clear for both Android and SDL.
Play::SetPlayState to Stopped now works for SDL (not yet for Android), and
  sets play cursor to start of current buffer.
Play::Pause and Play::Stop while playing now block until done for SDL.
SDL now calls buffer queue callback after each buffer completion, instead of when mixer needs a buffer.
Move SF_INFO sfinfo to CAudioPlayer so we always have good stuff like the sample rate etc.
BufferQueue::Enqueue on a successful enqueue to a formerly empty queue
  now kicks off an attribute change followed by a synchronous call to a
  hook when first buffer enqueued.  Currently unused but could be a way to reduce latency.
Minor comment changes.
Add interface_cond_broadcast.
More logging of errors.
Include source file and line number in logs.
sles_to_android.cpp: needs code for #if 0 sections.
Disable trace logging of BufferQueue::Enqueue and GetState.
Fix printf warnings.
Fix typo in number of interfaces requested at CreateAudioPlayer.
Remove spurious printf and while loop.
Line length 100.
Add intermediate play states which need to be re-mapped.
Fix printf format warnings.
Re-organize the buffer queue initialization.
Implement true seeking based on position for libsndfile.
SndFile is working again, but just barely.
Make it build on non-Android platforms.
BufferQueue::RegisterCallback now checks for STOPPED play state.
Include function name in trace logs.
Enhance test to check buffer queue callbacks, get buffer queue state, get play state.
Fix bug with Stop while Paused not resetting buffer pointer.
Remove obsolete comments and #if 0.
Set enqueue attribute is state is PLAYING and the first buffer is enqueued.
Added slutPrintIIDs.
Update comments.
Fix build warnings.
Fix compile error introduced by the merge.
Fix runtime problems introduced during the merge.
Address code review comments:
 - BufferQueue changes apply to AudioRecord also.
 - Rename to conform to new naming conventions.
 - Add comments.
Fix build warning.
Add interactive buffer queue test application.

Change-Id: I5b00545a599fd9dba96efb834fca2369d149eaaa

14 years agoHarmonize naming scheme for Android AudioPlayer related functions
Jean-Michel Trivi [Wed, 21 Jul 2010 19:46:14 +0000 (12:46 -0700)]
Harmonize naming scheme for Android AudioPlayer related functions
with what is used for AudioRecorder.

Change-Id: I96ed88ff17a5fff12b2e17dd6cb84630cba8fad8

14 years agoAdd support for PCM audio recording in OpenSL ES.
Jean-Michel Trivi [Tue, 20 Jul 2010 22:59:13 +0000 (15:59 -0700)]
Add support for PCM audio recording in OpenSL ES.

- add support for the AudioRecorder object in Android, not just for
  the conformance tests.
- map the SL AudioRecorder object to the AudioRecord class.
- only allow buffer queue data sinks.
- more work required for the recording format, and input device
  selection.

Change-Id: I4c65a8fa0ab162036f0eed4b756431f465325cd3

14 years agoUse the AudioEffect framework to implement SLEqualizerItf.
Jean-Michel Trivi [Fri, 9 Jul 2010 20:35:02 +0000 (13:35 -0700)]
Use the AudioEffect framework to implement SLEqualizerItf.
EQ presets are stored in the engine because they need to be
available during the duration of the application, not just
during the life of the AudioPlayer that uses EQ.
Change-Id: Ib55ce32b54a4dca134831a87bc5bd2ae8c111035

14 years agoLogging and comments to make testing easier.
Glenn Kasten [Wed, 14 Jul 2010 16:09:26 +0000 (09:09 -0700)]
Logging and comments to make testing easier.

Add utility function to print an IID.
checkDataFormat now prints a detailed log on invalid format.
Use SL_LOGE and SL_LOGV for logging instead of fprintf, we can easily redirect to standard Android logging eventually.
Add Doxygen-style comments.
Log more specific error message on invalid data format.
Use the full copyright header in one file.

Change-Id: I2342e29f57e97c3b5d94cb219d00e767a75e93fa

14 years agoBug fix and general code cleanup.
Glenn Kasten [Fri, 9 Jul 2010 18:50:34 +0000 (11:50 -0700)]
Bug fix and general code cleanup.

Trace debug now uses Android logging by LOGV/LOGE.
Added SL Utility Toolkit for OpenSL ES, similar to OpenAL UT.
Add a -DUSE_TRACE instead of -DNDEBUG and add it commented out to Android.mk.
LOGE for error returns, LOGV for all entry and exit.
Rename debug.c to trace.c.
slutPrintIID prints the symbolic name if known.
Fix bug in slQueryNumSupportedEngineInterfaces and
  slQuerySupportedEngineInterfaces which were not
  skipping over unavailable interfaces.
Use USE_CONFORMANCE to return SL_RESULT_FEATURE_UNSUPPORTED when not supported
  and make some interfaces unavailable depending on USE_CONFORMANCE.
Move most FIXME to separate bug/to-do list.
Fix possible intermediate overflow in duration computation for sndfile.
Line length 100.
Address code review comments, disable LOG.