summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioSystem.cpp
Commit message (Collapse)AuthorAgeFilesLines
* qcom-fm: audio: add support for FM featureMingming Yin2013-03-061-0/+13
| | | | | | | | | | Change-Id: Idd5c7a0364710d54809ef5d4c7b2404b22dc4cf6 Conflicts: include/media/IAudioFlinger.h media/libmediaplayerservice/StagefrightRecorder.cpp media/libstagefright/Android.mk
* libmedia: implement samsungs isSeparatedStream, built audioparametercodeworkx2013-01-141-0/+9
| | | | Change-Id: I96ec5b79c08e37c9bca59470addb5a9f7869eaea
* libmedia: add pre jb-4.2.1 signature for AudioSystem::getDeviceConnectionStateHashcode2012-11-301-0/+6
| | | | | | | | | | | With jb-4.2.1 the type audio_devices_t found in system/core/include/system/audio.h was redefined from a typedef enum to uint32_t. This causes the signature of AudioSystem::getDeviceConnectionState to change in libmedia.so. Any older than 4.2.1 prebuilt audio.primary.___.so binaries (such as mine from ICS) may refer to the old signature. This patch adds back in that reference. Change-Id: Ie4f92eaec20d581c9bebc805cfd25f8558406e30 Signed-off-by: Hashcode <hashcode0f@gmail.com>
* libmedia: Add ICS constructor for getOutputRicardo Cerqueira2012-11-261-0/+8
| | | | | | Used by the Tegra ICS OMX libraries Change-Id: I2f6e7f10f11b53853626d1be86e7b2be870720f4
* Support querying active record sourcesJean-Michel Trivi2012-10-101-0/+9
| | | | | | | | | Add support for querying whether there is currently a recording underway from the specified audio source. Bug 7314859 Change-Id: I986b231a10ffd368b08ec2f9c7f348d28eaeb892
* Implement android.media.AudioManager.getProperty()Glenn Kasten2012-09-251-0/+13
| | | | | Bug: 6635041 Change-Id: I3386a4a6c226bc4eceaf65556119e4fb15f73224
* effect_descriptor_t const correctnessGlenn Kasten2012-07-251-2/+2
| | | | Change-Id: Iad008f20d35a18acf500f773900164552fd0c19e
* Use audio_channel_mask_t more placesGlenn Kasten2012-07-101-6/+6
| | | | | | | | | | 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
* Use audio_channel_mask_t more consistentlyGlenn Kasten2012-07-031-6/+6
| | | | | | | | | | | | | | | In IAudioFlinger::createTrack() and IAudioFlinger::openRecord(), declare input parameter to use correct type audio_channel_mask_t. In IAudioFlinger::getInputBufferSize(), input parameter is now channel mask instead of channel count. Remove unused IAudioFlinger::channelCount(audio_io_handle_t). In AudioRecord::getMinFrameCount() and AudioSystem::getInputBufferSize(), input parameter is channel mask instead of channel count. Change-Id: Ib2f1c29bea70f016b3cfce83942ba292190ac965
* Remove acoustics from AudioSystem::getInput()Glenn Kasten2012-06-251-2/+1
| | | | Change-Id: I29fb3ee5664c1f0ee0409c1bb2be087ecca637db
* rename audio policy output flagsEric Laurent2012-04-181-1/+1
| | | | Change-Id: I27c46bd1d1b2b5f96b87af7d05b951fef18a1312
* audio policy: add configuration fileEric Laurent2012-04-031-47/+33
| | | | | | | | | | | removed outputs to stream mapping cache in audio system: the output for a given stream type must always be queried from audio policy manager as the cache is not always updated fast enough by audioflinger callback. removed AudioFlinger::PlaybackThread::setStreamValid() not used anymore if stream to output mapping is not cached. Change-Id: Ieca720c0b292181f81247259c8a44359bc74c66b
* Whitespace and indentationGlenn Kasten2012-03-131-5/+4
| | | | | | | | | | | | | | 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
* Merge "audio policy: use audio_devices_t when appropriate"Eric Laurent2012-03-081-2/+2
|\
| * audio policy: use audio_devices_t when appropriateEric Laurent2012-03-081-2/+2
| | | | | | | | Change-Id: I1b3a5879e81c789fb53d356af3d3a1ee2dca955f
* | IAudioFlingerClient::ioConfigChanged param2 constGlenn Kasten2012-03-061-5/+5
|/ | | | | | | | | The 3rd parameter (param2) to AudioFlingerClient::ioConfigChanged is used as an input. So changed it from void * to const void *. It is then cast to const OutputDescriptor * or const audio_stream_type_t * depending on the event. Change-Id: Ieec0d284f139b74b3389b5ef69c7935a8e5650ee
* Use audio_io_handle_t consistently instead of intGlenn Kasten2012-02-081-3/+6
| | | | | | | | Other: - add a comment to nextUniqueId - made ThreadBase::mId const, since it is only assigned in constructor. Change-Id: I4e8b7bec4e45badcde6274d574b8a9aabd046837
* Use NULL not 0 for raw pointersGlenn Kasten2012-02-031-6/+6
| | | | | | Use if (p != NULL) instead of if (ptr) Change-Id: Iaec3413a59ccbf233c98fcd918cc7d70ac5da9fa
* More audio_stream_type_tGlenn Kasten2012-01-271-3/+4
| | | | Change-Id: I1260259efe0aa3fc1ef13de69758aaa592e1f815
* 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-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
* Merge "Remove redundant get()"Glenn Kasten2012-01-201-2/+2
|\
| * Remove redundant get()Glenn Kasten2012-01-201-2/+2
| | | | | | | | | | | | | | get() is almost always unnecessary, except in a LOG. Also no need to check for != 0 before calling get(). Change-Id: Ib06e7a503f86cf102f09acc1ffb2ad085025516d
* | Merge "Remove dead setRingerMode(mode, mask)"Glenn Kasten2012-01-201-7/+0
|\ \ | |/ |/|
| * Remove dead setRingerMode(mode, mask)Glenn Kasten2012-01-181-7/+0
| | | | | | | | Change-Id: Ia4cc8be8424a40b3dcb7ebd0264fdff4e5247f7f
* | Merge "Simplify range check for audio_mode_t (continued)"Glenn Kasten2012-01-191-0/+1
|\ \
| * | Simplify range check for audio_mode_t (continued)Glenn Kasten2012-01-181-0/+1
| |/ | | | | | | | | | | Missed one place in earlier CL of same name Change-Id: I0dd25364d0b8d5d731c02d352f139a0c8d4df1a8
* | Temporarily restore AudioSystem/AudioTrack APIs with their former signaturesAndreas Huber2012-01-181-0/+10
|/ | | | | | until we get updated prebuilts from vendor. Change-Id: I8aae81d2513edca0ab268053a11c8c4206879e61
* Merge "audio framework: manage stream volume per device"Eric Laurent2012-01-171-4/+8
|\
| * audio framework: manage stream volume per deviceEric Laurent2012-01-171-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-14/+14
|/ | | | | | | | | 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
* Merge "Fix race in AudioSystem::getInputBufferSize"Glenn Kasten2012-01-111-9/+14
|\
| * Fix race in AudioSystem::getInputBufferSizeGlenn Kasten2012-01-101-9/+14
| | | | | | | | | | | | It was caching the recording parameters without a mutex. Change-Id: Ic4b9f621cbc080d224c2233cf3ca3454fc0f19bd
* | Simplify range check for audio_mode_tGlenn Kasten2012-01-101-1/+1
|/ | | | | | | | | | AudioSystem::setMode previously allowed negative modes, but these were then rejected by AudioFlinger. Now negative modes (including AUDIO_MODE_INVALID and AUDIO_MODE_CURRENT) are explicitly disallowed. Change-Id: I0bac8fea737c8eb1f5b6afbb893e48739f88d745
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-081-1/+1
| | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
* Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGESteve Block2012-01-061-6/+6
| | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
* Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-031-2/+2
| | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
* Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGESteve Block2011-10-261-13/+13
| | | | | | | See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
* Fix issue 5252593: any app can restart the runtimeEric Laurent2011-09-021-1/+7
| | | | | | Replace null device address string by empty sting. Change-Id: I285c35f3345334e6d2190493b1a8a5aca1a361a4
* 226483: A2DP connected, but music out to speakerEric Laurent2011-08-301-0/+8
| | | | | | | | | | | | | | | | When the A2DP headset is connected, there is a possible race condition when the audio tracks are moved from the mixer thread attached to the speaker output to the thread attached to A2DP output. As the request to clear the stream type to output mapping cache in the client process is asynchronous, it is possible that the flag indicating to the client audio track to re-create the IAudioTrack on the new thread is processed before the cache is invalidated. In this case, the track will be attached to the old thread and music will continue playing over the device speaker instead of being redirected to A2DP headset. Change-Id: Ib2ce1eb5320eaff83287b93779061bf4e7a330df
* Audio effects: track CPU and memory use separatelyEric Laurent2011-08-111-0/+7
| | | | | | | | | | | | | | | | | | | | | | 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
* Keep effects sessions active when the caller dies.Marco Nelissen2011-08-091-0/+14
| | | | | | | | Don't remove effects until the session they are in goes away or all AudioEffects have been explicitly released. This allows the control panel process to die without stopping the effects. Change-Id: I4496e5df080230ca1af149dec95c1309ab8ea888
* Audio framework: support for audio pre processingEric Laurent2011-07-181-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove dead code related to gettidGlenn Kasten2011-06-031-7/+0
| | | | | | The gettid system call is always available now. Change-Id: Ib78b41781eda182dc8605daf456bbea7ff7c2dc0
* 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-161/+46
| | | | | Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5 Signed-off-by: Dima Zavin <dima@android.com>
* libmedia: move AudioParameter out of AudioSystemDima Zavin2011-04-271-154/+0
| | | | | Change-Id: I9eb7e002d141936258050d4fa4f0ccd8202bfc54 Signed-off-by: Dima Zavin <dima@android.com>
* Bug 3352047 Wrong message when adjusting volumeGlenn Kasten2011-02-101-0/+7
| | | | | | Add hidden AudioManager.getDevicesForStream and output device codes. Change-Id: I4d1c1d3b6a077cd117720817d1f733dda557b947