summaryrefslogtreecommitdiffstats
path: root/media/libmedia/IAudioPolicyService.cpp
Commit message (Collapse)AuthorAgeFilesLines
* libmedia: offloaded playback supportRichard Fitzgerald2013-07-251-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | - start() returns a status so that upper layers can recreate a non offloaded track in case of error. - Added states to handle offloaded tracks specific: - waiting for stream end (drain) notification by audio flinger - allow pause while waiting for stream end notification - getPosition() queries the render position directly from audio HAL. - disable APIs not applicable to offloaded tracks - Modified track restoring behavior for invalidated offloaded tracks: just send the callback and wait for upper layers to create a new track. - Added wait for stream end management in audio track client proxy. Similar to obtainBuffer and should be factored in. Change-Id: I0fc48117946364cb255afd653195498891f622bd Signed-off-by: Eric Laurent <elaurent@google.com>
* Public API changes for audio offload support.Richard Fitzgerald2013-06-271-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+20
| | | | | | Bug 7485803 Change-Id: I0744374f130fd2dd0714102354cffed2fa915361
* Line length 100Glenn Kasten2012-11-011-3/+6
| | | | Change-Id: Ib28fd7b9ce951a6933f006e7f8812ba617625530
* Support querying active record sourcesJean-Michel Trivi2012-10-101-0/+17
| | | | | | | | | 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-8/+8
| | | | | | | | | | 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-5/+0
| | | | Change-Id: I29fb3ee5664c1f0ee0409c1bb2be087ecca637db
* rename audio policy output flagsEric Laurent2012-04-181-3/+3
| | | | Change-Id: I27c46bd1d1b2b5f96b87af7d05b951fef18a1312
* Whitespace and indentationGlenn Kasten2012-03-131-1/+1
| | | | | | | | | | | | | | Fix indentation to be multiple of 4. Make it easier to search: sp< not sp < to "switch (...)" instead of "switch(...)" (also "if" and "while") Remove redundant blank line at start or EOF. Remove whitespace at end of line. Remove extra blank lines where they don't add value. Use git diff -b or -w to verify. Change-Id: I966b7ba852faa5474be6907fb212f5e267c2874e
* audio policy: use audio_devices_t when appropriateEric Laurent2012-03-081-2/+2
| | | | Change-Id: I1b3a5879e81c789fb53d356af3d3a1ee2dca955f
* Use audio_source_t consistentlyGlenn Kasten2012-01-261-3/+3
| | | | | | | | | | | | | | | | 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-4/+4
| | | | | | | | | | | | 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-19/+1
| | | | Change-Id: Ia4cc8be8424a40b3dcb7ebd0264fdff4e5247f7f
* Merge "audio framework: manage stream volume per device"Eric Laurent2012-01-171-4/+15
|\
| * audio framework: manage stream volume per deviceEric Laurent2012-01-171-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+2
|\ \ | |/ |/|
| * Use audio_mode_t consistentlyGlenn Kasten2012-01-121-2/+2
| | | | | | | | | | | | | | It was int or uint32_t. Also make getMode() const. Change-Id: Ibe45aadbf413b9158e4dd17f2b3bcc6355288d37
* | Use audio_stream_type_t consistentlyGlenn Kasten2012-01-131-6/+6
|/ | | | | | | | | 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-1/+20
| | | | | | | | | | | | | | | | | | | | | | 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/+49
| | | | | | | | | | | | | | | 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-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* update for new audio.h header locationDima Zavin2011-05-121-1/+1
| | | | | Change-Id: Ic4c62c4037800802427eb7d3c7f5eb8b25d18876 Signed-off-by: Dima Zavin <dima@android.com>
* audio/media: convert to using the audio HAL and new audio defsDima Zavin2011-04-271-46/+48
| | | | | Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5 Signed-off-by: Dima Zavin <dima@android.com>
* Bug 3352047 Wrong message when adjusting volumeGlenn Kasten2011-02-101-1/+19
| | | | | | Add hidden AudioManager.getDevicesForStream and output device codes. Change-Id: I4d1c1d3b6a077cd117720817d1f733dda557b947
* Fix issue 3371080Eric Laurent2011-02-031-1/+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
* Audio policy manager changes for audio effectsEric Laurent2010-07-201-17/+131
| | | | | | | | | | | | | | | 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 2001214: AudioFlinger and AudioPolicyService interfaces should not ↵Eric Laurent2009-08-071-26/+16
| | | | | | | use pointers as handles to inputs and outputs. Use integers instead of void* as input/output handles at IAudioFlinger and IAudioPolicyService interfaces. AudioFlinger maintains an always increasing count of opened inputs or outputs as unique ID.
* Fix issue 1795088 Improve audio routing codeEric Laurent2009-07-231-0/+423
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()