summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
Commit message (Collapse)AuthorAgeFilesLines
* audio policy: add support for custom mixesEric Laurent2014-12-091-1/+7
| | | | | | | | | | | | | | | | | Add support for custom mixes in AudioPolicyManager. Two methods are added to register or unregister a list of custom mixes with their attributes and format. getOutputForAttr() and getInputForAttr() first look for a match in registered mixes before defaulting to normal output/input selection Remote submix device connection disconnection now takes address into account to identify the correspnoding custom mix. Bug: 16009464. Change-Id: I3f1c2a485a0fb71b1f984ed0adc9b68aa971e408
* Fix getTimestamp if offload thread is not initialized.Andy Hung2014-12-031-1/+2
| | | | | | | Returns INVALID_OPERATION. Bug: 18605649 Change-Id: I440fb687fbf9249098e049982fa83bcd1515fd80
* audio policy: new getOutputForAttr() prototype.Eric Laurent2014-11-252-5/+9
| | | | | | | | | | | | | | | | | | | | | | | Update getOutputForAttr() prototype and group all logic dealing with audio attributes to stream type conversion in audio policy manager. getOutputForAttr(): - specifies the audio session (for future use) - returns a status code - receives either stream type (for legacy) or audio attributes - returns an updated streamtype Remove logic dealing with legacy stream types to attributes conversion from AudioTrack. Use correct type for audio sessions in other APIs (startOutput() ...). releaseOutput() specifies the audio session (for future use). Bug: 18067208. Change-Id: I1bfbe9626c04c7955d77f8a70aecfad2cb204817
* audio: new routing strategies and stream typesEric Laurent2014-11-215-18/+40
| | | | | | | | | | | | | Added new routing strategies and stream type for internal use by audio policy manager and audio flinger: - One for accessibility to allow different routing than media - One for re-routing (remote submix) in preparation of dynamic policies - Added stream type for "internal" audio flinger tracks used for audio patches and duplication. Bug: 18067208. Change-Id: I88f884b552e51e4a49c29125e5a1204cf58ff434
* Fix format conversion in DuplicatingThreadHaynes Mathew George2014-11-201-8/+8
| | | | | | | | | DuplicatingThread converts PCM data from the format of the source thread to PCM_16BIT before writing to all connected output tracks. This needs to be done just once before writing to all tracks. Bug: 18461844 Change-Id: If05254f87f9198e09a0fa3c4e857afbb53ae7073
* Prevent stopped audio tracks from mixing dataAndy Hung2014-11-171-8/+9
| | | | | | | | | Static tracks should have zero framesReady when stopping or stopped, to prevent mixer from running potentially indefinitely with loop mode. Bug: 16070883 Change-Id: Iab9968044d1a6f8543bbcbfb246f49f27d68cace
* audioflinger: fix duplicating thread output buffers clearEric Laurent2014-11-071-1/+5
| | | | | | | | | Also clear mix buffer in DuplicatingThread::threadLoop_mix() instead of just sink buffer when output threads are not ready. Bug: 18262127. Change-Id: I4c22bbeaccdcc8d7c10c5882dde3439eb73d6ede
* remove some restrictions on effect output channelsEric Laurent2014-11-031-1/+2
| | | | | | | | Do not prevent from attaching effects to a non stereo output thread, unless the output thread is a mixer thread. Bug: 18157592. Change-Id: I6ac3187187a1b8aade7db04ea6dfbc47dacc25c3
* Always use an address for remote submixJean-Michel Trivi2014-10-271-2/+2
| | | | | | | | | | | Usage of remote submix device for audio rerouting (e.g. wifi display) didn't mandate the use of addresses. Use "0" as the default address when none is specificed. In logs, only use hex format for audio devices Bug 16009464 Change-Id: Ibfb1ce6881eba8b7e34420293b8a7077a6e659e6
* Merge "audioflinger: new HW A/V sync ID allocation flow" into lmp-mr1-devEric Laurent2014-10-222-9/+60
|\
| * audioflinger: new HW A/V sync ID allocation flowEric Laurent2014-10-222-9/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | The HW A/V sync ID is now allocated by the audio HAL before the output stream is created by a call to global get_parameters() with key AUDIO_PARAMETER_HW_AV_SYNC. When the AudioTrack is created, the HW A/V sync ID is communicated to the output stream by stream set_parameters() with key AUDIO_PARAMETER_STREAM_HW_AV_SYNC. Bug: 17112525. Change-Id: Ia8bc6f3bf9f358aa89f3f56ac554e893a19811ad
* | am ac302143: Fix the fixMarco Nelissen2014-10-201-1/+3
|\ \ | |/ |/| | | | | * commit 'ac302143551a8b964f026385a524dda9ff8ea5ba': Fix the fix
| * Fix the fixMarco Nelissen2014-10-201-1/+3
| | | | | | | | | | | | | | We need to clear the buffer a little more often. Bug: 18023017 Change-Id: If8a522b9133a4269e2435af8958f6ced322e71e9
* | am 22bc10a3: Merge "Clear effect buffer before sending to chain" into lmp-devMarco Nelissen2014-10-201-4/+3
|\ \ | |/ | | | | | | * commit '22bc10a347569a0ab2980c24783e31aba4d7414d': Clear effect buffer before sending to chain
| * Clear effect buffer before sending to chainMarco Nelissen2014-10-171-4/+3
| | | | | | | | | | | | | | | | otherwise the effect might get a buffer with previous data instead of silence. Bug: 18023017 Change-Id: Ic6be5ce0e74552aac2a0cce9c660893f9ad27f5c
* | fix FM no sound issueHochi Huang2014-10-142-0/+8
|/ | | | | | | | Review: https://partner-android-review.git.corp.google.com/#/c/184276 Signed-off-by: Carson Liao <carson.liao@mediatek.com> Change-Id: I0847c8a6e6d054a9258b52402c914105d902c573
* Merge "audioflinger: fix pre processing transfer between record threads." ↵Eric Laurent2014-10-034-15/+76
|\ | | | | | | into lmp-dev
| * audioflinger: fix pre processing transfer between record threads.Eric Laurent2014-10-024-15/+76
| | | | | | | | | | | | | | | | | | | | | | | | Fix two problems remaining with pre processing effects transfer from one record thread to the next in case of tear down due to device connection: 1 - the enabled state of the effects was not communicated to the new HAL input stream. 2 - the effects saved in orphan chains list were not transfered to the new thread when a AudioRecord was created. Bug: 17757378. Change-Id: I0923c98470db3b51154dc89846157780a4c21e86
* | Fix uncertainty of one normal mix buffer in AudioTrack::getTimestampGlenn Kasten2014-10-023-2/+29
|/ | | | | | | | | | The per-thread timestamp latch was not synchronized with the per-track released frames. Now the value of each track's released frames is latched along with the timestamp. Bug: 17531839 Bug: 17669342 Change-Id: I9d50c8c6a5de55a3f4561ac40e20d497376c1257
* audioflinger: fix failure to indicate volume to effectEric Laurent2014-10-012-10/+23
| | | | | | | | | | | | | If an effect is added and enabled after a track is started it will not receive current volume information because volume is indicated only to active effects and if there is a volume change. Add a flag to force EffectChain::setVolume_l() to pass volume indication to all effects each time an effect is enabled. Bug: 17572556. Change-Id: I6b68488c9aca8b2095fb210aa124d02e4f759660
* Merge "Revert "Fix uncertainty of one normal mix buffer in ↵Glenn Kasten2014-10-013-23/+1
|\ | | | | | | AudioTrack::getTimestamp"" into lmp-dev
| * Revert "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp"Glenn Kasten2014-10-013-23/+1
| | | | | | | | | | | | | | | | This reverts commit 54464ba861aaafd11ee5645f5d1ecd1171c6e9fe. Bug: 17733142. Change-Id: I9886d40032b2f7d96bee03e600e14f78943d8052
* | Merge "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp" ↵Glenn Kasten2014-09-303-1/+23
|\ \ | |/ | | | | into lmp-dev
| * Fix uncertainty of one normal mix buffer in AudioTrack::getTimestampGlenn Kasten2014-09-303-1/+23
| | | | | | | | | | | | | | | | | | | | The per-thread timestamp latch was not synchronized with the per-track released frames. Now the value of each track's released frames is latched along with the timestamp. Bug: 17531839 Bug: 17669342 Change-Id: I96252782911bd42a2534cc4030521b7eeb99a7b9
* | Merge "audioflinger: forward flush to direct output streams" into lmp-devEric Laurent2014-09-303-4/+16
|\ \
| * | audioflinger: forward flush to direct output streamsEric Laurent2014-09-293-4/+16
| |/ | | | | | | | | | | | | | | Track flush should be forwarded to the audio HAL when playing on a direct output stream. Bug: 17704953. Change-Id: Iafc94327fe9aebf1d4eaa97b76c6767b7ac5babe
* | Fix tee sinkGlenn Kasten2014-09-281-3/+5
|/ | | | | | | Note: this does not fix the bug below, but it helps to investigate the bug. Bug: 17578238 Change-Id: I0fd27a477b73ba0e1c5a658bdfad17c500f5dc67
* audioflinger: remove debug log.Eric Laurent2014-09-171-2/+0
| | | | | | | Remove debug log left by commit ab5cdbaf. bug: 17537746. Change-Id: I10f672f607f8e87caaa8228fc05eff8aee7dfa15
* Merge "audioflinger: fix pre processing effect leak" into lmp-devEric Laurent2014-09-158-37/+133
|\
| * audioflinger: fix pre processing effect leakEric Laurent2014-09-158-37/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a capture thread was closed, the effects attached to this thread were left dangling and the associated effect chain destroyed. When their last client was disconnected, the effects were not released properly from the effect library because the destruction process could not be completed without the effect being attached to a thread. A similar problem prevented a RecordTrack to be properly released if its client was destroyed after the capture thread. The fix consists in allowing the effect or record track to be properly released even if its parent thread cannot be promoted. Also save any effect chain still present on a closed capture thread in case a new client wants to reuse the effects on the same session later. Bug: 17110064. Change-Id: I5cd644daa357afd1f3548f9bcb28e6152d95fdb8
* | audioflinger: send mic mute command to all audio HALsEric Laurent2014-09-151-2/+7
|/ | | | | | | | | Mic mute should be sent to all audio HALs, not only the primary HAL as telephony can use capture devices on other HALs (e.g USB) Bug: 17321604. Change-Id: I658f6084d5b5cdc5a70784661d5cea0b6f81c3a9
* audioflinger: fix audio patch releaseEric Laurent2014-09-091-3/+3
| | | | | | | | Fix error in PatchPanel:releaseAudioPatch() causing the wrong patch handle to be passed to the audio HAL. Bug: 17368621. Change-Id: I037fd2e6273508c830414b5900d07c0178b96dae
* Make IPowerManager native conform to .aidl for onewayGlenn Kasten2014-09-051-4/+8
| | | | | | | | But provide a temporary escape hatch for AudioFlinger. This oneway option will be removed as soon as possible. Bug: 16408906 Change-Id: I058a50906af810787e444a96819cb781b7f639ad
* Merge "Restore the ability to build tee sink for debugging" into lmp-devGlenn Kasten2014-09-033-12/+16
|\
| * Restore the ability to build tee sink for debuggingGlenn Kasten2014-09-023-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | This changelist does not enable tee sink, but makes it possible to do so. Tee sink had suffered some bit rot since it is not built by default. Also fixes a crash for > 2 byte per sample or > 2 channels. Still does not write correct header for floating-point; that will be best solved by moving to libsndfile. Bug: 16990102 Change-Id: I8e92c588ccc513d7802d696fcfb324e815772df6
* | audio flinger: fix use of global effect bufferEric Laurent2014-09-021-0/+4
|/ | | | | | | | | | When float mixing format is enabled, audio effects use a specific buffer in 16 bit format. This buffer was not enabled when only global effects were present resulting in the mixer accumulating directly to the output sink buffer. Bug: 16202259. Change-Id: I3537d36c63196d97772f0ab22dd31d04dfa7fdd6
* Fix AudioMixer MONO muted track handlingAndy Hung2014-08-251-5/+21
| | | | | | | | Incorrect handling caused "stereo" mode to be used. Augmented error handling to print more debug info. Bug: 17208475 Change-Id: I5bcaf0ba5bd5a4f7d4885f8cce43bbf42e5f1e6b
* Fix memory access error due to race during fast track removalGlenn Kasten2014-08-181-7/+29
| | | | | Bug: 16205169 Change-Id: Ie15ec2a737b6ddd16b2d26030d01564ff70177f5
* Fix overruns when capturing with resamplingGlenn Kasten2014-08-121-15/+30
| | | | | Bug: 16658148 Change-Id: I2dd04b23a143e0948b299d408790e7a46b5a53b0
* Merge "Fix to support mono in effect buffer allocation." into lmp-devRicardo Garcia2014-08-111-1/+4
|\
| * Fix to support mono in effect buffer allocation.Ricardo Garcia2014-08-111-1/+4
| | | | | | | | | | | | | | | | Since effects are now enabled for recording, mono cases are possible and needed to be correctly allocated. Bug: 16917961 Change-Id: I760fc421f9f90fabb3f0deadd5f9dc61cd284371
* | Extend downsampling ratios greater than 2:1Andy Hung2014-08-112-4/+4
|/ | | | | | | | | Also improve robustness to choice of sampling rate or buffer size such that increasing either by 10x does not cause overflow. Bug: 12979141 Bug: 15933066 Change-Id: If7989bd745d1bee3bdf811b8b7c978543ccafb65
* audio policy: enable more than one sink per audio patch.Eric Laurent2014-08-081-29/+35
| | | | | | | | | | | | Allow creation of audio patches with more than one sink. More than one sink is enabled when: - Connecting an input device to output devices on the same audio HW module. - Connecting an output mix to output devices on the same audio HA module. All other patches are limited to one sink. Bug: 16879363. Change-Id: I95be6948ef29df64e51e5b8ace38c2db7f3e89f2
* Merge "Fix effect and mono sink handling." into lmp-devAndy Hung2014-08-072-5/+6
|\
| * Fix effect and mono sink handling.Andy Hung2014-08-082-5/+6
| | | | | | | | | | | | | | | | Do not permit mixing to mono sink in AudioFlinger. Allow effects on mono sink if not Mixer thread (e.g. Record). Bug: 16863095 Change-Id: I8b232fc1fb3f07bf017020c5d4f9ace644dec6d8
* | Merge "audio policy: add support for USB devices for voice call" into lmp-devEric Laurent2014-08-061-2/+2
|\ \
| * | audio policy: add support for USB devices for voice callEric Laurent2014-08-061-2/+2
| |/ | | | | | | | | | | | | | | | | Add possibility to use sink and source devices not on the primary HW module for voice calls (e.g. USB headsets). Bug: 15520724. Change-Id: Ib27db4ba759b6d91ea1104dc2e35c87733517b30
* | Merge "AudioSystem: add API to query audio HW sync source" into lmp-devEric Laurent2014-08-062-0/+22
|\ \
| * | AudioSystem: add API to query audio HW sync sourceEric Laurent2014-08-062-0/+22
| |/ | | | | | | | | | | | | | | | | | | | | Add a method to query from the audio HAL the HW sync source used for a given audio session. Modify audio policy to select a direct output with HW sync when requested. Bug: 16132368. Change-Id: I03038f9188f2d389f8a5fd76a671854013a4513e
* | Merge "MediaServer crashing and audio effects not applied to TTS." into lmp-devRicardo Garcia2014-08-061-1/+6
|\ \ | |/ |/|