summaryrefslogtreecommitdiffstats
path: root/libs/audioflinger
Commit message (Collapse)AuthorAgeFilesLines
* audioflinger: Nasty hack for adjusting BCM FM volumeSteve Kondik2010-11-292-3/+48
| | | | | | | | | Normally this kind of nasty hack could go into libaudio, but on this particular device, we have no access to the source code of libaudio. Put the nasty hack into audioflinger and wrap it in ifdefs. Change-Id: I5e3e495e3bd6b671823967b61ba5ceb49e59a401
* Revert "Revert "audio: Omit FM code when HAVE_FM_RADIO is not set""Steve Kondik2010-11-0713-13/+83
| | | | | | | | | Cleaned it up, and fixed a misplaced ifdef that broke the whole damn thing. This reverts commit 568f674b8ef1a83b7ba948b0e53e0dd86207d115. Change-Id: I99fde73b2cf283dde7e9bcb1e73cf86e553324d3
* Revert "audio: Omit FM code when HAVE_FM_RADIO is not set"Steve Kondik2010-11-0713-96/+13
| | | | This reverts commit c5358c4b94c2953290988be654b284840551b5bd.
* audio: Omit FM code when HAVE_FM_RADIO is not setMichael Webster2010-11-0313-13/+96
| | | | Change-Id: If140f0cd1232f927f4870c5de3f25deac73c3778
* support FM Radio audio routing in audio flingerxinyu2010-10-1212-7/+155
|
* Initialize dither state during object constructionAntti S. Lankila2010-09-281-0/+7
|
* Use floating point DSP on armeabi-v7aAntti S. Lankila2010-09-093-108/+264
|
* Add noise-shaped dithering supportAntti S. Lankila2010-09-064-23/+63
| | | | | | | Used rectangular probability distribution function before by accident, depite calculating the high-passed triangular probability density function I intended to use. This commit rectifies the mistake and also adds noise-shaped error feedback similar to JACK.
* Estimate center channel and avoid DSP on itAntti S. Lankila2010-09-022-7/+25
| | | | | Also fixes reverb like I originally intended it and tweaks parameters a little.
* Make Headphone DSP with just 1 biquadAntti S. Lankila2010-09-022-20/+7
| | | | | | | | | | | Subtracting the left and right channels could be argued to separate the center channel from the left/right channel and the DSP therefore gets applied to panned sounds only. This halves the cost of the filtering and eliminates the bass boost issue that bs2b compensates for with a highboost filter. I also adjusted the delay-to-level spatial filter to try to get slightly more consistent perception of panning across the frequency spectrum.
* Initialize track volume more correctlyAntti S. Lankila2010-08-221-2/+2
| | | | prevVolume is scaled by 16 because of the ramping performed with it.
* Various DSP enhancementsAntti S. Lankila2010-08-183-39/+29
| | | | | | | | | | | | | | | | | | | | - Update headset to a 2nd order shelf filter, drop allpass delays A single shelf filter can give a time delay for low frequencies and attenuation for high frequencies yielding a headphone virtualization directly. - Make equalizer out of high shelves. Cascading 4 high shelves and one global gain gives me 5 controllable bands with passthrough characteristics when not used. - Set loudness target to 93 % Also correcting a volume-ramping bug which sometimes caused a slow adjustment to desired volume because of integer truncation and invalid round down/up algorithm. This should eliminate cases where song starts super loud.
* Sound tweaks: Always on speaker 2.0, headphone attenuation, headphone music ↵Jonas Larsson2010-08-161-13/+93
| | | | vol limit, audio focus requests.
* Use 1st order high shelf instead of RC filter.Antti S. Lankila2010-08-112-2/+20
| | | | | | This admittedly sounds almost the same, but the advantage of shelving is with more high-frequency content being mixed. That being said, the used shelving is reasonably steep (16 dB).
* Spread the equal loudness contour upwards.Antti S. Lankila2010-08-111-1/+1
|
* Take some ideas from bs2b.Antti S. Lankila2010-08-112-33/+4
| | | | | | | | | | | Bs2b uses the low-pass filter to generate the delay as a byproduct of its operation. The filter is generally set around 700 Hz where it produces about 250 microseconds of delay. In addition to that, the crossfeed is now mixed at -6 dB level. The reverb is unchanged, although the new configuration gives it larger role in forming an impression of a soundstage. The design is still not complete, but good enough for a commit.
* HACK: Allow use of Eclair MemoryDealer for compatibility.Steve Kondik2010-08-082-0/+8
| | | | Take #2.
* Revert "HACK: Allow use of Eclair MemoryDealer for compatibility."Steve Kondik2010-08-083-12/+0
| | | | Patchset is broken. Will recommit a single working patch.
* HACK: Allow use of Eclair MemoryDealer for compatibility.Steve Kondik2010-08-083-0/+12
|
* Increase virtual head size slightly.Antti S. Lankila2010-08-061-2/+2
|
* Integrate reverb and headphone effects.Antti S. Lankila2010-08-062-133/+100
|
* Make reverb buffers ping-pong between L&R channelsAntti S. Lankila2010-08-061-5/+7
| | | | | | | Additionally move the estimation boost clamper into a more sensible base in the codebase. Signed-off-by: Antti S. Lankila <alankila@gmail.com>
* Rebalance dithering, volume ramping and DRCAntti S. Lankila2010-08-062-29/+29
| | | | | | | | | | | | | | | | - Move dithering to actually happen in the ditherAndClamp() procedure to reduce memory pressure. - Make volume ramping occur according to opposite logic: increases of volume are slow, decreases rapid. That is a balance that makes far more sense and spares user's ears far better. - Avoid extreme boosts by mapping the dynamic range boost curve on a nonlinear function x - x^3/3, for -1 <= x <= 0. This cuts off 1/3rd of the entire boosting region and avoids the artifacts arising from hardclipping this function. Signed-off-by: Antti S. Lankila <alankila@gmail.com>
* Add reverb modeAntti S. Lankila2010-08-062-24/+199
| | | | | | Add a reverb module based on the Haas stereo widening effect. Signed-off-by: Antti S. Lankila <alankila@gmail.com>
* Remove boost limit from bottom.Antti S. Lankila2010-08-062-15/+15
| | | | | | | | I noticed there was some distortion arising from the fixed bottom level set in the level estimator, so I removed such limits. I also enhanced the estimation quality for the nearly inaudible sound levels. Signed-off-by: Antti S. Lankila <alankila@gmail.com>
* Fix rattling of very quiet soundsAntti S. Lankila2010-08-031-1/+4
| | | | | An integer truncation issue resulted in discontinuous estimates of sound level when the audio stream sound level was very quiet.
* Do not use track's frameCount but the buffer's frameCount.Antti S. Lankila2010-08-032-7/+7
| | | | This change makes compression effect about 10 times faster.
* Fix some shortcomings of the audio level estimationAntti S. Lankila2010-08-033-32/+71
| | | | | | | | | | | | Use crude approximation of the equal loudness curves (a single 2nd order bandpass at 1 kHz). Because we must be stateless, the filter is always reset first, which somewhat damages the behavior. Limit adjustment range to 30 dB to avoid problems when sound goes very quiet. Make ramp up fast and ramp down slow. This gives reasonable response to transients between periods of silence.
* Optimizations and cleanups.Antti S. Lankila2010-08-012-54/+108
| | | | | | | | | | | | | | | | | | Optimization: - write ARM assembly routine for biquads, using one load per pair of coefficients. Correctness fix: - clamp sound level estimate below at -50 dB because of integer truncation at estimateLevel() method. Cosmetic changes: - add headings in .cpp to make it easier to keep track of file structure. - remove trailing whitespace - rearrange some functions in logical order.
* More fixes to the AudioDSPAntti S. Lankila2010-08-014-109/+104
| | | | | | | | | | | | | | | | Recover from partial sync with CyanogenMod. Sync to version 7: - do not use thumb instruction set for AudioDSP - fix up types at AudioDSP to optimal - workaround low-volume rattling with AudioMixer's volume ramping. Various fixes. - speed up estimateLevel - remove state from estimateLevel, as it may be used by multiple tracks simultaneously. - co-opt android's volum ramping mechanism to smoothly apply the envelope for me. - fix loud snap when enabling headphone effect by clearing the allocated allpass buffer.
* Add the audio enhancementskmobs2010-07-317-214/+677
|
* Fix bug 2604132 40s skip after undockingJean-Michel Trivi2010-04-201-1/+1
| | | | | | | In case of A2DP write errors, there is an overflow in the calculation of the sleep duration to simulate the timing of a successful write. Change-Id: Ic4e570aebf07fac69735aab1bbc2fc73512ee795
* Additional fix for isssue 2548710: Native AudioTrack resources never freed.Eric Laurent2010-04-091-1/+1
| | | | | | | This changes fixes the issue for the direct output thread that was not addressed by commit 71f37cd8a175ee00635cb91506d6810fd02b5b51. Change-Id: I1bbe26be5f444415dd97270e49257650f5d2858f
* Fix isssue 2548710: Native AudioTrack resources never freed.Eric Laurent2010-03-311-1/+1
| | | | | | | | | | The problem is a bug in AudioFlinger::MixerThread::prepareTracks_l() that makes that even if the TrackHandle is destroyed, the corresponding Track will remain active as long as frames are ready for mixing. If the track uses shared memory (static mode) and the sound is looped, this track will play for ever. The fix consists in removing the track from active list immediately if the track is terminated. Change-Id: I4582aa1d981079ab79be442fb6185f5afaed5cf3
* Fix issue 2416481: Support Voice Dialer over BT SCO.Eric Laurent2010-03-162-15/+33
| | | | | | | | | | | - AudioPolicyManager: allow platform specific choice for opening a direct output. Also fixed problems in direct output management. - AudioFliinger: use shorter standby delay and track inactivity grace period for direct output thread to free hardware resources as soon as possible. - AudioSystem: do not use cached output selection in getOutput() when a direct output can be selected. Change-Id: If44b50d29237b8402ffd7a5ba1dc43c56f903e9b
* Fix bug 2203203 Route STREAM_VOICE_CALL to A2DP when not in call.Jean-Michel Trivi2010-03-141-0/+17
| | | | Change-Id: I5581702780308658415dc4ad19fbe409fdc5c368
* Use proper config to enable LVMXJean-Baptiste Queru2010-03-091-3/+1
| | | | Change-Id: Ifa75a82884b99aeee139e055f40e7c510cf28213
* Initial version of LifeVibes integration.Glenn Kasten2010-03-094-12/+149
| | | | Also changed tabs to spaces in other audioflinger files.
* Fix bug 2329540Jean-Michel Trivi2010-03-091-0/+5
| | | | | | | | | | | | | | Part 1 of the fix: when the user doesn't elect to use the car dock for music and media, the APM was not aware of the device being docked. This is fixed by dissociating the notification for the APM of the docking to the dock from the sink state change of the A2DP device. Also missing was forcing the volumes to be reevaluated whenever the device is docked or undocked, as volumes for docks may differ, even when the same output device is being used. Change-Id: If5314e27821a71adbd6df6fdf887c45208241d96
* Fix issue 2317760: Change the priority between wired headset and A2DP.Eric Laurent2010-03-081-7/+7
| | | | Modified audio policy manager so that wired headset has precedence over A2DP headset.
* Fix issue 2428563: Camera rendered inoperable by voice call interruption.Eric Laurent2010-03-051-2/+8
| | | | | | | | | | | | | | | | | The problem is that AudioRecord never exits read() when a timeout occurs while trying to get new PCM data from audio hardware input buffer: it just keeps waiting and retrying until stop() is called. In the same time, opencore AndroidAudioInput::audin_thread_func() loop cannot be exited when stuck in AudioRecord::read() because the iExitAudioThread flag can only be sampled when AudioRecord::read() returns. We remain stuck with the audio input thread running. The fix consists in modifying AudioRecord behavior in case of timeout when getting new PCM samples. We now wait only one timeout period and try to restart audio record, in case the problem is due to a media_server process crash. If this fails, we exit read() with a number of bytes read equals to 0 so that AndroidAudioInput::audin_thread_func() loop can exit. Also modified Audioflinger::RecordThread() loop so that we attempt to recover from HAL read errors. In case of read error, the input stream is forced to standby so that next read attempt does a reconfiguration and restart of the audio input device.
* Issue 2071329: audio track is shorter than video track for video capture on ↵Eric Laurent2010-03-026-0/+31
| | | | | | | | sholes Add API to retrieve number of frames dropped by audio input kernel driver. Submitted on behalf of Masaki Sato <masaki.sato@motorola.com>
* Fix issue 2327064: Music played via line out is interrupted due to the phone ↵Eric Laurent2010-02-241-12/+10
| | | | | | | | | | | call audio on BT hs. This is not a real fix for the issue but a change to make sure that the behavior is consistent regardless of external condidions (WIFI ON or OFF, music started before call or not, A2DP device same as SCO device...). As there is now way to guaranty good quality audio over both SCO and A2DP simultaneously, especially when WIFI is on, We will stick to this behavior: When music is playing and we are docked to the desk dock and a call is answered with a BT SCO headset, A2DP output will be suspended. If music is restarted during the call, it will appear muted to the user until the call is terminated.
* Fix issue 2305382: Pick up original call makes a noisy beep when wired ↵Eric Laurent2010-02-231-3/+21
| | | | | | | | | | headset connected. The noise is the residual ring tone that is still playing while the call is answered and the audio route changed to headset or earpiece. The fix consists in muting the ringing tone when changing mode from ringtone to in call and delaying the route change until the audio buffers are emptied.
* Simplify the MemoryDealer implementationMathias Agopian2010-01-291-1/+1
| | | | | | | | | | | | | | At some point the implementation became complicated because of SurfaceFlinger's special needs, since we are now relying on gralloc we can go back to much simpler MemoryDealer. Removed HeapInterface and AllocatorInterface, since those don't need to be paramterized anymore. Merged SimpleMemory and Allocation. Made SimplisticAllocator non virtual. Removed MemoryDealer flags (READ_ONLY, PAGE_ALIGNED) Removed a lot of unneeded code.
* Remove verbose log from AudioPolicyManagerBase.Eric Laurent2010-01-281-2/+1
|
* Fix issue 2285561: New AudioFlinger and audio driver API needed for A/V syncEric Laurent2010-01-2610-9/+62
| | | | | | | | | | | | Added getRenderPosition() API to IAudioFlinger to retreive number of audio frames written by AudioFlinger to audio HAL and by DSP to DAC. Added getRenderPosition() API to AudioHardwareInterface to retreive number of audio frames written by DSP to DAC. Exposed AudioTrack::getPosition() to AudioSink() to make it available to media player. Removed excessive log in AudioHardwareGeneric.
* Fix issue 2378022: AudioService should direct volume control to ↵Eric Laurent2010-01-252-6/+6
| | | | | | | | | STREAM_VOICE_CALL stream when STREAM_VOICE_CALL stream is active. Modified AudioService.getActiveStreamType() so that STREAM_VOICE_CALL is selected when a track using this stream type is playing. Chanded isMusicActive() for a more generic isStreamActive(stream) method in AudioSystem, IAudioFlinger and AudioFlinger.
* Create base class for audio policy manager.Eric Laurent2010-01-136-1165/+1962
| | | | | | | | | | First implementations of audio policy manager in Eclair branch have shown that most code is common to all platforms. Creating AudioPolicyManagerBase base class will improve code maintainability and readability. Audio policy manager code for platforms using generic audio previously in AudioPolicyManagerGeneric is replaced by AudioPolicyManagerBase. Audio policy manager test code previously in AudioPolicyManagerGeneric is moved to AudioPolicyManagerBase. Also added a wake lock for delayed commands in AudioPolicyService.
* am 0c5cc224: am d20a55af: Merge change Iccfa50fe into eclairEric Laurent2009-12-222-25/+85
|\ | | | | | | | | | | | | Merge commit '0c5cc224b052654ee38d39effce427a47697481b' * commit '0c5cc224b052654ee38d39effce427a47697481b': Fix issue 2323920: Notification & A2DP audio stutter.