summaryrefslogtreecommitdiffstats
path: root/include/hardware_legacy/AudioPolicyManagerBase.h
Commit message (Collapse)AuthorAgeFilesLines
* am e714af92: audio policy: use legacy stream type definitionsEric Laurent2014-11-261-1/+1
|\ | | | | | | | | * commit 'e714af927c1e87a488178315b78b0c12c0ec9db9': audio policy: use legacy stream type definitions
| * audio policy: use legacy stream type definitionsEric Laurent2014-11-111-1/+1
| | | | | | | | | | | | | | | | New stream types have been added, so make sure that legacy implementation uses legacy stream definitions Bug: 18067208 Change-Id: I8042ebe9ac3e7eda380b8c91650f2ac16b44bc34
* | am 39b3abc0: Merge "audio: add mechanism to re-route nullified audio"Eric Laurent2014-07-231-0/+1
|\ \ | |/ |/| | | | | * commit '39b3abc0ca227d72f66bb47a75cec2acfb4d6de0': audio: add mechanism to re-route nullified audio
| * audio: add mechanism to re-route nullified audioVincent Becker2014-07-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Update policy handling for USB inputsPaul McLean2014-04-251-3/+15
| | | | | | | | Change-Id: Ib2e531f115f8bd1d5f290094032f3f4a4753e726
* | audio policy: send config params when opening outputEric Laurent2014-01-081-1/+2
| | | | | | | | | | | | | | | | | | 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
* | Use audio_channel_mask_t in AudioPolicyGlenn Kasten2013-12-161-5/+5
| | | | | | | | | | | | | | | | | | | | 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-10/+9
|/ | | | | | Also remove unnecessary default parameters Change-Id: I553c01a98b8c2a3f3fd2ac98724aded3ad3c3022
* Define and use DRC-specific volume curves when applicableJean-Michel Trivi2013-11-141-0/+5
| | | | | | | | | | | | 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-0/+2
| | | | | | | | | | | | 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: add support for audio effect offloadEric Laurent2013-09-171-1/+4
| | | | | | | | | | | 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
* audio policy: extend min duration for offloadEric Laurent2013-09-091-1/+1
| | | | | | | | | Extend minimun duration of offloaded audio content to 1 minute to avoid offloading short clips like TTS generated files. Bug: 8174034. Change-Id: Ied21557c300af4b27d99388e069576e36804087f
* Code changes for audio offload supportRichard Fitzgerald2013-07-241-10/+4
| | | | | | | | | | | | - 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>
* Add audio policy API changes for audio offloadRichard Fitzgerald2013-06-271-1/+5
| | | | | | | | | | | | 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: reuse direct output when possibleEric Laurent2013-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | 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-5/+8
| | | | | | | | | | | | | | | 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
* Identify remote stream activity, used for notification routingJean-Michel Trivi2013-02-111-1/+5
| | | | | | | | | | | | 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: fix notification start delayEric Laurent2012-11-071-0/+1
| | | | | | | | | | The mechanism delaying notifications in case of muliple active outputs with long latencies must take into account recently paused audio tracks. Bug 7400428. Change-Id: I4ac9dfac81336e33f475b4f28df82713707d0c46
* audio policy: tune voice/video chat volumesEric Laurent2012-10-171-0/+2
| | | | | | | | | Add new volume curves for VOICE_CALL stream type to improve voice/video chat volume on speakers. Bug 7346643. Change-Id: Ib282a97570d2234deec6b58391bdfc45846d9cc0
* AudioPolicyManager supports querying active record sourcesJean-Michel Trivi2012-10-101-0/+1
| | | | | | | | | Add support for querying whether there is currently a recording underway from the specified audio source. Bug 7314859 Change-Id: I8894845b176241134870af5df2bebc5ef27e4de4
* Support audio recording while remote submix is activeJean-Michel Trivi2012-09-181-1/+4
| | | | | | | When evaluating if an audio record is active, do not count inputs opened on "virtual" devices, such as remote submix, as active. Change-Id: If19c321cf673e3bdf4c3f81e73c163190df7c21e
* audio: new audio devices enumsEric Laurent2012-09-071-0/+2
| | | | | | | | | | Changes for new audio devices enums: - legacy audio HAL wrapper provides conversion between new and old device enums. It exposes a rev 2.0 audio device API to the audio framework and allow legacy implementation to use old device enums. - AudioPolicyManager: use standard enum value for no device (0). Change-Id: I855d72291d672cdd8a6641bedb228634a54b7d9d
* Update Audio Policy Manager for remote submixJean-Michel Trivi2012-09-071-0/+1
| | | | | | | | | | | | Define a new forced mode to route media to remote submix. Update media routing rules according to mode. Modify device connection management for remote submix. Note that this CL doesn't implement changes to not prevent audio recording when WFD is on, as audio recording is currently limited to one input. Change-Id: I458fe1802705da2d091ff82e536dc3e7f092f291
* Update AudioPolicyManagerBase to only use audio_devices_tJean-Michel Trivi2012-08-241-2/+2
| | | | | | | | | | | | The AudioPolicyManagerBase implementation was using some device enum values from AudioSystemLegacy.h, of type audio_devices, and some from /system/audio.h, of type audio_devices_t. Now only uses audio_devices_t, and associated functions to inspect what audio device type they correspond to. Added #define to represent "no audio device" to clarify code. Removed unused variable in AudioPolicyManagerBase::startOutput() Change-Id: Ibec311dac550d6a806397377206a43bc708914c0
* Remove unused member variables in AudioPolicyManagerBaseJean-Michel Trivi2012-08-201-2/+0
| | | | | | | | The fields for the lists of input and output IOProfile are not used in the AudioPolicyManagerBase class. Those are actually stored inside each HwModule instance. Change-Id: Iebb9fa5b7599a74013fd785a87de692890a89758
* effect_descriptor_t const correctnessGlenn Kasten2012-07-241-2/+2
| | | | Change-Id: I734155d4cebb22b180f25290332c7c48be1e2b36
* audio policy: fix HDMI hot plugEric Laurent2012-06-211-5/+10
| | | | | | | | | | | When an HDMI sink is connected it is possible that a direct output is made available for multichannel audio. In this case, the list of outputs available to reach the HDMI device after the connection is different from before. checkOutputForStrategy() must take this into account in order to invalidate tracks so that they can be re connected to the multi channel output if necessary. Change-Id: Id0baeb51688eba8017fe96bf92aaac52eb8e0f59
* audio policy: improve support for direct outputsEric Laurent2012-06-041-3/+7
| | | | | | | | | | | Add the capability to query supported parameters for direct outputs after a device is connected. This allows to dynamically update the output profile for devices like HDMI where the capabilities depend on the connected sink. Also added very verbose log mode for volume and mute. Change-Id: I1d4ba8e7dbc3e1af883582857ce93240441e551c
* audio policy: fix in call volume problem.Eric Laurent2012-05-151-2/+10
| | | | | | | | | | | | | | | | When switching audio path, it is sometimes required to temporarily mute certain streams to avoid glitches. The unmute command is sent with a delay but the volume applied when unmuting is computed according to the state at the time of mute. If the device selection changes after the delayed unmute is programmed the new volume will not correspond to the new device. setStreamMute() now accepts a device selection as input parameter which is used instead of current device for volume computation. Bug 6497819. Change-Id: I355ebf9e1afe814fa5c2723bda9c40e58f921b46
* system and UI sounds volume policyEric Laurent2012-04-261-2/+4
| | | | | | | | | | | | | Added specific volume curves for AUDIO_STREAM_SYSTEM, AUDIO_STREAM_ENFORCED_AUDIBLE and AUDIO_STREAM_DTMF. Volume for these streams tracks AUDIO_STREAM_RING on phones and AUDIO_STREAM_MUSIC on tablets but is contrained in the range -24dB to -6dB on speaker and -24dB to -12dB on headset. STRATEGY_ENFORCED_AUDIBLE routing policy is now the same as STRATEGY_MEDIA in countries where not enforced. Change-Id: If58d96559bfe2bbff4cd94c631d5933bd940778e
* audio_policy: set some reasonable defaults if audio_policy.conf is not foundDima Zavin2012-04-241-0/+1
| | | | | Change-Id: I25f7407c34b3032d4e77a27a4ac47b648098d9b0 Signed-off-by: Dima Zavin <dima@android.com>
* audio policy: volume burst when switching deviceEric Laurent2012-04-231-1/+2
| | | | | | | | | | | | | | The addition of the per device volume feature has introduced a problem where a volume burst can be heard in the headphones just after insertion if the speaker volume is much higher than the headphones volume. Added a temporary mute of the output when switching device to force volume ramp to 0 and back up to new volume. Issue 5984108. Change-Id: I5c9ffbbcadd12d25c78cc2614d351346b8186c55
* audio policy: add support for deep audio buffersEric Laurent2012-04-201-3/+8
| | | | | | | | | | Added definitions for parsing deep buffer flags in output profiles. Make sure that sound start is delayed enough to allow duck/mute effect to apply before starting a notification on an output with lower latency. Change-Id: I1578e245da19d1a0f9ec62a2ea6dddaf82ea282b
* rename audio policy flagsEric Laurent2012-04-181-6/+6
| | | | Change-Id: Ic42eba3432671f651c9703a07fe7b429a8ec0dff
* audio policy: added rules for USB audio devicesEric Laurent2012-04-061-0/+3
| | | | Change-Id: If712b0c7fcf281d66d34614529f3433e56e058fb
* audio policy: load audio hw modulesEric Laurent2012-04-031-19/+43
| | | | | | | | | | | | | Audio hw modules are now loaded according to configuration data read from audio_policy.conf. They are not loaded anymore from a hardcoded list in AudiFlinger. Output and input streams are opened on the hw module by which they are exposed. Also removed obsolete "acoustics" flags for input streams. Change-Id: I8dc658cc83890d3ac7d5e36c372a03732aa5b0c4
* audio policy: use configuration fileEric Laurent2012-04-031-27/+80
| | | | | | | | | | | | | | | | The audio policy manager implementation now reads a configuration file at boot time that contains descriptors for available audio hardware modules and for each module the profiles of available inputs and outputs streams. The configuration file path on the target is: /system/etc/audio_policy.conf. A default configuration file is given that defines a basic configuration with one primary audio hw module capable of playback and capture. Each platform or device should have its own audio_policy.conf file. Also removed default value of fromCache argument of getDeviceForStrategy() and getNewDevice() methods. Change-Id: I0c773d2331508bbc787f89b123dd6a7b8c10d459
* Only duplicate notifications when no media is playingJean-Michel Trivi2012-04-021-0/+7
| | | | | | | | | | | | Map the NOTIFICATION stream type to a new strategy, named STRATEGY_NOTIFICATION_RESPECTFUL, which differs from STRATEGY_NOTIFICATION in that, when media is playing, the notifications will use the same output as the MEDIA strategy. This will results in the notifications not being duplicated on the speaker when a headset is in use for media playback. Change-Id: I032be0e2d383c69b5b6c912d7174753f5572c4b4
* audio policy: use audio_devices_t when appropriateEric Laurent2012-03-081-20/+22
| | | | Change-Id: I0b4e2ff705fce96b40fdda28b1bc4b514438bec6
* audio policy: spaced comments in header fileEric Laurent2012-03-071-0/+28
| | | | Change-Id: Ie72dcb9e33afb217bb7e37081500a7fc53d7a047
* audio policy manager: more generic A2DP impl.Eric Laurent2012-03-071-20/+43
| | | | | | | | | | | | | | | | | | | | This change makes support for A2DP related audio policy more generic: -removed WITH_A2DP compilation switch -use output profile descriptors listing the parameters (sampling rate, format...) devices and attributes (low power, tunneling...) for each available output. All the behavior specific to A2DP is derived from the A2DP output profile descriptor. - removed obsolete a2dpUsedForSonification() method. This is a first step towards a more generic support for different audio hardware modules (USB, HDMI) and output streams supporting different combinations of parameters (sampling rate, format...) and attributes (low power, tunneling...). Ultimately, the hw modules and output descriptors will loaded from a configuration file. Change-Id: Ife3e49e1afbcb72613bfc8ce38919bb087ca85ea
* Audio policy HAL set_ringer_mode is deprecatedGlenn Kasten2012-01-181-2/+0
| | | | Change-Id: I66ef40ed381151ba61debe20edaa53bece0cc139
* audio policy manager: stream volume per deviceEric Laurent2012-01-171-6/+12
| | | | | | | | | | | | | Improve volume management by keeping track of volume for each type of device independently. AudioPolicyManagerBase now keeps track of stream volumes for each device and apply volume according to current device selection. Methods to set and get stream volume now specify the device class. A value for "default" device is always present for each stream and is used if a device is selected and no specific volume was ever set for this device. Change-Id: I06d8f43aa151a09014f7e47e81304c73ff82e9f8
* Force camera shutter sound to speaker in Japan.Eric Laurent2011-11-011-0/+1
| | | | | | | | | | | Make sure that camera shutter sound is output to device speaker also while in call. Added a new strategy for enforced audible stream to address this case as the routing policy is now different from sonification strategy. Issue 5548406. Change-Id: I2de39dfaef7d90e3804b238b1379f0f59b75e985
* Fix issue 5440852: Youtube volume is too small ...Eric Laurent2011-10-181-3/+24
| | | | | | | | | | | | When no DRC is applied by the platform when playing over the device speaker, faint audio signals are not boosted and barely audible until the media volume is raised to about one fourth of the range. Compensate this by applying a different volume curve for music stream when the speaker is selected. Change-Id: I03f316fb28150eda50b05dfa12310701e2674648
* Issue 5256795: Phone ringtone volume is too lowEric Laurent2011-09-121-8/+16
| | | | | | | | | | | | Modified the volume curve for ringtones and notifications in audio policy manager. The first volume step now corresponds to -30dB instead of -50dB thus making ringtone much more audible for low volume settings. Also made a generic implementation of volume curves according to audio policy strategies. Change-Id: Ieb7916ba2e53c2a10a47efec82814cabed21c48b
* AudioPolicyManager: register effect CPU on enableEric Laurent2011-08-111-0/+4
| | | | | | | | Audio effect CPU usage is now registered on enable and unregistered on disable instead of when the effect is created or destroyed. Change-Id: Icffcede9558d8d41887278f0efef2df430927381
* Audio effects: support for audio pre processingEric Laurent2011-07-121-2/+2
| | | | | | | Audio policy manager: allow registration of audio effects on inputs too. Change-Id: I92efa5b51cfde591052a5c56ba2b0b84de80df0f
* hardware_legacy: provide HAL helpers for legacy audio usersDima Zavin2011-04-271-1/+2
| | | | | | | | | | | | This doesn't actually create a HAL, but rather a set of helper static libraries that device specific libraries (i.e. the old libaudio pieces) can link against to create a proper audio HAL module. We provide an audio_policy static wrapper and audio hardware interface static wrapper. Change-Id: Ie56195447ad24b83888f752dca24674b0afd8a76 Signed-off-by: Dima Zavin <dima@android.com>
* Improvement for issue 3489986: BT SCO volumeEric Laurent2011-03-151-1/+1
| | | | | | Add a parameter to applyStreamVolumes() to force stream volume update. Change-Id: I3cc82e516bb7c76c28c2470b06711c44f4789ce5