summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy
Commit message (Collapse)AuthorAgeFilesLines
* am 23085662: am c73ca6ef: audio policy: fix remote mic captureEric Laurent2014-12-132-17/+43
|\ | | | | | | | | * commit '2308566236a3ff16197419ec226f956a295fe81a': audio policy: fix remote mic capture
| * audio policy: fix remote mic captureEric Laurent2014-12-122-17/+43
| | | | | | | | | | | | | | | | | | | | | | | | commit 275e8e9de introduced a regression for platforms overriding AudioPolicyManager::getDeviceForInputSource() method. Fixed by defining specific non virtual methods when overiding would break remote submix implementation. Bug: 18736417. Change-Id: Id4d0a6c48da987e6fb24422f2d61c7ab0fbfc921
* | am 0cbeaf83: am 8cffa91a: Merge "audio policy: suppport for dynamic source" ↵Eric Laurent2014-12-122-48/+101
|\ \ | |/ | | | | | | | | | | into lmp-mr1-dev * commit '0cbeaf83f7f50b5bc25a8dd7a08ea4e7c364c815': audio policy: suppport for dynamic source
| * audio policy: suppport for dynamic sourceEric Laurent2014-12-102-48/+101
| | | | | | | | | | | | | | | | | | | | | | Completed support for dynamic sources: - remote submix input device is dynamically connected/disconnected when corresponding AudioTrack starts/stops. Also do not create a duplicated output for mixes used by dynamic policies. Bug: 16006090. Change-Id: Ib5b5a2159fcac9d9f410a5a2f1c64d7ebad79f72
* | am 1546028a: am 1767df77: AudioPolicyManager: distinguish between mirroring ↵Jean-Michel Trivi2014-12-102-2/+8
|\ \ | |/ | | | | | | | | | | and rerouting * commit '1546028a2d02837f88f7ea1a4109e7649b665d2f': AudioPolicyManager: distinguish between mirroring and rerouting
| * AudioPolicyManager: distinguish between mirroring and reroutingJean-Michel Trivi2014-12-092-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the screen mirroring case, the notification manager queries the policy to see if media "is playing remotely": if yes, it will not request audio focus before playing a notification. This is the correct behavior for screen mirroring, but doesn't work when audio is rerouted to an external policy. This change consists in not reporting "remote" activity when playing to a mix of an external policy by looking at the address of the output on which playback is active for the given stream type. Bug 16009464 Change-Id: Iebbf5a8c738ab36c1cf2055e921c0a3472503125
* | Merge commit 'f5a968a0' into mmGlenn Kasten2014-12-104-1/+30
|\ \ | |/ | | | | Change-Id: Ifd30546c11def40ad483f27c9d7baa4008fcbac3
| * audio policy: binder calls for dynamic audio policy mixesEric Laurent2014-12-094-1/+30
| | | | | | | | | | | | | | | | | | Add binder calls to register and unregister dynamic mixes to AudioPolicyManager. Bug: 16009464. Change-Id: I4ef38166d0cfc88c984970969380d0cd6eb083ac
* | am c49d9cda: am 2dda40d6: Merge "audio policy: add support for custom mixes" ↵Eric Laurent2014-12-102-103/+433
|\ \ | |/ | | | | | | | | | | into lmp-mr1-dev * commit 'c49d9cda49dab8b7dd0376cf56476b3e1895d5c6': audio policy: add support for custom mixes
| * audio policy: add support for custom mixesEric Laurent2014-12-092-103/+433
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | am 427aca5b: am 18265202: Merge "audio policy: fix inifinite loop in ↵Eric Laurent2014-12-081-5/+2
|\ \ | |/ | | | | | | | | | | clearAudioPatches()" into lmp-mr1-dev * commit '427aca5bebaacfd5639b85661689ebd554bd0822': audio policy: fix inifinite loop in clearAudioPatches()
| * Merge "audio policy: fix inifinite loop in clearAudioPatches()" into lmp-mr1-devEric Laurent2014-12-061-5/+2
| |\
| | * audio policy: fix inifinite loop in clearAudioPatches()Eric Laurent2014-12-051-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | releaseAudioPatch() does not necessarily remove the audio patch from the list. Scan the list from the top down to avoid adjusting the index. Bug: 18621514. Change-Id: I58787154680f7cb1818509017835b1693d62190f
* | | am a9450bbc: am cbbe1ccc: Merge "audio policy: fix AudioPort parameter ↵Eric Laurent2014-12-081-0/+20
|\ \ \ | |/ / | | | | | | | | | | | | | | | checks" into lmp-mr1-dev * commit 'a9450bbc6274451bbb4241595d74d6ce9a4160d1': audio policy: fix AudioPort parameter checks
| * | Merge "audio policy: fix AudioPort parameter checks" into lmp-mr1-devEric Laurent2014-12-051-0/+20
| |\ \ | | |/ | |/|
| | * audio policy: fix AudioPort parameter checksEric Laurent2014-12-041-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | Accept any value for sampling rate, format or channel mask if the list of supported values is empty in the AudioPort. Bug: 18575607. Change-Id: I93e1942b89c630e3fee490799a8f8d79f7831ab7
* | | am 94d91778: am 18f2f90c: [FM] Fix Buganizer ID: 18456930 - FM radio audio ↵Hochi Huang2014-12-051-1/+1
|\ \ \ | |/ / | | | | | | | | | | | | | | | got routed to loudspeaker unexpectedly * commit '94d9177849bb68434d3839a9b0886e09489de7f2': [FM] Fix Buganizer ID: 18456930 - FM radio audio got routed to loudspeaker unexpectedly
| * | [FM] Fix Buganizer ID: 18456930 - FM radio audio got routed to loudspeaker ↵Hochi Huang2014-12-041-1/+1
| |/ | | | | | | | | | | | | | | | | unexpectedly https://partner-android-review.git.corp.google.com/#/c/187894/ Change-Id: I3f9175bbc302e382155e568e66b88400ec05ffa5 Signed-off-by: Hochi Huang <hochi.huang@mediatek.com>
* | am 390ef843: am f20c4356: Merge "AudioRecord: use audio attributes instead ↵Eric Laurent2014-11-276-94/+99
|\ \ | |/ | | | | | | | | | | of audio source." into lmp-mr1-dev * commit '390ef84373b7edd1397381f780ca235326357094': AudioRecord: use audio attributes instead of audio source.
| * AudioRecord: use audio attributes instead of audio source.Eric Laurent2014-11-256-94/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added AudioRecord constructor with audio attributes. Replaced AudioPolicymanager::getInput() by getInputForAttr(). No new functionality for now. Also: - Fixed warnings in AudioPolicyManager - Allocate audio session ID before calling getOutputForAttr() in AudioTrack. Bug: 16006090. Change-Id: I15df21e4411db688e3096dd801cf579d76d81711
* | am 5bf757cf: am 087eb332: Merge "audio policy: do not route accessibility ↵Eric Laurent2014-11-261-0/+15
|\ \ | |/ | | | | | | | | | | prompts to compressed output" into lmp-mr1-dev * commit '5bf757cfb8b43e5d92be95a8c700e4b7839f6730': audio policy: do not route accessibility prompts to compressed output
| * audio policy: do not route accessibility prompts to compressed outputEric Laurent2014-11-251-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | When a digital output (HDMI or S/PDIF) is configured with a non linear PCM audio format it is likely that the audio HAL or HW will not be able to mix other sounds with the main media stream being played. In this case, do not condider HDMI or S/PDIF as a valid route for accessibilty strategy so that accessibility prompts are always audible. Bug: 18067208. Change-Id: If20603a1dc1dc470f206f841308bed2b87daf21c
* | am bf14c62e: am 72bf901c: Merge "audio policy: new getOutputForAttr() ↵Eric Laurent2014-11-267-92/+213
|\ \ | |/ | | | | | | | | | | prototype." into lmp-mr1-dev * commit 'bf14c62e7973ed793a3b00c2c67beca4484c1c7a': audio policy: new getOutputForAttr() prototype.
| * audio policy: new getOutputForAttr() prototype.Eric Laurent2014-11-257-92/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | am fcf39e22: am 0f78eabb: fix the build.Eric Laurent2014-11-261-8/+1
|\ \ | |/ | | | | | | * commit 'fcf39e226ce318ae1e4bc042379aae1ecff560a6': fix the build.
| * fix the build.Eric Laurent2014-11-251-8/+1
| | | | | | | | Change-Id: Iab6b65327ae1adbf0b3a6da5a23b8107468f533e
* | am 1a475921: am 223fd5c9: audio: new routing strategies and stream typesEric Laurent2014-11-266-35/+130
|\ \ | |/ | | | | | | * commit '1a475921c0577a4650d1bbe40a85b732d1766939': audio: new routing strategies and stream types
| * audio: new routing strategies and stream typesEric Laurent2014-11-216-35/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | am 568689b1: am 3a2a32b5: Merge "AudioSystem: fix cross deadlock" into ↵Eric Laurent2014-11-212-8/+11
|\ \ | |/ | | | | | | | | | | lmp-mr1-dev * commit '568689b169d8b0ae2cc252b88602db5e5acaa604': AudioSystem: fix cross deadlock
| * AudioSystem: fix cross deadlockEric Laurent2014-11-202-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not hold gLockAPS when calling AudioPolicyService::registerClient() in get_audio_policy_service(). registerClient() will need to acquire the AudioPolicyService mutex and if at the same time a method called from AudioPolicyService (with mutex held) calls back into AudioSystem and get_audio_policy_service() a cross deadlock occurs. Same preventive fix for get_audio_flinger(). Use a separate mutex for notification client list in AudioPolicyService. This prevents deadlocking if registerClient() is called as a consequence of AudioFlinger calling back into AudioPolicyManager while executing a method with AudioPolicyService locked Bug: 18403952. Bug: 18450065. Change-Id: Ia832e41aede8bc6c843fc615508fbdd74e0863b5
* | am bfa77b5c: am 8cd37d67: Merge "audio policy: do not prevent routing to ↵Eric Laurent2014-11-181-4/+12
|\ \ | |/ | | | | | | | | | | A2DP when suspended." into lmp-mr1-dev * commit 'bfa77b5c687f217e26267693306aaa6cc8a63672': audio policy: do not prevent routing to A2DP when suspended.
| * audio policy: do not prevent routing to A2DP when suspended.Eric Laurent2014-11-171-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow A2DP sink selection even if A2DP is suspended. It is not because use of A2DP is temporarily disabled by SCO selection that the policy rule routing a given use case to A2DP should be altered. The source will be routed to A2DP but it will remain silent until suspend condition is cleared which is the purpose of suspend mode. Also make sure that accessibility prompts are audible while in call by forcing stream type to STREAM_VOICE_CALL. Fix inconsistent logic between AudioTrack::setStreamTypeFromAttributes() and AudioPolicyManager::getStrategyForAttr() Bug: 18095151. Change-Id: I1c75dd8288ed3dd494eb942060eac9c9660dca50
* | am 2b456a16: am f89f2ff4: Merge "audiopolicy: Update input device check in ↵Eric Laurent2014-11-171-3/+6
|\ \ | |/ | | | | | | | | | | checkInputsForDevice" into lmp-mr1-dev * commit '2b456a16ceeffd3d82dca71ce29c6479b8a11bff': audiopolicy: Update input device check in checkInputsForDevice
| * audiopolicy: Update input device check in checkInputsForDeviceEric Laurent2014-11-171-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - When an input device is disconnected, checkInputsForDevice clears dynamic fields of input profiles that are supporting the disconnected device. AUDIO_DEVICE_BIT_IN mask is missing while comparing with the supported input devices of a profile which is resulting in clearing wrong fields - Fix is to include AUDIO_DEVICE_BIT_IN in this comparison - also fix two other places where comparison with input device was not masked with AUDIO_DEVICE_BIT_IN. Bug: 18367045 Change-Id: Icc94b8353bc49567d8a6d6a75293c3b0dd42d83c
* | resolved conflicts for merge of e78a27ca to lmp-mr1-dev-plus-aospMarco Nelissen2014-11-171-1/+1
|\ \ | | | | | | | | | Change-Id: If10a9cc17245f95d5e10b1507445abbb4020670e
| * | Update calls to IInterface::asBinder()Marco Nelissen2014-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to use the new static version. Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a Conflicts: media/libmedia/IAudioFlinger.cpp media/libmedia/IMediaPlayer.cpp media/libstagefright/CameraSource.cpp
* | | am 0ef3210f: am 14a74010: Merge "Include AudioPolicyInterface.h only when ↵Chih-Hung Hsieh2014-11-152-0/+3
|\ \ \ | |/ / | | / | |/ |/| | | | | needed." * commit '0ef3210f77799b5e0086c7a0f9244aefdf403805': Include AudioPolicyInterface.h only when needed.
| * Include AudioPolicyInterface.h only when needed.Chih-Hung Hsieh2014-11-142-0/+3
| | | | | | | | | | | | | | | | | | | | Both legacy and non-legacy AudioPolicyInterface define extern "C" functions createAudioPloicyManager and destroyAudioPloicyManager. Standard C++ does not allow overloading of extern C functions. g++ did not catch this problem but clang++ does. Change-Id: I80869cdb26e7721777e53d4eff71c5c733044abf
* | Support speaker routing for FLAG_BEACONJean-Michel Trivi2014-10-312-9/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for routing audio stream to the speaker when audio attributes carry the FLAG_BEACON value: - associate streams with FLAG_BEACON to the up-to-now unused STREAM_TTS ("Transmitted Through Speaker"). The remapping happens in AudioTrack. - AudioPolicyManager: define new strategy for handling the Beacon behavior, that only goes to speaker. Define new volume curves for STREAM_TTS that are not silence only for the speaker device category. Keep ref count of other streams and never play Beacon streams when anything else is playing: either don't start playback if something else is playing, or unmute STREAM_TTS when it's allowed to play and mute when it's done. - Take into account muting latency when starting an output. Bug 15415971 Change-Id: I26539c7ec1a486accd85bbeb1623e9c7d3a1192f
* | audio policy: fix commit dea1541fEric Laurent2014-10-302-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | Fix return types in early returns added by commit dea1541f in AudioPolicy binder call methods. Also fix former similar mistakes found nearby. Bug: 18001784. Bug: 18002005. Change-Id: I088c6029ca04e2c2c2f78e560c9cb6b9576dd88f
* | Merge "audio policy: validate stream type received from binder calls." into ↵Eric Laurent2014-10-302-0/+42
|\ \ | | | | | | | | | lmp-mr1-dev
| * | audio policy: validate stream type received from binder calls.Eric Laurent2014-10-282-0/+42
| | | | | | | | | | | | | | | | | | Bug: 18001784. Bug: 18002005. Change-Id: I8efa674dceff5a6e10251b1c7a55e9bb2d532395
* | | Merge "Always use an address for remote submix" into lmp-mr1-devJean-Michel Trivi2014-10-281-4/+27
|\ \ \
| * | | Always use an address for remote submixJean-Michel Trivi2014-10-271-4/+27
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | audio policy: fix output device command after clearing audio patchEric Laurent2014-10-281-4/+8
|/ / | | | | | | | | | | | | | | Make sure that a valid audio patch is created again on an output stream following the disconneciton and reconnection of the same output device. Bug: 18144611. Change-Id: I72387ad8e93f8fb2571da2a6c58a6e167ac7fc4d
* | audio policy: fix multiple device volumeEric Laurent2014-10-271-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Whem multiple devices are selected by a strategy, apply volume to all these devices when one of them is changed by setStreamVolumeIndex() API. Also only consider devices supported by current output profile in checkDeviceMuteStrategies() to avoid muting a stream because of devices connected to another output stream. Bug: 17507571. Change-Id: I83ef9fb7f294214d30f7f890db44c64ece3be387
* | am 7de5ac1f: audio policy: fix effect handle leakEric Laurent2014-10-211-36/+41
|\ \ | | | | | | | | | | | | * commit '7de5ac1f067ec61f7ea424d5534cfd40987b11fa': audio policy: fix effect handle leak
| * | audio policy: fix effect handle leakEric Laurent2014-10-211-36/+41
| |/ | | | | | | | | | | | | | | Fix ref counting error in AudioPolicyEffect::addInputEffects() and addOutputSessionEffects() Bug: 17675112. Change-Id: I5267d1024a585919f66ead83662e57b78ba53540
* | am a2d4a6da: audio policy: Fix for voice call audio lossHaynes Mathew George2014-10-161-0/+20
|\ \ | |/ | | | | | | * commit 'a2d4a6dac432f0c4f543d79b9a63c55ae91f81d6': audio policy: Fix for voice call audio loss
| * audio policy: Fix for voice call audio lossHaynes Mathew George2014-10-151-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Audio Policy service filters out one of the create patch commands when it finds two pending commands with the same patch handles. Due to this routing command is not received to audio HAL and the voice call set up fails. Fix this by filtering create patch commands only when they are issued on the same output. authored-by: Karthik Reddy Katta <a_katta@codeaurora.org> Bug: 17787282 Change-Id: If36f0ab71e9b72d6a8eb61d31f762bc5e1683b89