summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy
Commit message (Collapse)AuthorAgeFilesLines
* Update calls to IInterface::asBinder()Marco Nelissen2014-11-171-1/+1
| | | | | | | | | | | to use the new static version. Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a Conflicts: media/libmedia/IAudioFlinger.cpp media/libmedia/IMediaPlayer.cpp media/libstagefright/CameraSource.cpp
* Include AudioPolicyInterface.h only when needed.Chih-Hung Hsieh2014-11-142-0/+3
| | | | | | | | | | Both legacy and non-legacy AudioPolicyInterface define extern "C" functions createAudioPloicyManager and destroyAudioPloicyManager. Standard C++ does not allow overloading of extern C functions. g++ did not catch this problem but clang++ does. Change-Id: I80869cdb26e7721777e53d4eff71c5c733044abf
* audio policy: Fix for voice call audio lossHaynes Mathew George2014-10-151-0/+20
| | | | | | | | | | | | | | Audio Policy service filters out one of the create patch commands when it finds two pending commands with the same patch handles. Due to this routing command is not received to audio HAL and the voice call set up fails. Fix this by filtering create patch commands only when they are issued on the same output. authored-by: Karthik Reddy Katta <a_katta@codeaurora.org> Bug: 17787282 Change-Id: If36f0ab71e9b72d6a8eb61d31f762bc5e1683b89
* Revert "audio policy: add support for ro.audio.media_deep_buffer"Vineeta Srivastava2014-10-112-13/+1
| | | | | | This reverts commit 95511add8ad4d440c67272503559f5042c4e6f1f. Change-Id: I76a8b86790b06b08d8ca0f8d374e585f964ffba8
* audio policy: add support for ro.audio.media_deep_bufferEric Laurent2014-10-102-1/+13
| | | | | Bug: 17931716. Change-Id: Ife170f20f5d02b71059fbd384bd29759fafee826
* audio policy: move intializations to onFirstRef()Eric Laurent2014-10-102-0/+7
| | | | | | Bug: 17896324. Change-Id: I3bb74f5397142ac354bd815eb362e5ddacdcb463
* audio policy: fix build with USE_LEGACY_AUDIO_POLICYEric Laurent2014-10-072-2/+3
| | | | | Bug: 17894512. Change-Id: I6431c0b03ba02cf561413c34848a334caa0261fa
* audio policy: fix lockup during mediaserver restartEric Laurent2014-10-075-115/+186
| | | | | | | | | | | | | | | When pre or post processing effects are applied by audio policy service automatically there is a potential lockup if the first call into AudioPolicyService is made while creating one of those effects. This is because effects are created with AudioPolicyService mutex held and effect creation calls into methods (e.g registerClient()) which also acquire the mutex. The fix consists in adding a new mutex to AudioPolicyEffects class and not hold the AudioPolicyService mutex when calling methods in of class. Bug: 17830596. Change-Id: Ie61c3671d3147f46e99ba208f39c1a3bf180779f
* audio policy: fix HW A/V sync output selectionEric Laurent2014-09-291-1/+3
| | | | | | | | | | | commit b732cf5a broke the selection mechanism for the HW A/V sync direct output. Add a rule to only select a mixed output for basic PCM stereo content when a direct output is not explicitly requested. Bug: 17702382. Change-Id: I1387690ace77cd4d6a8faf0b525c3d1008fba3f1
* Merge "audio policy: favor mixed over direct output for PCM format" into lmp-devEric Laurent2014-09-261-1/+11
|\
| * audio policy: favor mixed over direct output for PCM formatEric Laurent2014-09-261-1/+11
| | | | | | | | | | | | | | | | | | | | | | modify getOutputForDevice() to skip direct output selection if the request can obviously be attached to a mixed output This prevents from selecting a direct output profile that can manage stereo PCM format if a mixer output is available to reach the same device. Bug: 17628413. Change-Id: I02e9a0b02c9ae5f44ff5768ac4ed02ce84d521c5
* | audio: fix stream type for accessibility usageEric Laurent2014-09-254-1/+18
|/ | | | | | | | | Make sure that accessibility prompts are heard when a ringtone is active by forcing stream type to AUDIO_STREAM_RING when phone state is AUDIO_MODE_RINGTONE. Bug: 17558149. Change-Id: Ia3bead8052fca5cbf282c267f7b9b06014fef628
* audio policy: add hw hotword flag for inputsEric Laurent2014-09-192-31/+69
| | | | | | | | | | | | | 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 attached devices validationEric Laurent2014-09-161-76/+94
| | | | | | | | | | | | Consider all supported devices in an io profile and not only the first one when looking for a match with attached devices. Failing to do so would cause the device validation to fail if supported devices are not declared in a specific order in the io profile descriptor in audio_policy.conf Bug: 17532764. Change-Id: Id27c9192e21de7f075076e17eb8c48e7e42847f6
* audio policy: fix relative priorities of PHONE and ENFORCED_AUDIBLEJon Eklund2014-09-121-7/+15
| | | | | | | | | ENFORCED_AUDIBLE should only be highest priority if system tones are being forced. Otherwise it should behave like SONIFICATION. Bug: 17474485. Change-Id: Ia651779870d51100cc3179c96fa09694bc691ba7
* audio policy: fix check in creaateAudioPatch()Eric Laurent2014-09-121-3/+3
| | | | | Bug: 17488759. Change-Id: I9dd2c3ca7f83de4b3573f4fb0e9934e1bc37c3bc
* AudioPolicyManager: Use "safe" speaker for notifications if availableJon Eklund2014-09-101-0/+21
| | | | | | | | | | | | | | | On particularly loud devices, unexpected audio bursts can be harmful. For longer audio events, the conventional mitigation strategy is to somehow soft-start (ramp) the loudspeaker volume, but this strategy can severely impact the audibility of short audio events. Use of the "safe" speaker path hints to AudioHAL to immediately output at best allowable level for transient audio events. SPEAKER_SAFE is aliased to SPEAKER for purposes of volume control. Bug: 17319721 Change-Id: I75187c23f3d1f18e9f638c5d14e7b0bf805a67bc
* audio policy: fix output stream selectionEric Laurent2014-09-082-6/+27
| | | | | | | | | Make sure that all outputs considered by selectOutput() when called from AudioPolicyManager::getOutputForDevice() support the requested audio format. Bug: 17340382. Change-Id: I76520ce60e9a8fe4d2d23125d6143bb016522754
* Merge "audiopolicy: fix direct output profile probing" into lmp-devEric Laurent2014-09-081-7/+39
|\
| * audiopolicy: fix direct output profile probingEric Laurent2014-09-071-7/+39
| | | | | | | | | | | | | | | | | | Do not select maximum sampling rate and channel count when opening a direct output for the first time to make sure that the combination of sampling rate and channel count is supported by the connected sink. Bug: 17047809. Change-Id: I077a3c1436158378f2762343469ceb39fab9775e
* | Merge "Fix "invalid device combination" in system audio mode." into lmp-devJungshik Jang2014-09-061-0/+7
|\ \ | |/ |/|
| * Fix "invalid device combination" in system audio mode.Jungshik Jang2014-09-051-0/+7
| | | | | | | | | | | | | | | | | | | | | | HDMI-CEC system audio mode removes speaker from output list. It also has multiple outputs by connected outputs. However, getDeviceForVolume() doesn't cover multiple output with no speaker or bluetooth case. This change picks one of system audio outputs in order. Bug: 17400026 Change-Id: I102fd0052c9c4c9543f9e8f3b16ec6815d7485d8
* | audio policy service: filter out delayed audio patch commands if needed.Eric Laurent2014-09-051-1/+35
|/ | | | | | | | | | As for set parameters commands, create or release audio patch commands modifying the same patch handle should be filtered by the audio policy service command thread so that an immediate command is not overridden by a pending delayed command. Bug: 17379728. Change-Id: I6aa4652b4bfec59eebd3c3cb7d1d9ac1bc1d6e49
* Merge "audio policy: fix input source passed to openInput()" into lmp-devEric Laurent2014-08-291-2/+4
|\
| * audio policy: fix input source passed to openInput()Eric Laurent2014-08-281-2/+4
| | | | | | | | | | | | | | | | | | The input source passed to openInput() must be modified from HOTWORD to VOICE_RECOGNITION if the capture does not correspond to a sound trigger session. Bug: 16731718. Change-Id: I48aa4180e75dd5335cd096b48da1c15f2236e6ed
* | audiopolicy: Indicate output device change to all input threads for ↵bryant_liu2014-08-281-0/+14
|/ | | | | | | | pre-processing Bug: 17129715 Change-Id: I1fd938cce0b85241c80ea00f3d013a98948d3975
* frameworks: av: AudioPolicyEffect: Add refCount for each sessionbryant_liu2014-08-282-11/+29
| | | | | | | | | | | Audio framework stops and restarts AudioTracks on same audio session. Sometimes the AudioTrack start() comes before a stop(). As effects are linked to the session, they should only be created on the last stop() related to that session. Bug: 17201117 Change-Id: I19343e293d6b7b6b794fe05ebd0dd239ed3b075c
* Merge "Fix audio dropouts with multiple playback streams." into lmp-devPaul McLean2014-08-281-1/+16
|\
| * Fix audio dropouts with multiple playback streams.Paul McLean2014-08-271-1/+16
| | | | | | | | | | | | Bug 17136569 Change-Id: I7f69cb24168c7d27ce28679735f53c1ece4014c1
* | Merge "audio policy: remove audio patch when closing input or output" into ↵Eric Laurent2014-08-282-3/+51
|\ \ | |/ |/| | | lmp-dev
| * audio policy: remove audio patch when closing input or outputEric Laurent2014-08-272-3/+51
| | | | | | | | | | | | | | | | | | 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-262-10/+11
|/ | | | | | | | 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-132-0/+58
|\
| * audiopolicy: add dump for audio patchesEric Laurent2014-08-102-0/+58
| | | | | | | | | | Bug: 10549017. Change-Id: I896c8e16c8cf7490bab75295903620a76236f571
* | Merge "Update audio ports with profile capabilities" into lmp-devJean-Michel Trivi2014-08-112-8/+78
|\ \ | |/ |/|
| * Update audio ports with profile capabilitiesJean-Michel Trivi2014-08-102-8/+78
| | | | | | | | | | | | | | | | | | When opening an output, import the profile capabilities associated with the device into the AudioPort. Bug 10549017 Change-Id: If102f5623457542d2c1407ada303c71e43d19a08
* | audio policy: enable more than one sink per audio patch.Eric Laurent2014-08-081-55/+91
|/ | | | | | | | | | | | Allow creation of audio patches with more than one sink. More than one sink is enabled when: - Connecting an input device to output devices on the same audio HW module. - Connecting an output mix to output devices on the same audio HA module. All other patches are limited to one sink. Bug: 16879363. Change-Id: I95be6948ef29df64e51e5b8ace38c2db7f3e89f2
* Merge "audio policy: add support for USB devices for voice call" into lmp-devEric Laurent2014-08-062-28/+257
|\
| * audio policy: add support for USB devices for voice callEric Laurent2014-08-062-28/+257
| | | | | | | | | | | | | | | | | | 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
* | AudioSystem: add API to query audio HW sync sourceEric Laurent2014-08-061-2/+11
|/ | | | | | | | | | | Add a method to query from the audio HAL the HW sync source used for a given audio session. Modify audio policy to select a direct output with HW sync when requested. Bug: 16132368. Change-Id: I03038f9188f2d389f8a5fd76a671854013a4513e
* Merge "audio: fix crashes upon USB device connection" into lmp-devEric Laurent2014-08-051-3/+7
|\
| * audio: fix crashes upon USB device connectionEric Laurent2014-08-051-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Audio policy: Replace unknown device assertion by debug log in setDeviceConnectionState(). It is possible that some kernels indicate connection of a legacy device type when a USB audio device is connected. We should just ignore this device. - Audio flinger: Make sure FastMixer thread is idle before exiting the normal mixer thread and closing the output stream. Change-Id: Ia10a20176a60a8aa56765538093a555fc998508a
* | policy manager: recognize AUDIO_DEVICE_IN_AMBIENT from policy.confEric Laurent2014-08-051-0/+1
|/ | | | Change-Id: If46b8d13f216bad4aa62598531d406d3303134f5
* audio policy: support line output deviceJon Eklund2014-08-052-11/+37
| | | | Change-Id: Iddf1b6486430270d871a45c75615e54339a818e9
* Add sound trigger control by audio policyEric Laurent2014-08-058-15/+130
| | | | | | | | | | | | | | | | | 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
* [audio][policy] fix crash when offloadInfo is NULLPhil Burk2014-08-041-2/+6
| | | | | | | | Added check for NULL pointer to avoid crash in AudioPolicyManager when playing AC3 data. Change-Id: Ie56788f6277be6da47d4218b1b4a6b359fce6473 Signed-off-by: Phil Burk <philburk@google.com>
* audio policy: fix service fuzz test crashEric Laurent2014-08-011-4/+4
| | | | | Bug: 13744391. Change-Id: I2430e09ad00476b9ac28dc55466942c61fb0531d
* Merge "Add Quad channel output to AudioPolicyManager" into lmp-devAndy Hung2014-07-291-0/+1
|\
| * Add Quad channel output to AudioPolicyManagerAndy Hung2014-07-291-0/+1
| | | | | | | | | | | | Matches some USB device configurations. Change-Id: I2429f9de87816b4ad1d39516e3821562617c76ee
* | audio policy: add missing enums in config file parsingEric Laurent2014-07-301-0/+1
| | | | | | | | Change-Id: I4edd6cde11de62c9c19dfa623d08cddf42c953db