summaryrefslogtreecommitdiffstats
path: root/include/media/IAudioPolicyService.h
Commit message (Collapse)AuthorAgeFilesLines
* audiopolicy: Add AudioSessionInfo APISteve Kondik2016-04-271-0/+3
| | | | | | | | | | | | | | | | * This patch introduces a new API which allows applications to query the state of the audio effects system, and receive callbacks with the necessary information to attach effects to any stream. * In the future, this may come as part of the AudioPort system, but since that's an active area of development by Google, we will dodge it for now. * The policy now simply keeps a refcounted list of objects which hold various bits of stream metadata. Callbacks are sent on stream open/close to applications which might be listening for them. Change-Id: I2d554d36e1378f4eb7b276010a3bfe8345c22ecd
* audiopolicy: Revert all session callback patches.Steve Kondik2016-04-221-2/+0
| | | | | | | | | | | | | | | | * This has been rearchitected in a better way, as this feature turns out to be more difficult than it seems. * Reverting all of this stuff and rolling it into a single commit. This reverts commit c27a16c33c78a36482336a16199b1b8be794cea4. This reverts commit 32ef0556ae58ff6b7c6fe6fb0a17d3ff7f01de31. This reverts commit 489c9fb62f02e1d23d6d6c89b22f7d19c596e65e. This reverts commit a4123803d0a0e9e0c69faa4207d357cc74a65d58. This reverts commit e13b58b988ab642d4ae5ca6d0a89013510714956. This reverts commit 47f8c7303c9e2054f1492b02b6c7472385c52dc9. This reverts commit 0479d7c79a7fd6f112e8dc7e45c009cf6602dbaa. Change-Id: Iaed9f198d806aa414c95960713e8187c98db248b
* audiopolicy: Add notification when default effects are updatedSteve Kondik2016-03-081-0/+2
| | | | | | | | | | | | | | | | | | | * In M, we now have the ability to define a default set of audio effect on a per-stream basis. This allows us to get around the problem of apps not sending the control intents so we can implement smart global effects for specific media types. * We still need a session id in order to get a handle and configure them from an app like AudioFX, so we'll need to add some plumbing in order to send an event to interested applications. * This patch implements the native side of this. The Java layer will call down thru AudioSystem and register a callback which will be invoked by the audio policy when default effects are updated on a stream. This callback will receive both the stream type as well as the session id. * Attaching this listener requires that the caller hold the MODIFY_AUDIO_ROUTING permission. Change-Id: I142b15f2585ffca6a953c3e828e2a7c07b24f56c
* reduce number of binder calls from mediaserverEric Laurent2015-06-261-0/+2
| | | | | | | | | | | | | | | Reduce the number of audio port, audio patch and IO config changed binder calls from mediaserver to client processes: - Do not call IO config changed callback if selected device is the same as previously selected one on a given audio flinger playback or capture thread. - Do not call the audio port or audo patch list update callback on a client if this client as no listener registered. Bug: 22045560. Change-Id: If780e105404de79b7cb5c80c27b793ceb6b1c423
* audio policy: session routes continued.Eric Laurent2015-04-301-0/+2
| | | | | | | | | | | - Clear session routes when client process dies. - Enforce the route only when the requesting session is active. - Fix requested route not working if an output mix change is required (e.g forcing to SPEAKER when the default route is USB or A2DP). - Make sure all sessions sharing the strategy with a rerouted session have the same route (needed for volume control consistency) Change-Id: I0ab347a8fb97e73e2c5965374544c5f4fe509ef1
* Explicit routing in AudioRecordPaul McLean2015-04-281-6/+7
| | | | Change-Id: I9cc5d54883a3e5c75d553fabb619fc8e49f4f9e5
* audio policy: add binder calls for audio source controlEric Laurent2015-04-151-0/+5
| | | | | | | Add binder methods to IAudioPolicyService to control activity of external audio sources (e.g FM tuner). Change-Id: I2008308a6a996baeae502b68a790d87281efe2ff
* Adding explicit routing API to AudioTrackPaul McLean2015-04-081-0/+1
| | | | Change-Id: I40c048c7644c46f4e4f7103875206c0785c4b1dc
* Add additional info to AudioPort for enum/selection API.Paul McLean2015-02-051-1/+2
| | | | | | | | | | 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: binder calls for dynamic audio policy mixesEric Laurent2014-12-091-0/+3
| | | | | | | | | Add binder calls to register and unregister dynamic mixes to AudioPolicyManager. Bug: 16009464. Change-Id: I4ef38166d0cfc88c984970969380d0cd6eb083ac
* 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-10/+15
| | | | | | | | | | | | | | | | | | | | | | | 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: fix stream type for accessibility usageEric Laurent2014-09-251-0/+2
| | | | | | | | | 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
* Add sound trigger control by audio policyEric Laurent2014-08-051-0/+6
| | | | | | | | | | | | | | | | | 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: pass session ID to capture activity methodsEric Laurent2014-07-281-3/+6
| | | | | | | | Indicate the audio session ID when calling getInput(), startInput(), stopInput(), releaseInput(). Bug: 12378680. Change-Id: I763793752f93e2f4e1445a5ab217c895af011038
* Add audio_input_flags_t to IAudioPolicyService::getInputGlenn Kasten2014-07-171-4/+5
| | | | Change-Id: I9f37be05f8dc7b85a8827a94e76ca0f45453e170
* AudioPolicyManager: return output for audio attributesJean-Michel Trivi2014-06-181-0/+6
| | | | | | | | | | 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
* audio policy: add routing update client interfaceEric Laurent2014-05-291-0/+2
| | | | | | | | | | | | | Added IAudioPolicyServiceClient client binder interface for client process to receive notifications from AudioPolicyService when audio ports are added/removed or audio patches created/released. The audio patches owned by a given client are automatically released when this client binder dies. Bug: 14815883. Change-Id: I6013f6aec03b50565cffb1ad2cd1f0f8852032c5
* DO NOT MERGE - IAudioPolicyService interface extension for patch panelEric Laurent2014-05-281-0/+25
| | | | Change-Id: I0a62e5416edc41c3a0e816275085ab18a23066f1
* Public API changes for audio offload support.Richard Fitzgerald2013-06-271-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: this does _not_ include all private member variables added to classes as part of offload support. Only public/protected functions and stubs functions/variables needed to make the changes buildable. - isOffloadSupported() added to audio policy service A stub implementation is required to build, this always returns false - setParameters() added to IAudioTrack A stub implementation is required to build, this always returns INVALID_OPERATION - CBlk flag for stream end - Change AudioSystem::getRenderPosition() to take an audio_output_t so caller can specify which output to query - Add AudioSystem::isOffloadSupported() This is fully implemented down to the AudioFlinger function AudioPolicyServer::isOffloadSupported() which is just a stub that always returns false. - Add EVENT_STREAM_END to AudioTrack interface. STREAM_END is used to signal when the hardware has actually finished playing all the data it was sent. - Add event type enumeration to media player interface AudioSink callbacks so that the same callback can be used to handle multiple types of event. For offloaded tracks we also have to handle STREAM_END and TEAR_DOWN events - Pass audio_offload_info_t to various functions used for opening outputs, tracks and audio players. This passes additional information about the compressed stream down to the HAL when using offload. For publicly-available APIs this is an optional parameter (for some of the internal and low-level APIs around the HAL interface it is mandatory) - Add getParameters() and setParameters() API to AudioTrack Currently dummy implementations. - Change AudioPlayer contructor so that it takes a set of bitflags defining what options are required. This replaces the original bool which only specified whether to use deep buffering. - Changes to StageFright class definition related to handling tearing-down of an offloaded track when we need to switch back to software decode - Define new StageFright utility functions used for offloaded tracks Currently dummy implementations. - AudioFlinger changes to use extended audio_config_t. Fills in audio_offload_info_t member if this info is passed in when opening an output. - libvideoeditor changes required to add the new event type parameter to AudioSink callback functions - libmediaplayerservice changes required to add the new event type parameter to AudioSink callback functions Change-Id: I3ab41138aa1083d81fe83b886a9b1021ec7320f1 Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Eric Laurent <elaurent@google.com>
* Add support for querying if a stream is active remotelyJean-Michel Trivi2013-02-111-0/+2
| | | | | | Bug 7485803 Change-Id: I0744374f130fd2dd0714102354cffed2fa915361
* Line length 100Glenn Kasten2012-11-011-2/+3
| | | | Change-Id: Ib28fd7b9ce951a6933f006e7f8812ba617625530
* Support 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: I986b231a10ffd368b08ec2f9c7f348d28eaeb892
* effect_descriptor_t const correctnessGlenn Kasten2012-07-251-2/+2
| | | | Change-Id: Iad008f20d35a18acf500f773900164552fd0c19e
* Use audio_channel_mask_t more placesGlenn Kasten2012-07-101-2/+2
| | | | | | | | | | Use it in AudioSystem::getOutput(), AudioSystem::getInput(), IAudioPolicyService::getOutput(), IAudioPolicyService::getInput(), and various other places in AudioFlinger. Not done: AudioTrack and OutputDescriptor. Change-Id: I70e83455820bd8f05dafd30c63d636c6a47cd172
* Remove acoustics from AudioSystem::getInput()Glenn Kasten2012-06-251-1/+0
| | | | Change-Id: I29fb3ee5664c1f0ee0409c1bb2be087ecca637db
* rename audio policy output flagsEric Laurent2012-04-181-1/+1
| | | | Change-Id: I27c46bd1d1b2b5f96b87af7d05b951fef18a1312
* audio policy: use audio_devices_t when appropriateEric Laurent2012-03-081-1/+1
| | | | Change-Id: I1b3a5879e81c789fb53d356af3d3a1ee2dca955f
* renamed audio policy output flag.Eric Laurent2012-03-011-1/+1
| | | | | | | Renamed AUDIO_POLICY_OUTPUT_FLAG_INDIRECT to AUDIO_POLICY_OUTPUT_FLAG_NONE which is more appropriate. Change-Id: Ia14d60397df0f2dcd9bea0186400a09da35bc104
* Use audio_source_t consistentlyGlenn Kasten2012-01-261-1/+1
| | | | | | | | | | | | | | | | Was a mix of audio_source_t, uint8_t, and int. Related fixes: - fix comments in MediaRecorder.java - AudioPolicyService server side was not checking source parameter at all, so if the client wrapper was bypassed, invalid values could be passed into audio HAL - JNI android_media_AudioRecord_setup was checking source for positive values, but not negative values. This test is redundant, since already checked at Java and now checked by AudioPolicyService also, but might as well make it correct. Change-Id: Ie5e25d646dcd59a86d7985aa46cfcb4a1ba64a4a
* Use audio_format_t consistently, continuedGlenn Kasten2012-01-201-2/+2
| | | | | | | | | | | | Was int or uint32_t. When AudioFlinger::format can't determine the correct format, return INVALID rather than DEFAULT. Init mFormat to INVALID rather than DEFAULT in the constructor. Subclass constructors will set mFormat to the correct value. Change-Id: I9b62640aa107d24d2d27925f5563d0d7407d1b73
* Remove dead setRingerMode(mode, mask)Glenn Kasten2012-01-181-1/+0
| | | | Change-Id: Ia4cc8be8424a40b3dcb7ebd0264fdff4e5247f7f
* Merge "audio framework: manage stream volume per device"Eric Laurent2012-01-171-2/+6
|\
| * audio framework: manage stream volume per deviceEric Laurent2012-01-171-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve volume management by keeping track of volume for each type of device independently. Volume for each stream (MUSIC, RINGTONE, VOICE_CALL...) is now maintained per device. The main changes are: - AudioService now keeps tracks of stream volumes per device: volume indexes are kept in a HashMap < device , index>. active device is queried from policy manager when a volume change request is received initalization, mute and unmute happen on all device simultaneously - Settings: suffixes is added to volume keys to store each device volume independently. - AudioSystem/AudioPolicyService/AudioPolicyInterface: added a device argument to setStreamVolumeIndex() and getStreamVolumeIndex() to address each device independently. - AudioPolicyManagerBase: keep track of stream volumes for each device and apply volume according to current device selection. Change-Id: I61ef1c45caadca04d16363bca4140e0f81901b3f
* | Merge "Use audio_mode_t consistently"Glenn Kasten2012-01-171-1/+1
|\ \ | |/ |/|
| * Use audio_mode_t consistentlyGlenn Kasten2012-01-121-1/+1
| | | | | | | | | | | | | | It was int or uint32_t. Also make getMode() const. Change-Id: Ibe45aadbf413b9158e4dd17f2b3bcc6355288d37
* | Use audio_stream_type_t consistentlyGlenn Kasten2012-01-131-1/+1
|/ | | | | | | | | At native level it was a mixture of audio_stream_type_t, int, uint32_t, and uint8_t. Java is still int. Also fixed a couple of hard-coded -1 instead of AUDIO_STREAM_DEFAULT, and in startToneCommand a hard-coded 0 instead of AUDIO_STREAM_VOICE_CALL. Change-Id: Ia33bfd70edca8c2daec9052984b369cd8eee2a83
* Audio effects: track CPU and memory use separatelyEric Laurent2011-08-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | Before this change, CPU and memory usage for an audio effect were registered and checked against the limit by audio policy manager upon effect instantiation. Even if an effect was not enabled it would prevent another effect to be created if the CPU load budget was exceeded, which was too restrictive. This change adds a method to register/unregister CPU load only when an effect is enabled or disabled. It also adds a mechanism to place all effects on the global output mix in suspend state (disabled) when an effect is enabled on a specific session. This will allow applications using session effects to have the priority over others using global effects. Also fixes some issues with suspend/restore mechanism: - avoid taking actions when an effect is disconnected and was not enabled. - do not remove a session from the suspended sessions list when corresponding effect chain is destroyed. Change-Id: I5225278aba1ae13d0d0997bfe26a0c9fb46b17d3
* Added APIs for audio preprocessingEric Laurent2011-07-251-0/+3
| | | | | | | | | | | | | | | Added APIs to control pre processes applied on captured audio. Those APIs are still hidden until reviewed by API council. Three types of standard pre processes are supported: - Automatic Gain Control (AGC) by AutomaticGainControl class - Acoustic Echo Cancellation (AEC) by AcousticEchoCanceler class - Noise Suppression (NS) by NoiseSuppressor class A method is added to AudioEffect class to query audio pre processings applied by default by the platform on a given AudioRecord session ID. Change-Id: I0b9fceeb8c704dd06319c3b52b85c96fe871d51d
* Audio framework: support for audio pre processingEric Laurent2011-07-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Audio effect framework is extended to suport effects on output and input audio path. AudioFlinger: Support for audio effects and effect chains is moved from PlaybackThread class to ThreadBase class so that RecordThread can manage effects. Effects of type pre processing are allowed on record thread only. When a pre processing is enabled, the effect interface handle is passed down to the input stream so that the audio HAL can call the process function. The record thread loop calls the effect chain process function that will only manage the effect state and commands and skip the process function. AudioRecord: The audio session is allocated before calling getInput() into audio policy serice so that the session is known before the input theead is created and pre processings can be created on the correct session. AudioPolicyService: default pre processing for a given input source are loaded from audio_effects.conf file. When an input is created, corresponding effects are created and enabled. Change-Id: Id17119e0979b4dcf189b5c7957fec30dc3478790
* audio: update for audio/audio_policy header names/locationsDima Zavin2011-06-131-1/+1
| | | | | Change-Id: I36c49352eee57559403cd1597f56a8485a360289 Signed-off-by: Dima Zavin <dima@android.com>
* audio/media: convert to using the audio HAL and new audio defsDima Zavin2011-04-271-17/+18
| | | | | Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5 Signed-off-by: Dima Zavin <dima@android.com>
* Bug 3352047 Wrong message when adjusting volumeGlenn Kasten2011-02-101-0/+1
| | | | | | Add hidden AudioManager.getDevicesForStream and output device codes. Change-Id: I4d1c1d3b6a077cd117720817d1f733dda557b947
* Fix issue 3371080Eric Laurent2011-02-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | 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
* Audio policy manager changes for audio effectsEric Laurent2010-07-201-2/+14
| | | | | | | | | | | | | | | 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
* Fix issue 1795088 Improve audio routing codeEric Laurent2009-07-231-0/+90
Initial commit for review. Integrated comments after patch set 1 review. Fixed lockup in AudioFlinger::ThreadBase::exit() Fixed lockup when playing tone with AudioPlocyService startTone()