summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy/AudioPolicyManager.h
Commit message (Collapse)AuthorAgeFilesLines
* Refactor AudioPolicyManagerJean-Michel Trivi2015-02-181-951/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AudioPolicyManager implementation is now split into the following files: files managerdefault/Gains.* class AudioGain class VolumeCurvePoint class StreamDescriptor files managerdefault/Devices.* class DeviceDescriptor class DeviceVector files managerdefault/Ports.* class AudioPort class AudioPortConfig class AudioPatch files managerdefault/IOProfile.* class IOProfile files managerdefault/HwModule.* class HwModule files managerdefault/AudioInputDescriptor.* class AudioInputDescriptor files managerdefault/AudioOutputDescriptor.* class AudioOutputDescriptor All files for libaudiopolicyservice are moved under service/ All files for libaudiopolicymanager are moved under manager/ Change-Id: I43758be1894e37d34db194b51a19ae24461e066e
* Passing device name up through getDeviceDescriptor() method (when creating)Paul McLean2015-02-061-1/+2
| | | | Change-Id: Ibd85e37914333478fd038c3d2f52e214016c16b1
* Add additional info to AudioPort for enum/selection API.Paul McLean2015-02-051-6/+19
| | | | | | | | | | Add "device name" member to AudioPort. Moved unique device ID from DevicePort to AudioPort. Straighten out confusion between "name" and "address" Created string constants for Intent "extra" data keys. Combine card/address data into "address" at sender.Add additional info to AudioPort for enum/selection API. Change-Id: I1be308e12b09cd0ead9a3e9fbc9c385462299fb5
* audio policy: match attached device to declared devicesEric Laurent2015-01-291-0/+3
| | | | | | | | | | Make sure that when a new audio device is connected, and a specific profile for this device is listed in audio_policy.conf, this particular profile is used instead of a default generic profile. Bug: 19188567. Change-Id: I5f576fcd697adc041b2cfbd2bac7a51bcc2143b9
* Audio policy: fix device gain initializationEric Laurent2015-01-271-2/+6
| | | | | | | | | | | Fix initilization of default gain configuration for audio devices loaded from audio_policy.conf. Initialization cannot be done in constructor as the possible gain configurations are not loaded yet. Bug: 19120566. Change-Id: I78f057ecfa1a121365ac3d8f317912a6f1647627
* [FM]There is no sound output from BT earphone while BT earphone is connectedHochi Huang2015-01-131-4/+4
| | | | | | | | | | Bug: 18847131 Review: https://partner-android-review.git.corp.google.com/#/c/193318 Signed-off-by: Hochi Huang <hochi.huang@mediatek.com> Change-Id: I79703ba4ceb67ca3b95fbc71444dd3b116ba4131
* close remote submix's output when device is not available.keunyoung2015-01-051-0/+1
| | | | | | | | | | | - change output close logic to find the device from IOProfile rather than AudioPatch as AudioPatch handle can be cleared before disconnect. - Otherwise, remote submix can be stuck as output is never closed and does not work any more as subsequent open fails as output is already taken. bug: 18733215 Change-Id: Iddb481c91e81070e6be18996a4c8837dabd7ebdb
* Merge "Fix permission check for audio recording" into lmp-mr1-devJean-Michel Trivi2014-12-171-1/+2
|\
| * Fix permission check for audio recordingJean-Michel Trivi2014-12-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define input types covering the different usecases for audio recording, and check the corresponding permissions when starting to record. Move the permission check from audio flinger to audio policy, as only the policy has the information to determine which permission to enforce. Fix missing permission when an application records audio and the audio is injected by an external policy. Bug 18736417 Change-Id: If7ec040502242c990ac8ea464db484339bdce573
* | [FM] Fix notification routing when FM enableHochi Huang2014-12-171-2/+2
|/ | | | | | | | | https://partner-android-review.git.corp.google.com/#/c/188454/ Bug: 18727227 Change-Id: I74856ede5999cfc8a6932a99855d468cccd6f51c Signed-off-by: Hochi Huang <hochi.huang@mediatek.com>
* audio policy: fix remote mic captureEric Laurent2014-12-121-2/+11
| | | | | | | | | | | | 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
* audio policy: suppport for dynamic sourceEric Laurent2014-12-101-5/+4
| | | | | | | | | | | 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
* AudioPolicyManager: distinguish between mirroring and reroutingJean-Michel Trivi2014-12-091-0/+2
| | | | | | | | | | | | | | | | 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
* audio policy: add support for custom mixesEric Laurent2014-12-091-6/+34
| | | | | | | | | | | | | | | | | 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
* [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>
* AudioRecord: use audio attributes instead of audio source.Eric Laurent2014-11-251-6/+7
| | | | | | | | | | | | | | | | 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
* audio policy: new getOutputForAttr() prototype.Eric Laurent2014-11-251-9/+16
| | | | | | | | | | | | | | | | | | | | | | | 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
* audio: new routing strategies and stream typesEric Laurent2014-11-211-0/+3
| | | | | | | | | | | | | 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
* Support speaker routing for FLAG_BEACONJean-Michel Trivi2014-10-311-0/+22
| | | | | | | | | | | | | | | | | | | | 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
* am 9286354c: Merge "Revert "audio policy: add support for ↵Dave Burke2014-10-121-2/+0
|\ | | | | | | | | | | | | ro.audio.media_deep_buffer"" into lmp-dev * commit '9286354c0a864ce2348cc7dfc6ca81e84a15f8e2': Revert "audio policy: add support for ro.audio.media_deep_buffer"
| * Revert "audio policy: add support for ro.audio.media_deep_buffer"Vineeta Srivastava2014-10-111-2/+0
| | | | | | | | | | | | This reverts commit 95511add8ad4d440c67272503559f5042c4e6f1f. Change-Id: I76a8b86790b06b08d8ca0f8d374e585f964ffba8
* | am ffd5cdbd: Merge "audio policy: add support for ↵Eric Laurent2014-10-111-0/+2
|\ \ | |/ | | | | | | | | | | ro.audio.media_deep_buffer" into lmp-dev * commit 'ffd5cdbd3e3faa203539e26adc755f860c8cac80': audio policy: add support for ro.audio.media_deep_buffer
| * audio policy: add support for ro.audio.media_deep_bufferEric Laurent2014-10-101-0/+2
| | | | | | | | | | Bug: 17931716. Change-Id: Ife170f20f5d02b71059fbd384bd29759fafee826
* | [AU] Update volume setting and Audio Device API 3.0Hochi Huang2014-09-301-4/+5
|/ | | | | | Signed-off-by: Hochi Huang <hochi.huang@mediatek.com> Review: https://partner-android-review.git.corp.google.com/#/c/182522 Change-Id: Ida2dfedc6eaa3204354cdc182e0ee13a35472661
* audio policy: add hw hotword flag for inputsEric Laurent2014-09-191-4/+5
| | | | | | | | | | | | | Audio input profiles can indicate flag AUDIO_INPUT_FLAG_HW_HOTWORD meaning they allow capture from the same source as HW hotword detection. When a client requests capture with this flag, the policy will try to find an input profile matching this request first and fallback to a regular input if not found. Bug: 17575019. Change-Id: Ia463211597d7fa363527d776389f2257f0ced9a2
* audio policy: fix output stream selectionEric Laurent2014-09-081-1/+2
| | | | | | | | | Make sure that all outputs considered by selectOutput() when called from AudioPolicyManager::getOutputForDevice() support the requested audio format. Bug: 17340382. Change-Id: I76520ce60e9a8fe4d2d23125d6143bb016522754
* Merge "audio policy: remove audio patch when closing input or output" into ↵Eric Laurent2014-08-281-0/+3
|\ | | | | | | lmp-dev
| * audio policy: remove audio patch when closing input or outputEric Laurent2014-08-271-0/+3
| | | | | | | | | | | | | | | | | | Make sure that an audio patch having an output as source or input as sink is removed when this input or output is closed. Bug: 17303725. Change-Id: I234d54a25ce0b579eeeafdcfda3a0594f048768c
* | Fix memory leak in getConnectionStateMarco Nelissen2014-08-261-1/+4
|/ | | | | | | | Turns out having an sp<> point at the containing object doesn't really work so well. Bug: 17210991 Change-Id: I4bcb0c38adffc574d661f0772583357868f6c5b4
* Merge "audiopolicy: add dump for audio patches" into lmp-devJean-Michel Trivi2014-08-131-0/+2
|\
| * audiopolicy: add dump for audio patchesEric Laurent2014-08-101-0/+2
| | | | | | | | | | Bug: 10549017. Change-Id: I896c8e16c8cf7490bab75295903620a76236f571
* | Update audio ports with profile capabilitiesJean-Michel Trivi2014-08-101-1/+4
|/ | | | | | | | | When opening an output, import the profile capabilities associated with the device into the AudioPort. Bug 10549017 Change-Id: If102f5623457542d2c1407ada303c71e43d19a08
* audio policy: add support for USB devices for voice callEric Laurent2014-08-061-0/+8
| | | | | | | | | Add possibility to use sink and source devices not on the primary HW module for voice calls (e.g. USB headsets). Bug: 15520724. Change-Id: Ib27db4ba759b6d91ea1104dc2e35c87733517b30
* audio policy: support line output deviceJon Eklund2014-08-051-0/+3
| | | | Change-Id: Iddf1b6486430270d871a45c75615e54339a818e9
* Add sound trigger control by audio policyEric Laurent2014-08-051-9/+22
| | | | | | | | | | | | | | | | | Audio policy: - Added active capture indication to sound trigger service: recognition stops if concurrent capture is not supported. - Added generation of reserved I/O handle and session ID for utterance capture. Sound trigger service - Added sound model update callback handling. - Added service state callback - Simplified callback shared memory allocation. Bug: 12378680. Change-Id: Ib0292c2733e6df90fdae480633dd9953d0016ef1
* Merge "Update multichannel audio policy handling" into lmp-devAndy Hung2014-07-291-4/+1
|\
| * Update multichannel audio policy handlingAndy Hung2014-07-281-4/+1
| | | | | | | | | | | | | | | | Ensure AUDIO_FORMAT_PCM_FLOAT and AUDIO_FORMAT_PCM_32_BIT have proper precedence. Allow more mixer channels than 2. Change-Id: I02af97dad6218b25cbada4d93077a213314c6725
* | audio policy: pass session ID to capture activity methodsEric Laurent2014-07-281-4/+8
| | | | | | | | | | | | | | | | Indicate the audio session ID when calling getInput(), startInput(), stopInput(), releaseInput(). Bug: 12378680. Change-Id: I763793752f93e2f4e1445a5ab217c895af011038
* | AudioFlinger: update openInput() and openOutput()Eric Laurent2014-07-281-2/+0
|/ | | | | | | | | | Add parameters to openInput() and openOutput(): device address, input source. Allow caller to specify a given I/O handle Group parameters in a struct audio_config. Bug: 12378680. Change-Id: I7e9af74c0d996561cc13cbee7d9012d2daf33025
* audio policy: compatible sample rates and channel masksGlenn Kasten2014-07-271-3/+16
| | | | Change-Id: I50d068a968aa6bd9e53e5b3111a1b09a6c2d219c
* AudioPolicyManager: handle outputs for different addressesJean-Michel Trivi2014-07-271-1/+13
| | | | | | | | | | | | | | Add the notion of device types that cause the device address to be taken into account, i.e. multiple devices of the same type but with a different address can be connected/ disconnected. AUDIO_DEVICE_OUT_REMOTE_SUBMIX is such a device type. When making those devices available / unavailable, look for all outputs with a matching address. Bug 16009464 Change-Id: I260f8248b7794c4932094e876afdf29fdea007a3
* audio policy: add audio_input_flags_t and mOpenRefCountGlenn Kasten2014-07-241-2/+5
| | | | Change-Id: I5f9c7b5ebf03b9bc94efe70d3677edfabb99c194
* audio policy: add rules to select audio parametersEric Laurent2014-07-111-4/+17
| | | | | | | | | | Added rules to select most appropriate sampling rate, format and channel mask from an input or output profile. Moved mFlags from IOProfile to its base class AudioPort. Removed bogus mChannelMask member in DeviceDescriptor class. Improveed dump of dynamic parameters in AudioPort. Change-Id: Ic09d320386002a8bafee4a28db00b1001a386678
* AudioPolicyManager: return output for audio attributesJean-Michel Trivi2014-06-181-0/+19
| | | | | | | | | | In AudioPolicyManager, support querying an output or playback strategy for audio attributes, instead of a stream type, In AudioTrack creation, use the output returned for the track's attributes. Change-Id: I0fef05845ba676404775e2e338c10e6a96237268
* am 318cd78e: Merge "audio policy: added audio HAL version in ↵Eric Laurent2014-06-071-2/+3
|\ | | | | | | | | | | | | audio_policy.conf" into lmp-preview-dev * commit '318cd78e3b8503113919191b3711eb8be5d23d35': audio policy: added audio HAL version in audio_policy.conf
| * audio policy: added audio HAL version in audio_policy.confEric Laurent2014-06-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | Each hardware module section in audio_policy.conf indicates the audio HAL version it implements. Also added a template audio_policy.conf file with examples of device and gain descriptors added for audio HAL version3.0. Bug: 14815883. Change-Id: Id219d121f81f687363f6c18f2d1684b2448dcdf4
* | Merge "Audio policy: new media volume curve for speaker with DRC"Jean-Michel Trivi2014-06-061-0/+1
|\ \ | |/ |/|
| * Audio policy: new media volume curve for speaker with DRCJean-Michel Trivi2014-06-051-0/+1
| | | | | | | | | | | | | | | | | | | | For devices with DRC on speaker (using the flag "speaker_drc_enabled" in audio_policy.conf), set the speaker media volume to use a new curve with more aggressive attenuation in the upper range. Bug 15318604 Change-Id: Ia5fb9fdd608fddad22fadfb1065d35574030bb52
* | audio policy: new setAudioPortConfig implementationEric Laurent2014-06-041-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite setAudioPortConfig() to take advantage of the new AudioPortConfig class. The configuration is now checked against AudioPort capabilities and stored in the AudioPortConfig. Fix a bug where the config mask was not set properly when calling setAudioPortConfig at the PatchPanel interface. Remove debug log in IAudioPolicyService. Bug: 14815883. Change-Id: I7eb7683a96e049581c13f2a212486507883d008d
* | audio policy: removed raw pointers.Eric Laurent2014-06-031-52/+48
|/ | | | | | | | | | | | | | | Use only RefBase objects for the following classes: - AudioOutputDescriptor - AudioInputDescriptor - HwModule - EffectDescriptor Create a common base class AudioPortConfig for: AudioOutputDescriptor, AudioInputDescriptor and DeviceDescriptor Bug: 14815883. Change-Id: I1bd193ef1020780d8b94c13142029903615aba97