summaryrefslogtreecommitdiffstats
path: root/audio/AudioPolicyManagerBase.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * audio policy: fix notification start delayEric Laurent2012-11-071-3/+16
| | | | | | | | | | | | | | | | | | | | 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
* | am c8bc2286: am 7aab5b0f: Merge "Close a newly opened direct output if its ↵Jason Simmons2012-11-081-0/+1
|\ \ | |/ |/| | | | | | | | | parameters are invalid" into jb-mr1-aah-dev * commit 'c8bc22869096ee413717102d3f5d0ca804cc3174': Close a newly opened direct output if its parameters are invalid
| * Close a newly opened direct output if its parameters are invalidJason Simmons2012-10-311-0/+1
| | | | | | | | Change-Id: I27ac015217480a854d25273ab9498949971b411a
* | audio policy: fix volume change when disabling SCOEric Laurent2012-10-301-1/+4
|/ | | | | | | | | | | | commit 76e97d39 introduced a regression by having setDeviceConnectionState() force a device change on duplicated outputs even if the selected device is 0. This also forces a device 0 for the two outputs it is duplicated to, which may override a valid device selection on those outputs and apply default volumes. Bug 7429869. Change-Id: I37dd66343c54eb27e420089edbda04444fa1e2c6
* Fix a parse error in checkOutputForDeviceJohn Grossman2012-10-291-2/+2
| | | | | | | | | | | Fix a small parsing error in parsing the supported formats and sample rates of a stream out with dynamic values for these parameters. The channel mask parser was properly skipping the "=" in the setting string, but formats and sample rates were not (cauing the first reported format and sample rate to end up being skipped) Change-Id: Id227a44f6b5fc0c223f2ce74f94ebb6abc5fa77d Signed-off-by: John Grossman <johngro@google.com>
* audio policy: active analog dock force usageEric Laurent2012-10-261-1/+2
| | | | | | | | Qualify the selection of the analog dock for media by the force use. Bug 7302106. Change-Id: I2ea48fd43866ce8491085bba72a27751b2203401
* Merge "audio policy: fix scanning of supported devices" into jb-mr1-devEric Laurent2012-10-181-2/+2
|\
| * audio policy: fix scanning of supported devicesEric Laurent2012-10-171-2/+2
| | | | | | | | | | | | | | | | | | | | Fix is a bug in checkOutputsForDevice() which makes that we can try to reopen an output stream after a new device is connected because we believe that no opened output is available for this device. Bug 7369475. Change-Id: I2290a9b5ba102657cda495fbb8a995e0003b883a
* | Merge "audio policy: tune voice/video chat volumes" into jb-mr1-devEric Laurent2012-10-181-18/+20
|\ \ | |/ |/|
| * audio policy: tune voice/video chat volumesEric Laurent2012-10-171-18/+20
| | | | | | | | | | | | | | | | | | Add new volume curves for VOICE_CALL stream type to improve voice/video chat volume on speakers. Bug 7346643. Change-Id: Ib282a97570d2234deec6b58391bdfc45846d9cc0
* | audio policy: update output delayMs in setPhoneStateSathishKumar Mani2012-10-171-0/+16
|/ | | | | | | | | | | | | - Issue: When call is connected in HDMI while playing music, Playback is routed to phone shortly - Cause: delayMs is not updated correctly, and no delay is set when setOutputDevice is called - Fix: update delayMs with biggest mOutput latency and mute STRATEGY_MEDIA on all outputs Bug: 7268860 Change-Id: I12b75443a29ab8485314bd0cbfe5ee4789be5c29 Signed-off-by: Iliyan Malchev <malchev@google.com>
* Merge "audio policy: do not route in call audio to HDMI" into jb-mr1-devEric Laurent2012-10-161-20/+24
|\
| * audio policy: do not route in call audio to HDMIEric Laurent2012-10-161-20/+24
| | | | | | | | | | | | | | | | | | In call audio shuold not be routed to HDMI, S/PDIF or USB by default as most platform do not support it. Bug 7339490. Change-Id: Iac4803f3fbde0c321fc7b37ab7ba34af6a16b4aa
* | Initialize mStrategyMutedByDeviceMarco Nelissen2012-10-161-0/+3
| | | | | | | | | | | | Valgrind found this Change-Id: I24c640c2b0b6cac129c23bfc18828aff005ec952
* | Remote audio submix always has priority for media, only plays mediaJean-Michel Trivi2012-10-111-5/+5
|/ | | | | | | | | | | Don't use force use mechanism for remote audio submix routing. Prevent streams of strategy sonification to be played over remote audio submix (e.g. WFD) and HDMI Bug 7318180 Change-Id: Ic5c87d3c568873dffea9002cf87ecf42b403cde6
* AudioPolicyManager supports querying active record sourcesJean-Michel Trivi2012-10-101-0/+13
| | | | | | | | | Add support for querying whether there is currently a recording underway from the specified audio source. Bug 7314859 Change-Id: I8894845b176241134870af5df2bebc5ef27e4de4
* audio policy: add forced uses for systemEric Laurent2012-10-081-13/+18
| | | | | | | | | | | | | The volume and routing policy of AUDIO_STREAM_ENFORCED_AUDIBLE is now controlled by AudioService by means of new forced use type AUDIO_POLICY_FORCE_FOR_SYSTEM with config AUDIO_POLICY_FORCE_SYSTEM_ENFORCED. Property ro.camera.sound.forced is not used anymore. Bug 7032634. Change-Id: I742b0eebbe6b013f61d199846454a06411b52bc8
* audio policy: force device update if disconnectedEric Laurent2012-09-261-1/+4
| | | | | | | | | | | Force the new device selection to be applied when a device is disconnected even if none is select. This is to indicate to the audio HAL that current device selection is not valid anymore even if no new device is selected because no audio track is active. Bug 7141149. Change-Id: Iade02fb53a4cc2051fce9da07870c5391396b696
* audio policy: fix crash when closing HDMI outputEric Laurent2012-09-251-0/+1
| | | | | | | | | When a direct output is closed, the vector containing the previously opened outputs must also be updated. Bug 7157451. Change-Id: I575b1f4928cf7527a4a98632fdec7600664a1e1c
* Support audio recording while remote submix is activeJean-Michel Trivi2012-09-181-2/+18
| | | | | | | 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-55/+54
| | | | | | | | | | 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-6/+33
| | | | | | | | | | | | 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
* audio policy: fix ringtone volume on headphonesEric Laurent2012-09-051-2/+3
| | | | | | | | | | | When limiting ringtone volume because headphones are connected and music is playing, the volume was not limited against the right music volume. The is because the device used for music (headphone) is not the same as the one used for ringtone (headphone + speaker). Bug 6816207. Change-Id: I3342be1789a1b7c58705812335b788f030bc6d76
* Update AudioPolicyManagerBase to only use audio_devices_tJean-Michel Trivi2012-08-241-123/+129
| | | | | | | | | | | | 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
* effect_descriptor_t const correctnessGlenn Kasten2012-07-241-2/+2
| | | | Change-Id: I734155d4cebb22b180f25290332c7c48be1e2b36
* audio policy: fix HDMI hot plugEric Laurent2012-06-211-16/+21
| | | | | | | | | | | 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: fix volume upon A2DP connectionEric Laurent2012-06-131-4/+4
| | | | | | | | | | | | | | | setForceUse() should not force new device selection on outputs if the selected device is 0. If a device 0 (no device) selection is forced on a duplicated output, this causes volumes to be reset to their default on outputs the duplicated output is connected to. Also force reapply volumes when a new output is created. It is safer and more explicit than relying on the fact that the selected volume is different from default volume and thus is actually sent to audioflinger. Bug 6658021. Change-Id: I0a14d5229847e001b0d44f60d41c241efdb9946a
* Merge "Increase system stream volume on speaker" into jb-devJean-Michel Trivi2012-06-071-2/+2
|\
| * Increase system stream volume on speakerJean-Michel Trivi2012-06-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Increase the volume of the system stream for speaker output, so sounds played on this stream can be louder on devices that need it. Additional changes in the rest of the framework will define properties to tune sound effect levels on a per-device basis. Bug 6448481 Change-Id: Ia6c1ff314a321c6e271a682e3f4ff64c250b184e
* | Merge "audio policy: fix notification volume limitation" into jb-devEric Laurent2012-06-071-1/+2
|\ \
| * | audio policy: fix notification volume limitationEric Laurent2012-06-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The limitation of notification volume when playing music over headphones has been broken for devices where notifications and music are played over separate output streams. Fix computeVolume() to check music stream activity on all outputs. Bug 6623707. Change-Id: Ie25f9b428ea086efe0be5fea2d31551d2528b655
* | | audio policy: remove delay when enabling speakerEric Laurent2012-06-061-2/+5
|/ / | | | | | | | | | | | | | | | | Do not force mute on a strategy when moving it from one output stream to another if no stream is active. Bug 6611972. Change-Id: I21f72b0ef3600639de66e6b0a1c3ae44045fd81f
* | audio policy: improve support for direct outputsEric Laurent2012-06-041-150/+291
|/ | | | | | | | | | | 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
* Ensure global effects are on the correct outputMarco Nelissen2012-05-311-16/+38
| | | | | | | | | | | Global effects such as the visualizer would sometimes not be on the right output, for example when switching from a2dp to wired headset or back, when there are both regular and deep buffer outputs available. We now check which of the available outputs the global effect should be on when more than one is available. b/6528772 Change-Id: Ie268e32ef41e7888da67c24730dc93750a2cf579
* audio policy: allow disabling A2DP for media.Eric Laurent2012-05-221-15/+22
| | | | | | | | | Added FORCE_NO_BT_A2DP forced use to allow applications to override default policy to use A2DP whenever connected. Bug 6485897. Change-Id: I784271c062294fbe1aff7884965075b40c68dc24
* audio policy: fix in call volume problem.Eric Laurent2012-05-151-12/+24
| | | | | | | | | | | | | | | | 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
* Reduce system stream volume.Eric Laurent2012-05-101-3/+3
| | | | | | | | | Reduce system stream volume by 6dB as UI sounds are now perceived as being too loud. Issue 6448481. Change-Id: I0237eb94245014724dfdf55253049340e2162af8
* system and UI sounds volume policyEric Laurent2012-04-261-19/+56
| | | | | | | | | | | | | 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-1/+30
| | | | | Change-Id: I25f7407c34b3032d4e77a27a4ac47b648098d9b0 Signed-off-by: Dima Zavin <dima@android.com>
* audio_policy: look for config file in /vendor firstDima Zavin2012-04-231-2/+6
| | | | | Change-Id: If10308f688437e1682e4104120772cfce16e9d89 Signed-off-by: Dima Zavin <dima@android.com>
* audio policy: volume burst when switching deviceEric Laurent2012-04-231-5/+18
| | | | | | | | | | | | | | 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-24/+38
| | | | | | | | | | 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-16/+16
| | | | Change-Id: Ic42eba3432671f651c9703a07fe7b429a8ec0dff
* audio policy: added rules for USB audio devicesEric Laurent2012-04-061-2/+48
| | | | Change-Id: If712b0c7fcf281d66d34614529f3433e56e058fb
* Allow non-direct output of any channel maskJean-Michel Trivi2012-04-051-5/+3
| | | | | | | Because of the downmix capability of the mixer, do not prevent a non-direct output to be retrieved based on channel mask. Change-Id: I911f95f4055c2134298c233d14f2f5d586091fd4
* audio policy: load audio hw modulesEric Laurent2012-04-031-173/+296
| | | | | | | | | | | | | 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-220/+822
| | | | | | | | | | | | | | | | 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-22/+73
| | | | | | | | | | | | 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-57/+59
| | | | Change-Id: I0b4e2ff705fce96b40fdda28b1bc4b514438bec6
* audio policy: use common string for A2DP addressEric Laurent2012-03-071-1/+2
| | | | | | Use definition from audio.h for A2DP sink address parameter. Change-Id: I2d7905b8e3dd71fab2efc68ae16682e09c3f872e