55 Commits

Author SHA1 Message Date
Marco Nelissen
b89a29dd75 am cd08ada7: am 67c7a4ae: Merge "Fix off-by-two and other bugs in the visualization code. b/3137511" into gingerbread 2010-10-27 11:11:19 -07:00
Marco Nelissen
f514bdc964 Fix off-by-two and other bugs in the visualization code.
b/3137511

Change-Id: Ic431701e93c025bc417c9742e9af6bb2350c7dd6
2010-10-27 10:23:59 -07:00
Eric Laurent
c9a9800fa1 am b047e3cd: am aeb2c62e: Merge "Fix several audio effects problems." into gingerbread
Merge commit 'b047e3cdf24b32e26f366fcd4cd0eee8ae6c592c'

* commit 'b047e3cdf24b32e26f366fcd4cd0eee8ae6c592c':
  Fix several audio effects problems.
2010-09-28 17:39:54 -07:00
Eric Laurent
4fd3ecc1f0 Fix several audio effects problems.
Fixed the following issues in LVM effect bundle wrapper:
- memory leaks in EffectCreate() in case effect creation fails at various stages
- Added saturation when accumulating to output buffer
- Fixed problems with enabled effects count when an effect is released while enabled
- Do not allocate temporary buffer for accumulation each time process() is called

Fixed the following issues in effects framework (AudioFlinger)
- Release effect synchronously in the library when deleted from effect chain
- Do not call the effect process function if no tracks are present in the same
audio session

Change-Id: Ifbd80a163415cfb3c0a337c12082853ea45d9c91
2010-09-28 14:23:39 -07:00
Eric Laurent
3b8901946b am 1b37df95: am 9627847d: Merge "Fix error in AudioEffect command status reporting." into gingerbread
Merge commit '1b37df95ec9d03aaa5f4055c6cd86db42f9c9727'

* commit '1b37df95ec9d03aaa5f4055c6cd86db42f9c9727':
  Fix error in AudioEffect command status reporting.
2010-09-27 08:48:40 -07:00
Eric Laurent
4d3fb50782 Fix error in AudioEffect command status reporting.
AudioEffect::command() should not interpret the status
returned in pReplyData unless the command is ENABLE or
DISABLE.

Also fixed:
- bug in Visualizer::getWAveForm() status reporting.
- wrong initialization value for capture buffer in visualizer engine.

Change-Id: I60fb0011f9dba96ee74661dec1e8ef441edcaf35
2010-09-24 15:24:54 -07:00
Eric Laurent
dab59d1534 am 6943b94b: am a6dc4699: Merge "Fix issue 2913071." into gingerbread
Merge commit '6943b94b8f267c83060946bae0961efc30444dee'

* commit '6943b94b8f267c83060946bae0961efc30444dee':
  Fix issue 2913071.
2010-09-21 16:53:20 -07:00
Eric Laurent
672c0dc3a0 Fix issue 2913071.
Scale audio signal during capture according to peak level so that
returned values on 8 bits contain enough information even for weak
signals.

Also do not reject requests to enable/disable the visualizer if we are
already in the requested state.

Change-Id: I07a705619764350834e61f82d161761eab688747
2010-09-21 15:11:50 -07:00
Eric Laurent
9e6f16a5d0 am d32d3011: am 37de5da0: Merge "Fix problem in lvm effect bundle wrapper" into gingerbread
Merge commit 'd32d30119bd0c0988a6806f1205db5426235af52'

* commit 'd32d30119bd0c0988a6806f1205db5426235af52':
  Fix problem in lvm effect bundle wrapper
2010-09-16 10:56:25 -07:00
Eric Laurent
f0f95b8bc5 Fix problem in lvm effect bundle wrapper
When an effect was deleted while enabled, the count of enabled effects
in the bundle was not decremented. Resulted a state where if another effect
was still enabled, its process function was called only every other time.

Change-Id: I59a0c5b7f50f416a9ecadae297b42912e56ddd51
2010-09-16 09:02:16 -07:00
Eric Laurent
e931c68f53 am 4d987850: am bd2e9ec6: Merge "Fix volume problems with insert revert" into gingerbread
Merge commit '4d9878502f7661ed34540a485a5942d859e209c7'

* commit '4d9878502f7661ed34540a485a5942d859e209c7':
  Fix volume problems with insert revert
2010-09-13 14:42:59 -07:00
Eric Laurent
27a2fdfb8a Fix volume problems with insert revert
- Use a constant input level to the reverb engine and implement volume control in the
insert reverb. This avoids the volume spikes when an effect that was inserted after
the reverb is disabled or removed.
- Fix clicks (one silent buffer) at the end of the reverb disable period.
- Modified volume management in audioflinger so that the volume ramp is also done by
the insert effect if present when the track is paused (avoids clicks).
- Increased room level for all presets.

Also fixed problems with output stage session (-1):
- effect bundle wrapper was not designed to support session -1
- the permission check in audioflinger for using session -1 failed due to a wrong usage of
getCallingPid()

Change-Id: Id1ff51327263364bf71d3f2668fa5cde4311d84f
2010-09-13 09:08:28 -07:00
Eric Laurent
dd88d7e3ff am ea4680f0: am 2814ad25: Merge "LVM release 1.09 delivery" into gingerbread
Merge commit 'ea4680f007c9fbc1ff73a6b161e6e83ebaeff981'

* commit 'ea4680f007c9fbc1ff73a6b161e6e83ebaeff981':
  LVM release 1.09 delivery
2010-09-10 11:30:16 -07:00
Eric Laurent
305443c989 LVM release 1.09 delivery
- Reverb:
	- 1 channel mixed has gain zero
	- core componenet now only outputs STEREO samples
	- wrapper now handles only STEREO from the Reverb Core
- Bass Boost:
	- increase scratch memory

Change-Id: I00ae31051cc40a7006fc993420facfeb4d30dc52
2010-09-09 12:02:58 -07:00
Eric Laurent
15ff01cdb4 am e126119c: am 95d86480: Merge "Modify type of some environmental reverb parameters" into gingerbread
Merge commit 'e126119c3a406bc564f2549aeb1416aff112689d'

* commit 'e126119c3a406bc564f2549aeb1416aff112689d':
  Modify type of some environmental reverb parameters
2010-09-08 17:22:54 -07:00
Eric Laurent
95d5de0681 Modify type of some environmental reverb parameters
Changed type of decay time, reverb delay and reflections delay parameters
from signed to unsigned int to match OpenSL ES interface definition.

Also fixed some type casts in lvm reverb wrapper.

Change-Id: I5ca5e76a87c2590f01f031f3168355586ef22556
2010-09-08 16:06:18 -07:00
Eric Laurent
bcb284c196 am ef9e508c: am 7e427934: Merge "LVM release 1.08 delivery." into gingerbread
Merge commit 'ef9e508c2cb3b52d31250ceca3dddace17cec950'

* commit 'ef9e508c2cb3b52d31250ceca3dddace17cec950':
  LVM release 1.08 delivery.
2010-09-03 16:52:31 -07:00
Eric Laurent
5fa6df6ebf LVM release 1.08 delivery.
- Changed bundle SamplesToExit to 0.1 secs
- Added SamplesToExit to Revreb
- Removed mixer from Core reverb

Change-Id: I675ec22889f20ef35a0ac427600c2654111c397e
2010-09-03 15:22:18 -07:00
Eric Laurent
288db3b499 am 55e79374: am f560ceab: Merge "Audio Effects: fix problems in volume control." into gingerbread
Merge commit '55e7937462d107b469a58651d3d51e15086f8e9e'

* commit '55e7937462d107b469a58651d3d51e15086f8e9e':
  Audio Effects: fix problems in volume control.
2010-08-31 15:49:15 -07:00
Eric Laurent
a92ebfa1cd Audio Effects: fix problems in volume control.
- Fixed click when re-enabling effect during the turn off phase:
make sure the effect states where effect is processed are the same
where volume control is delegated to effect.
- Fixed click when effect is deleted while still active: do not apply
volume ramp if an effect having volume control was just removed from the
effect chain.

Also fixed a crash when PCM dump is enabled in effect bundle wrapper.

Change-Id: Ib562f5cf75c69af75df0e862536262e2514493e4
2010-08-31 15:26:23 -07:00
Eric Laurent
9d01dcbdf2 am 5762dc19: am 858bb4f6: Merge "LVM release 1.07 delivery." into gingerbread
Merge commit '5762dc19836e332d3ac1906e5698088a128b362d'

* commit '5762dc19836e332d3ac1906e5698088a128b362d':
  LVM release 1.07 delivery.
2010-08-30 13:30:14 -07:00
Eric Laurent
adecf1c1a9 LVM release 1.07 delivery.
- Virtualizer now uses the correct control parameter, instead of reverberation
- Volume smoothing for first frame has been added
- Equalizer_setParameter now returns correct error code
- Correcting Non-Linear compressor gain step noise during transitions and effect level changes
- Removed SVN header blocks
- Memory and MIPS values have been added to the API
- Reverb uses a more efficient malloc for input PCM
- Reverb DecayHFRatio now ranges up to 2000
- Logging has been removed for most volume functions

Change-Id: Ib59e7e331263c3811559231b4ae90c82e34a8421
2010-08-27 11:54:39 -07:00
Eric Laurent
ec95d93254 am 8ca5df27: am c14f9ca6: Merge "Added preset reverb." into gingerbread
Merge commit '8ca5df27df8a2b6435486f9b5a163bf222f8fed1'

* commit '8ca5df27df8a2b6435486f9b5a163bf222f8fed1':
  Added preset reverb.
2010-08-25 15:16:00 -07:00
Eric Laurent
a7e5648d61 Added preset reverb.
Modified lvm reverb wrapper code to expose a preset reverb interface.
Also removed debug log from bundle and reverb wrapper.

Change-Id: If9b95d91e25a6ff834decdfdda34b17df9b46967
2010-08-24 17:32:48 -07:00
Eric Laurent
0e30200ed1 am 33e0d834: am b6d71351: Merge "LVM release 1.05 delivery" into gingerbread
Merge commit '33e0d8343174339cc9622d63c23d47c0ba0d3baa'

* commit '33e0d8343174339cc9622d63c23d47c0ba0d3baa':
  LVM release 1.05 delivery
2010-08-24 14:43:54 -07:00
Eric Laurent
08b352be43 am 5aff90a6: am 1aaba885: Merge "Audio Effects: fixed "strength supported" parameter size." into gingerbread
Merge commit '5aff90a638da53e66fba90c92d412812760fe8e5'

* commit '5aff90a638da53e66fba90c92d412812760fe8e5':
  Audio Effects: fixed "strength supported" parameter size.
2010-08-21 09:41:26 -07:00
Eric Laurent
a1a96f3570 LVM release 1.05 delivery
- Click have been removed from the HP filter activation in the BassBosst Effect.
- SessionId is now stored as a SessionNo
- Effects now stop being called after a delay
- Unix EOL fixed for .java and .xml
- Updated lines limited to 100 characters.
- Removed the remaining warnings from the wrapper code
- Added reverb

Change-Id: I03a2b3b5ee2286958f4901acc8d9b0daf9e2d7c6
2010-08-20 14:17:41 -07:00
Eric Laurent
ba8da2e61b Audio Effects: fixed "strength supported" parameter size.
The "strength supported" parameter for bass boost and virtualizer effect was incorrectly using a
short value whereas it should be an int. This is to comply to the definition of boolean type in OpenSL ES
that is uint32.

Change-Id: I74ccb61dcc70fc9d390524a1ca5bbbd8b13ab1af
2010-08-18 14:31:25 -07:00
Eric Laurent
b422107d1d am e67332f8: am 92e847ed: Audio effects: aligned Equalizer API argument types on OpenSL ES SLEqualizerItf.
Merge commit 'e67332f879b3f97baaac2252b53ac64686aebdbb'

* commit 'e67332f879b3f97baaac2252b53ac64686aebdbb':
  Audio effects: aligned Equalizer API argument types on OpenSL ES SLEqualizerItf.
2010-07-30 09:58:09 -07:00
Eric Laurent
92e847ed8e 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.

Also fixed a problem with set properties in equalizer engine implementation.

Change-Id: I75894bad0cb67b01c18ca5e22f9687e75ee491b8
2010-07-30 09:12:51 -07:00
Eric Laurent
ba2709583d am 6fa88882: am 62d83a0c: Merge "Audio effects: modified command() parameter types." into gingerbread
Merge commit '6fa8888254deb4961dc64c6ac03dc103c9cd8bcf'

* commit '6fa8888254deb4961dc64c6ac03dc103c9cd8bcf':
  Audio effects: modified command() parameter types.
2010-07-28 07:53:24 -07:00
Eric Laurent
a4c72acfbc Audio effects: modified command() parameter types.
The type of the cmd, cmdSize and *pReplySize parameters of the effect control interface command()
function have been modified from int to uint32_t. This is more consistent with their role.

Change-Id: I84d289fc262d6753747910f06f485597dfee6591
2010-07-28 05:49:21 -07:00
Eric Laurent
b008e9b128 resolved conflicts for merge of d306cc81 to master
Change-Id: Ib593b7719a837de12605e8c75904634843298ba1
2010-07-27 02:41:41 -07:00
Eric Laurent
ca57d1cc89 Audio Effects: added methods to effects java classes to store and load current effect settings in
a single call.

Addional changes:
- Fixed simulator build
- Use effect interface UUIDs from OpenSL ES includes when available
- Added cleanspec rules to remove now obsolete test effect libraries
- Fixed bug in AudioEffect JNI setParameter function.

Change-Id: Ic25ddb135e2cec5a68c181d727321f5ac7a1ab6b
2010-07-27 00:41:31 -07:00
Eric Laurent
037644fbe4 am e80c30c6: am 00de7218: Merge "Fixed bug in vlm effect bunde wrapper effect init function." into gingerbread
Merge commit 'e80c30c6b557fab2f5fc7a87c51018f5a8074338'

* commit 'e80c30c6b557fab2f5fc7a87c51018f5a8074338':
  Fixed bug in vlm effect bunde wrapper effect init function.
2010-07-26 12:30:49 -07:00
Eric Laurent
f4d9a21a4c am df5c3b50: am 739bf285: Merge "LVM release 1.04." into gingerbread
Merge commit 'df5c3b5024276af8b44d00bb28ce620ab31e2365'

* commit 'df5c3b5024276af8b44d00bb28ce620ab31e2365':
  LVM release 1.04.
2010-07-26 12:30:23 -07:00
Eric Laurent
00de721859 Merge "Fixed bug in vlm effect bunde wrapper effect init function." into gingerbread 2010-07-26 10:09:54 -07:00
Eric Laurent
3374105cc0 LVM release 1.04.
Remaining warnings in the code have been removed
Core components support seamless insertion in the audio stream at playtime (Enabling / Disabling the effect).

Change-Id: Icae7085305fad663faeb5a94cb673b41cec5a9f1
2010-07-26 01:57:36 -07:00
Eric Laurent
1c454cc4c7 Fixed bug in vlm effect bunde wrapper effect init function.
The status in the command reply field was not initialized by Effect_command() for
EFFECT_CMD_INIT causing unpredictable failures when initializing an effect.

Change-Id: I7dccb094c9244fad4ed9aea3062a395db295e082
2010-07-26 01:07:38 -07:00
Eric Laurent
d9f7200e21 am 08f2b10c: am 021697ad: Audio effects: lvm bundle wrapper update after first integration tests.
Merge commit '08f2b10c4b2e7fc1c666cc1d896e227289206b24'

* commit '08f2b10c4b2e7fc1c666cc1d896e227289206b24':
  Audio effects: lvm bundle wrapper update after first integration tests.
2010-07-23 01:06:12 -07:00
Eric Laurent
021697ad3d Audio effects: lvm bundle wrapper update after first integration tests.
Change-Id: I20cb55282833bd6e3a160e0dae1cc1fcb6b1ca30
2010-07-23 00:54:58 -07:00
Eric Laurent
240677ec68 resolved conflicts for merge of dd206093 to master
Change-Id: I21dd2321a4839d034d49092baccbf40986f17dae
2010-07-20 13:37:19 -07:00
Eric Laurent
8ed6ed0b62 Audio policy manager changes for audio effects
Added methods for audio effects management by audio policy manager.
- control of total CPU load and memory used by effect engines
- selection of output stream for global effects
- added audio session id in parameter list for startOutput() and stopOutput().
this is not used in default audio policy manager implementation.

Modifications of audio effect framework in AudioFlinger to allow moving and reconfiguring
effect engines from one output mixer thread to another when audio tracks in the same session
are moved or when requested by audio policy manager.
Also fixed mutex deadlock problem with effect chains locks.

Change-Id: Ida43484b06e9b890d6b9e53c13958d042720ebdb
2010-07-20 10:31:57 -07:00
Andy McFadden
61636c24f3 Merge "Fix sim-eng build." 2010-07-19 11:27:08 -07:00
Andy McFadden
d84f9863af Fix sim-eng build.
Different handling of libdl.  Added sim handling in one place, corrected
typo in sim handling in another.

Change-Id: I24153ad5b8873083225390ba6a751941d231d092
2010-07-19 10:53:30 -07:00
Eric Laurent
0d7e048cf2 Fixed problems in audio effect volume control.
Fixed the following problems in audio effect volume control in AudioFlinger:
- Make sure that the volumes returned by EffectChain::setVolume_l() are correct even is
no change is detected since last call
- Do not use isEnabled() to validate volume control but mState >= ACTIVE instead as the volume control
must be also active in STOPPING and STOPPED states.

Change-Id: Id62da3164fad500ee8a5efd6cd78c77e8fdcb541
2010-07-19 06:31:30 -07:00
Eric Laurent
2c87e9c923 First submission of audio effect library from NXP software.
This CL contains the first open sourceable version of the audio effect library from NXP software.
The effects implemented are:
- Bass boost
- Virtualizer (stereo widening)
- Equalizer
- Spectrum analyzer

Source file for the effect engines are located under libeffects/lvm/lib
The wrapper implementing the interface with the audio effect framework in under libeffects/lvm/wrapper

The code of other effect libraries has also been reorganized fo clarity:
- the effect factory is now under libeffects/factory
- the test equalizer and reverb effects are under libeffect/testlibs
- the visualizer is under libeffects/virtualizer

Change-Id: I8d91e2181f81b89f8fc0c1e1e6bf552c5809b2eb
2010-07-17 06:33:00 -07:00
Jean-Michel Trivi
97eb728aef Use the OpenSL ES definition of SL_IID_EQUALIZER for the EQ
effect UUID instead of defining it locally.

Change-Id: Id6018fef20d286899cf7503fec3521dcd56db7e0
2010-07-14 10:09:31 -07:00
Eric Laurent
7d850f23c8 Modifications in audio effect engine state management.
- Separate the updating of effect engine state from the process call in EffectModule so that the state
of all effects in the same effect chain is updated simultaneusly before all process functions are called.
- Added a mechanism for the effect engine to continue being called for processing after receiving the disable
commands untils it considers that the framework can stop calling the process function without causing
a glitch or loosing some effect tail.
- Updated test reverb and equalizer to support this new feature

Change-Id: Icb56ae2c84c076d4dbad6cf733b1a62f823febe7
2010-07-13 12:27:18 -07:00
Eric Laurent
fd84f97af4 Added JAVA classes to control bass boost, equalizer, reverberation and virtualizer Effects.
Defined the following JAVA classes on top of AudioEffect class to facilitate control
off built-in audio effects with APIs aligned with interfaces defined in OpenSL ES
specification:
- BastBoot.java
- Equalizer.java
- PresetReverb.java
- EnvironmentalReverb.java
- Virtualizer.java

Split reverb API header file in two, one for preset reverb and one for environmental reverb.
Some changes in test reverb to support preset reverb.

Change-Id: Ie0a5ba06002e63dfd6da22cace5568c1e0b76ea1
2010-07-08 15:32:51 -07:00