summaryrefslogtreecommitdiffstats
path: root/audio/AudioPolicyManagerBase.cpp
Commit message (Collapse)AuthorAgeFilesLines
* am e714af92: audio policy: use legacy stream type definitionsEric Laurent2014-11-261-2/+2
|\ | | | | | | | | * commit 'e714af927c1e87a488178315b78b0c12c0ec9db9': audio policy: use legacy stream type definitions
| * audio policy: use legacy stream type definitionsEric Laurent2014-11-111-2/+2
| | | | | | | | | | | | | | | | New stream types have been added, so make sure that legacy implementation uses legacy stream definitions Bug: 18067208 Change-Id: I8042ebe9ac3e7eda380b8c91650f2ac16b44bc34
* | am b4b0608b: Merge "legacy audio policy: check string parameters before use" ↵Glenn Kasten2014-11-071-0/+9
|\ \ | |/ | | | | | | | | | | into lmp-mr1-dev * commit 'b4b0608b0560a7cad27aeec0af8b1728b971aa3a': legacy audio policy: check string parameters before use
| * legacy audio policy: check string parameters before useGlenn Kasten2014-11-061-0/+9
| | | | | | | | | | Bug: 18262893 Change-Id: Iee6e59db7ffae5612256ba1f74aba62bc8cf12db
* | am 39b3abc0: Merge "audio: add mechanism to re-route nullified audio"Eric Laurent2014-07-231-1/+17
|\ \ | |/ |/| | | | | * commit '39b3abc0ca227d72f66bb47a75cec2acfb4d6de0': audio: add mechanism to re-route nullified audio
| * audio: add mechanism to re-route nullified audioVincent Becker2014-07-161-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a race condition whereby two requests attempt to change the audio stream (and interrupt each other). For example, a user space app makes a call through the audio API and before completion, a kernel function such as jack removal is detected and is serviced. In this case, you have a nullified audio route that needs to be re-routed. In order to know a routing update is needed, a boolean member mForceRouting has been introduced to enforce routing for the next attempt to set audio output with a non-null device. Change-Id: Ia0aa2f27fe63c39f0980dec2e1e79dbc26b81e56 Author: Vincent Becker <vincentx.becker@intel.com> Signed-off-by: Vincent Becker <vincentx.becker@intel.com> Signed-off-by: Zhi Jin <zhi.jin@intel.com> Signed-off-by: Shuo Gao <shuo.gao@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com> Signed-off-by: Jack Ren <jack.ren@intel.com> Signed-off-by: Robert Beatty <robert.m.beatty@intel.com>
* | Enabling USB Device and Android Device Vol inc/dec functionalityPaul McLean2014-06-271-3/+1
| | | | | | | | | | | | | | for USB Audio Output Bug: 13747844 Change-Id: I53b7db8102fd2ed24014c338ea5e7290cda8b2f3
* | audio policy: add parsing for more audio formatsEric Laurent2014-06-191-0/+5
| | | | | | | | | | Bug: 9428304. Change-Id: Ie3c9827ed78703a1b2d9699e38ce628f3055138b
* | Merge "handle in and out audio device connection separately"Eric Laurent2014-05-301-9/+1
|\ \
| * | handle in and out audio device connection separatelyEric Laurent2014-05-291-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | AudioService now indicates in and out device connection separately in case of combined devices like wired headset or BT SCO headset. Change-Id: Id20e02bb351cc732ceddccf597742ced049671a8
* | | AudioPolicyManagerBase: Add support for A2DP sink inputMike Lockwood2014-05-281-5/+17
|/ / | | | | | | Change-Id: I500d1f2f8f2199c674b289cf671b7f863a7d02ee
* | Update policy handling for USB inputsPaul McLean2014-04-251-37/+265
| | | | | | | | Change-Id: Ib2e531f115f8bd1d5f290094032f3f4a4753e726
* | resolved conflicts for merge of 75402fdb to masterColin Cross2014-04-241-13/+16
|\ \ | |/ | | | | Change-Id: Ie85a3c7d498d7685738190267916e9a205cc469e
| * audio: allow compiling for 64-bitColin Cross2014-04-181-13/+16
| | | | | | | | | | | | | | | | Fix a few 64-bit warnings and set -Wno-unused-parameter, which makes the directory warnings-clean on 32-bit and 64-bit. Remove LOCAL_32_BIT_ONLY. Change-Id: I688b31683f1a6598419866d9b7b6bc27a7056f4a
* | Initial implementation of USB Audio output.Paul McLean2014-03-281-73/+85
| | | | | | | | Change-Id: I4e2517233487ca7487ed7948a974fc2cc6c41190
* | am e6c7127e: am be39c1e4: Merge "audio policy : add ↵Glenn Kasten2014-03-171-0/+1
|\ \ | |/ | | | | | | | | | | AUDIO_DEVICE_IN_USB_DEVICE to sDeviceNameToEnumTable" * commit 'e6c7127ef2491ddeb995ffb48843fda4e30ff9ff': audio policy : add AUDIO_DEVICE_IN_USB_DEVICE to sDeviceNameToEnumTable
| * audio policy : add AUDIO_DEVICE_IN_USB_DEVICE to sDeviceNameToEnumTablePeter Yoon2014-03-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | This commit adds AUDIO_DEVICE_IN_USB_DEVICE to sDeviceNameToEnumTable[], It had to be added here, when it was defined in system/core/include/system/audio.h AudioPolicyManagerBase::loadHwModule() fails to parse device type of AUDIO_DEVICE_IN_USB_DEVICE in audio_policy.conf. By applying this commit, AUDIO_DEVICE_IN_USB_DEVICE can be used for audio policy customization. Change-Id: I0165956334d7105129dca4c746372dbca0d9e324
* | Add more PCM formats to audio_policy.conf parserGlenn Kasten2014-03-071-0/+4
| | | | | | | | | | | | In particular, we need AUDIO_FORMAT_PCM_24_BIT_PACKED. Change-Id: I28abe8466024bdd4d1edbb4281c6472d45a2d94f
* | Rename setStreamOutput to invalidateStreamGlenn Kasten2014-02-281-3/+1
| | | | | | | | | | | | And simplify by removing the unused I/O handle parameter 'output'. Change-Id: Ie9c4df17a7378066312d4ed8790fda7a9125c95e
* | audio_policy: clean up dumpsysPatrick Tjin2014-02-061-2/+2
| | | | | | | | | | | | Remove NUL characters from audio_policy's dump output Change-Id: If591473dbe3e5adbc34dbbdb0d552b329f19eb6a
* | audio policy: send config params when opening outputEric Laurent2014-01-081-28/+31
| | | | | | | | | | | | | | | | | | When a new output stream is opened upon device connection, always send mandatory configuration parameters (A2DP device address, ALSA card and device number etc...) immediately after opening the output. Change-Id: Id1fc1d99d3b30e2ef907dcb231a6a9e70560ecae
* | Continued cleanup of audio policy's use of audio_format_tGlenn Kasten2013-12-201-15/+15
| | | | | | | | Change-Id: I6ef6ec50cd5e0e751dc5063af1f7d8882588a89b
* | Use audio_channel_mask_t in AudioPolicyGlenn Kasten2013-12-161-16/+16
| | | | | | | | | | | | | | | | | | | | Also: - use %x format for logging channel masks - use AUDIO_CHANNEL_IN_* constants from system/audio.h instead of AudioSystemLegacy.h symbols - remove redundant casts - use "channelMask" instead of "channels" to avoid possible confusion with channel counts Change-Id: If05d6b1cae5cf1b560cd53a93ae9e592b719ec9e
* | Use audio_format_t in AudioPolicyGlenn Kasten2013-12-101-5/+5
| | | | | | | | | | | | Also remove unnecessary default parameters Change-Id: I553c01a98b8c2a3f3fd2ac98724aded3ad3c3022
* | Fix typos in logsGlenn Kasten2013-11-221-6/+6
|/ | | | Change-Id: Ie2e49d108a4dd33725296c96aaf9458585b81d32
* Define and use DRC-specific volume curves when applicableJean-Michel Trivi2013-11-141-3/+35
| | | | | | | | | | | | Add support for property defining whether a DRC on the speaker path is enabled and will boost soft sounds. Define new volume curves with more attenuations than existing ones to compensate for DRC-induced boost on sonification sounds to provide a more "linear" control to the user over the applied volume. Bug 11600699 Change-Id: If23dd097a8b9b5ebb61e75dd8512ff75e63ba899
* audio policy: fix gapless playback when effects enabledEric Laurent2013-10-141-5/+40
| | | | | | | | | | | | Do not allow offloading if one non offloadable effect is enabled. This prevents from creating an offloaded track and tearing it down immediately after start when audioflinger detects there is an active non offloadable effect. Not doing so breaks gapless playback because AwesomePlayer will always be able to open an offloaded track which will not be compatible with the previous PCM track and Audiosink::open() will not recycle it. Bug: 11181933. Change-Id: I6d163806849d9093b9ec701ba8e8c1ccb658e3c8
* audio policy: fix direct output selectionEric Laurent2013-10-071-46/+45
| | | | | | | | | | commit a527ffd broke the selection of an available direct output profile in getProfileForDirectOutput(). getProfileForDirectOutput() should check for direct output profiles regardless of the flags provided to getOutput(). Bug: 11051912. Change-Id: I4a84734331bfed03d6024ea1c2e8776c27d0b28f
* audio policy: fix DTMF tones volume while in callEric Laurent2013-10-031-1/+11
| | | | | | | | | When voice call stream volume is at 0, DTMF are not heard at all. DTMF volume should follow the behavior of voice call volume which is never completely muted. Bug: 10932676. Change-Id: Iaf0e33284be75b00516a837907e66be3123e5331
* remove audio HAL warning when inserting a headsetEric Laurent2013-09-301-1/+7
| | | | | | | | | A valid offload info structure must be provided when opening an offload output stream in checkOutputsForDevice() upon headset insertion. Bug: 8174034. Change-Id: Id800a206536e5ce979febf89747a51db581c53b6
* audio policy: add support for audio effect offloadEric Laurent2013-09-171-20/+64
| | | | | | | | | | | Add rules to select the appropriate output for global effects. Move global effects if needed when an offloaded output is created or released. Bug: 8174034. Change-Id: I0bbd8e9f8aa717f672462dd74ba0d01eaef1fda7
* AudioPolicyManageBase changes to enable HOTWORD audio sourceEric Laurent2013-09-091-8/+22
| | | | | | | | | - This change enables HOTWORD audio source to be preempted by any other audio source Bug: 10640877. Change-Id: I6f7acbe95a6521306db70ad73260d2ba7b38b940
* audio policy: remove verbose logging.Eric Laurent2013-08-301-1/+1
| | | | Change-Id: I268935bd8f7e58f90c698c098686a04681b43887
* audio policy: disable audio offloading with videoEric Laurent2013-08-301-2/+9
| | | | | | | Do not enable offloading of audio decompression when playing video. Change-Id: I6ee8b59370219f5ef810a99a27ba4a1cf222b55b
* audio policy: allow virtual input even if there are active inputsChong Zhang2013-08-241-1/+1
| | | | | | Bug: 10460751 Change-Id: Ic6fcd14162e9c6e03366d887063321e21fcf14cd
* Automatically enable/disable remote submix when input started.Jeff Brown2013-08-191-0/+13
| | | | | | | | When recording from the audio submix begins, enable the remote audio submit output device. When it ends, disable it. Bug: 10265163 Change-Id: Ia0dc2e20623bb834d06561469ce856688991243b
* Code changes for audio offload supportRichard Fitzgerald2013-07-241-40/+104
| | | | | | | | | | | | - Share existing offload output if compatible instead of creating a new one. Hardware has limited number of offload channels (possible only 1) so we must use as few as possible - Changes to routing handling for offloaded outputs Change-Id: I11111d8f504828595bd8dbf66444cbd1202e7192 Signed-off-by: Eric Laurent <elaurent@google.com>
* am 8e7e4254: am e92d6238: audio policy: apply default device volumeEric Laurent2013-07-151-1/+1
|\ | | | | | | | | * commit '8e7e42547116b1d5f49118ba41946b2906ad3936': audio policy: apply default device volume
| * audio policy: apply default device volumeEric Laurent2013-07-151-1/+1
| | | | | | | | | | | | | | | | | | Make sure that we apply default device volume to active outputs in case no specific volume for selected device is received afterward. Bug: 9760269. Change-Id: I216de40396e1075e77493c97e8b192cd3a31d546
* | Add audio policy API changes for audio offloadRichard Fitzgerald2013-06-271-3/+14
|/ | | | | | | | | | | | Changes to the API of audio policy for audio offload support: - Add isOffloadSupported() function - Add OUTPUT_FLAG_OFFLOAD - Extend AudioOutputDescriptor to include a sharing count for direct outputs - Pass audio_offload_info_t when opening output streams Change-Id: I5ad26418fdb286eb7ae299d586dd1fd525d48ab9 Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Eric Laurent <elaurent@google.com>
* audio policy: fix device selection in startInput()Eric Laurent2013-05-171-0/+4
| | | | | | | | | | | Check again input device selection when capture starts in case conditions have changed since the input stream was opened. This is related to but does not fix issue 8761558. It makes the selection of BT SCO device consistent. Bug: 8761558 Change-Id: I386b638e9c3238711e16fb848449af561624359e
* audio policy: reuse direct output when possibleEric Laurent2013-04-041-11/+36
| | | | | | | | | | | | | | | | | | | | | Modified getOutput() logic to not systematically open a new direct output when a profile matches a request. This causes a problem when transitioning between two multichannel tracks as the audio HAL will most of the times only support one direct output stream open at a time. Instead, reuse an open output if all the parameters match or force close the output before reopening it. Also modify releaseOuput(): - close a direct output only if no client is using it anymore - call closeOutput() instead of removing the output from the open output list: this factors in code executed when closing an output stream. Bug 8388941 Change-Id: Ic3d3beb21063622ddf57a5b932f93d56f2986f54
* audio policy: fix music glitch when starting callEric Laurent2013-03-251-67/+68
| | | | | | | | | | | | | | | When answering a call in silent mode, music playing over A2DP was not immediately muted by current audio policy manager logic. The fix consists in muting media strategy on all output streams immediately when entering in call. Also add methods to AudioOutputDescriptor to report recent global, per strategy and per stream activity. Bug 8315512 Change-Id: I4a90eb05db50e4f22374d02b1e647e8662f6bec6
* audio policy: fix in call capture deviceEric Laurent2013-03-051-2/+8
| | | | | | | | Allow use of default capture device when AUDIO_SOURCE_VOICE_UPLINK is specified and the platform does not support AUDIO_DEVICE_IN_VOICE_CALL. Change-Id: Ibbc314f60c91e5a0fa75d57878f2d2a96ef2d83b
* audio policy: fix music glitch with touch soundsEric Laurent2013-03-041-3/+12
| | | | | | | | | | | | | | | | | There is a brief music interruption when a touch sound is played the first time after the headset insertion. This is due to a bug in audio policy manager logic to prevent volume bursts while changing device while music is playing. The fix consists in muting music only on current output stream when changing device, not all output streams. Also prevent unecessary device change if the requested device is not supported by the output stream profile. Bug: 8301565 Change-Id: I00daab19bbdda10ca856a05fa32a1e333e1b9469
* Merge "audio policy: fix in call audio setup delay"Eric Laurent2013-02-111-5/+5
|\
| * audio policy: fix in call audio setup delayEric Laurent2013-02-111-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | There is a delay inserted by audio policy manager before switching device when entering in call mode to allow music playback to be muted before the device actually switches. This delay can be significant when high latency outputs (e.g. deep buffers) are present and should not be applied if the output is not active. Issue 7612431. Change-Id: I04b666769033dbfdc861752b030d3f7bdffe9435
* | Identify remote stream activity, used for notification routingJean-Michel Trivi2013-02-111-1/+25
|/ | | | | | | | | | | | Add support for checking remote stream activity. Don't route notifications like media when media active remotely. Add remote stream activity query in audio policy HAL. Bug 7485803 Change-Id: Ifb722c7f9ffbfbdc877fec5156bcfc09bec40651
* audio policy: added front + back micEric Laurent2013-01-221-0/+1
| | | | | | | Added definition to parse front + back mic from input descriptors in audio_policy.conf file. Change-Id: I9ebdeac664e12104589a52d15acbbfc4db787923
* Merge "audio policy: fix notification start delay"Eric Laurent2012-11-081-3/+16
|\