summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioPolicyManagerBase.cpp
Commit message (Collapse)AuthorAgeFilesLines
* audioflinger: move legacy audio hw/policy out to libhardware_legacyDima Zavin2011-04-271-2287/+0
| | | | | Change-Id: I4adcec73d3c08bcbe15bb19e1ba2ff18b195af45 Signed-off-by: Dima Zavin <dima@android.com>
* am 48dca4de: am 969357e3: am 223995dc: Fix issue 4335692: HDMI media volumeEric Laurent2011-04-261-0/+7
|\ | | | | | | | | * commit '48dca4de70890d324b5830a58bb9fa273164151a': Fix issue 4335692: HDMI media volume
| * Fix issue 4335692: HDMI media volumeEric Laurent2011-04-251-0/+7
| | | | | | | | | | | | Forced music stream volume to max when not muted and output device is HDMI. Change-Id: Ibd287cea8ae1d3f36fea6651a113bd5cf2dbad13
* | Miscellaneous code cleanup in audio frameworkGlenn Kasten2011-04-061-4/+5
|/ | | | | | | | | | | | | | | | | | | | Changes: - Move declaration of kClassPathName to top of file so it can be used in more than one place, instead of "android/media/AudioSystem". - Make private methods static. - Add comment to stream_type, audio_mode, force_use types that they must match values in AudioSystem.java. - Add comment about unused types mp3_sub_format and vorbis_sub_format. - Fix typos. - Use @ in javadoc comments. - Delete dead APIs setMode, getMode, setRouting, getRouting in AudioSystem.java (they are all hidden, deprecated, and unused by rest of framework) - Delete unused private log method. - Fix pathname for android_media_AudioSystem.cpp. - Improve code formatting for space after == and !=. - Add logging of delta for changing audio policy manager ref count. Change-Id: I18037c7beb8ab76d1fda08c11e589f6e591d36e1
* Improvement for issue 3489986: BT SCO volumeEric Laurent2011-03-151-3/+11
| | | | | | | | | | | | | This change makes sure that the VOICE_CALL stream volume tracks the BLUETOOTH_SCO stream volume when SCO audio is enabled. The down link audio volume now reflects what is being displayed when pressing volume hard keys on the device while in a video chat with a BT SCO headset. Volume settings on the headset and the device are still independent as we do not support handsfree profile yet. Change-Id: Ie0d2714730ea359b9318b9cbe6f0b2557ef0f976
* Fix issue 3388775.Eric Laurent2011-03-011-6/+6
| | | | | | | | | Do not select A2DP output for media strategy when it is suspended because BT SCO is active. Media audio will be routed to speakers or SCO HS (depending on phone state and activity on stream VOICE_CALL) which is less confusing than not hearing anything while music progress bar is moving. Change-Id: Iff8cc1ea9bf9bde0b33035c4d91398db0934b836
* Fix bug 3376700 Volume too loud at lowest settingJean-Michel Trivi2011-02-271-1/+9
| | | | | | | | Change volume attenuation curve to provide more attenuation at low volume settings, and finer steps at high volume. See bug entry for link to doc with curve values. Change-Id: I750548b2161a4c550ef982ba793156e4518119e8
* Fix issue 3400751.Eric Laurent2011-02-111-1/+1
| | | | | | | Add a delay before restoring output path when a notification ends so that short sounds can be heard on proper device before the path is actualy switched. Change-Id: I1d2dd8e7e28e15fbcab344256f88499b26297372
* Merge "Fix issue 3425342."Eric Laurent2011-02-111-28/+24
|\
| * Fix issue 3425342.Eric Laurent2011-02-111-28/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Change the device selection order as follows to enable easier use of A2DP while the device is docked: 1 - wired Headset 2 - A2DP Headset 3 - SPDIF/HDMI 4 - Dock Also do not limit notifications volume when on dock. Change-Id: I55ea6bea9f2d9ff284b54023e541b2788d0f1eb8
* | Bug 3352047 Wrong message when adjusting volumeGlenn Kasten2011-02-101-0/+14
|/ | | | | | Add hidden AudioManager.getDevicesForStream and output device codes. Change-Id: I4d1c1d3b6a077cd117720817d1f733dda557b947
* am 6f1bd261: am 9c0a1003: Merge "Fix issue 3371080" into honeycombEric Laurent2011-02-031-8/+19
|\ | | | | | | | | * commit '6f1bd261b7fd86ac7817ca061dfb55b95150b836': Fix issue 3371080
| * Fix issue 3371080Eric Laurent2011-02-031-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modified default volume control logic in AudioService: 1 IN_CALL volume if in video/audio chat 2 NOTIFICATION if notification is playing or was playing less than 5s ago. 3 MUSIC Modified silent mode: - now also affect MUSIC stream type - entering silent mode when VOL- hard key is pressed once while selected stream volume is already at 0 (except for VOICE_CALL stream). - exiting silent mode when pressing VOL+ hard key while in silent mode Play sound FX (audible selections, keyboard clicks) at a fixed volume. Modified audio framework: - isStreamActive() method now implemented in AudioPolicyManagerBase (previously AudioFlinger) - iStreamActive() now specifies a time window during which the stream is considered active after it actually stopped. Change-Id: I7e5a0724099450b9fc90825224180ac97322785f
| * Merge 0ef57993 from gingerbreadJean-Baptiste Queru2011-01-291-1/+2
| |\ | | | | | | | | | Change-Id: If10fee1ae387a8130356dd62fe678495402d5edf
* | \ am 4eeb1047: Merge 13212f83 from gingerbread-plus-aospJean-Baptiste Queru2011-01-291-1/+2
|\ \ \ | | | | | | | | | | | | | | | | * commit '4eeb10470ffafe8c508027f363ac66b58da5bf00': Fix issue 2988031.
| * \ \ Merge 13212f83 from gingerbread-plus-aospJean-Baptiste Queru2011-01-291-1/+2
| |\ \ \ | | |/ / | |/| / | | |/ Change-Id: I9a8ee0c7e7896aea85e7a7c18ee82927091cb670
| | * Fix issue 2988031.Eric Laurent2011-01-271-1/+2
| | | | | | | | | | | | | | | | | | Limit SYSTEM stream volume when a headset is connected and music is playing. Change-Id: Ieb44ae5bb53ffa9cd5fe8e317798eed279b78df8
| | * do not merge bug 3370834 Cherrypick from masterJean-Michel Trivi2011-01-261-19/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cherripick from master CL 79833, 79417, 78864, 80332, 87500 Add new audio mode and recording source for audio communications other than telelphony. The audio mode MODE_IN_CALL signals the system the device a phone call is currently underway. There was no way for audio video chat or VoIP applications to signal a call is underway, but not using the telephony resources. This change introduces a new mode to address this. Changes in other parts of the system (java and native) are required to take this new mode into account. The generic AudioPolicyManager is updated to not use its phone state variable directly, but to use two new convenience methods, isInCall() and isStateInCall(int) instead. Add a recording source used to designate a recording stream for voice communications such as VoIP. Update the platform-independent audio policy manager to pass the nature of the audio recording source to the audio policy client interface through the AudioPolicyClientInterface::setParameters() method. SIP calls should set the audio mode to MODE_IN_COMMUNICATION, Audio mode MODE_IN_CALL is reserved for telephony. SIP: Enable built-in echo canceler if available. 1. Always initialize AudioRecord with VOICE_COMMUNICATION. 2. If echo canceler is available, disable our echo suppressor. Note that this CL is intentionally not correcting the getAudioSourceMax() return value in MediaRecorder.java as the new source is hidden here. Change-Id: Ie68cd03c50553101aa2ad838fe9459b2cf151bc8
| | * Fix issue 2641884: Bluetooth volume is dependent on in call volume.Eric Laurent2010-12-011-13/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that the code in AudioPolicyManagerBase::checkAndSetVolume() that forces voice volume to max when setting bluetooth SCO volume is not called if the bluetooth stream volume did not actually change. So even if we re apply volumes when switching to bluetooth device, the volume voice volume is not changed and remains what it was when routed to earpiece What makes things worse on Passion is that stream volumes are limited when connected to bluetooth and their actual value does not change as soon as they exceed the limit threshold. Change-Id: Id7c317db45b392a1c20dca2859678e3c64a371ed
* | | Bug 3376700 Add support in APM for stream-specific volume curvesJean-Michel Trivi2011-01-251-2/+60
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The stream volume was handled the same way for all different stream, the only potential difference between each of them being the number of steps available to the user to change the volume. This was mapped to 99 steps of 0.5dB amplitude, offering a maximum attenuation of -49.5dB. This change consists in defining for each stream a curve with two knees (3 segments) for conversion from volume index to attenuation. This curve is defined in the AudioPolicyManager in initializeVolumeCurves(), and can therefore be overridden by the platform. Note that this change doesn't modify the volume curves: this CL enables the curves to be changed by overriding this default behavior. Change-Id: I575b66799c52df2906db248943b15120b8a79ea2
* | Tentative fix for issue 3362362.Eric Laurent2011-01-191-18/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is likely that one method is called on the AudioPolicyManagerBase instance while it is still being constructed by AudioPolicyService. To avoid this, the AudioPolicyService mutex is held by the constructor until the platform specific AudioPolicyManager is constructed and the member mpPolicyManager initialized. Also added an initCheck() method to AudioPolicyInterface to verify successful initialization of AudioPolicyManager. A similar change is done in AudioFlinger constructor. Also added some missing protections in AudioFlinger methods where the playback thread list is parsed. Change-Id: I006b244ec057e1bb0aa5ebe426ef006e3b171056
* | Fix issue 3317627.Eric Laurent2011-01-091-0/+8
| | | | | | | | | | | | | | The fix consists in selecting the digital audio device (SPDIF/HDMI) when available if the routing strategy is STRATEGY_PHONE. Change-Id: Ie500ae92f5c01f2511988543852ba559c6e5994b
* | Fix speakerphone routing to analog dockEric Laurent2010-12-161-4/+2
| | | | | | | | | | | | | | | | | | | | The audio routing policy when speakerphone is on and a dock with built-in speakers is connected should be to output audio to teh dock speakers Also removed route to SCO car kit if forced usage is not SCO as the SCO socket might not be established. Change-Id: I1aa2954092e28de935304b90f7a7a64d661934c7
* | Change audio routing policy for HDMIEric Laurent2010-12-151-5/+5
| | | | | | | | | | | | | | | | | | | | HDMI device should have a higher priority than analog dock audio but a lower priority than wired headsets. Also modified AudioService so that HDMI is mapped to DEVICE_OUT_AUX_DIGITAL device and not DEVICE_OUT_DGTL_DOCK_HEADSET as before to enable discrimination between SPDIF going to digital dock and SPIDF going to HDMI. Change-Id: I887d0c73479784dd2edaf41ce1a7d8d0bdcbb4bd
* | resolved conflicts for merge of 0d28be68 to masterEric Laurent2010-12-011-50/+54
|\ \ | |/ | | | | Change-Id: Iec5f810c366d3e1c14a6f6294b0aea4ffb30ae3e
| * Fix issue 3142808.Eric Laurent2010-12-011-49/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a bug in the way audio policy manager handles A2DP interface suspend/restore when SCO is used. This bug is not new but has been triggered by a change in the timing of the events received by audio policy manager when a call is setup and torn down introduced by commit 164a8f86c7e48992691368c4895709c3bdb835a4. The fix consists in grouping the control of A2DP suspended state in a single function that is called systematically when conditions affecting this state are changed: - call state change - device connection/disconnection - change in forced usage. Change-Id: I46ee2399ee5547b60511fc6cfd32e2720091b0f8
* | Add new audio mode for audio communications other than telelphony.Jean-Michel Trivi2010-11-161-15/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The audio mode MODE_IN_CALL signals the system the device a phone call is currently underway. There was no way for audio video chat or VoIP applications to signal a call is underway, but not using the telephony resources. This change introduces a new mode to address this. Changes in other parts of the system (java and native) are required to take this new mode into account. The generic AudioPolicyManager is updated to not use its phone state variable directly, but to use two new convenience methods, isInCall() and isStateInCall(int) instead. Change-Id: Id744cd26520ea1d1a4795eabe6a1f0c58789af76
* | Add support for audio recording source in generic audio policy mgr.Jean-Michel Trivi2010-11-121-4/+2
| | | | | | | | | | | | | | | | | | Update the platform-independent audio policy manager to pass the nature of the audio recording source to the audio policy client interface through the AudioPolicyClientInterface::setParameters() method. Change-Id: I6b4fd0f8a3acea0d7d30bbad98edd1977dc012bf
* | Add recording source for voice communicationJean-Michel Trivi2010-11-091-0/+1
| | | | | | | | | | | | | | Add a recording source used to designate a recording stream for voice communications such as VoIP. Change-Id: I4091d67069b1a0170c1a5ca5e6acd51eb0aa08f9
* | Added support for dock headset observerPraveen Bharathi2010-11-011-3/+19
| | | | | | | | | | Change-Id: I06b2e65e3bfa10735e6c7fd3349afa9ae7d45292 Signed-off-by: Praveen Bharathi <pbharathi@motorola.com>
* | am 44217848: am ae6bdc23: Merge "Fix issue 2952766." into gingerbreadEric Laurent2010-08-301-18/+24
|\ \ | |/ | | | | | | | | | | Merge commit '4421784895a58bb7bcf90236a9e443b372b5b80e' * commit '4421784895a58bb7bcf90236a9e443b372b5b80e': Fix issue 2952766.
| * Fix issue 2952766.Eric Laurent2010-08-271-18/+24
| | | | | | | | | | | | | | | | | | | | | | | | The problem is that the audio policy manager does not handle the input devices when forced use for telephony is changed. The problem does not appear in a call over PSTN becasue only teh output devices drives the routing of in call audio to/from the base band. The fix consists in modifying AudioPolicyManagerBase::setForceUse() to check for active inputs and update the input device if needed. Change-Id: I0d36d1f5eef1cce527929180c29b025439902f10
* | resolved conflicts for merge of dd206093 to masterEric Laurent2010-07-201-31/+178
|\ \ | |/ | | | | Change-Id: I21dd2321a4839d034d49092baccbf40986f17dae
| * Audio policy manager changes for audio effectsEric Laurent2010-07-201-31/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added methods for audio effects management by audio policy manager. - control of total CPU load and memory used by effect engines - selection of output stream for global effects - added audio session id in parameter list for startOutput() and stopOutput(). this is not used in default audio policy manager implementation. Modifications of audio effect framework in AudioFlinger to allow moving and reconfiguring effect engines from one output mixer thread to another when audio tracks in the same session are moved or when requested by audio policy manager. Also fixed mutex deadlock problem with effect chains locks. Change-Id: Ida43484b06e9b890d6b9e53c13958d042720ebdb
* | am 78983a91: am 4055b780: Merge "move native services under services/" into ↵Mathias Agopian2010-07-141-12/+22
|/ | | | | | | | | gingerbread Merge commit '78983a9133d3dd3f08b1ec462a7e2f9e7bfa9e2f' * commit '78983a9133d3dd3f08b1ec462a7e2f9e7bfa9e2f': move native services under services/
* move native services under services/Mathias Agopian2010-07-141-0/+1973
moved surfaceflinger, audioflinger, cameraservice all native services should now reside in this location. Change-Id: Iee42b83dd2a94c3bf5107ab0895fe2dfcd5337a8