summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Enable 8 bit and float pcm record formats for AudioFlingerAndy Hung2015-04-081-14/+42
| | | | | | | Update sampling rate handling as well. Bug: 19570772 Change-Id: I872248e64c0578b2e48869a68fee0d51bd0640c3
* AudioFlinger: call SPDIF wrapper from AudioFlingerPhil Burk2015-03-241-20/+11
| | | | | | | | | | | | | Create an interface layer between the AudioFlinger and the HAL that manages the wrapping and format conversion. Removed unnecessary includes. Handle rate conversion in getRenderPosition(). Try to open HAL with encoded format before wrapping with SPDIF. Bug: 17566660 Change-Id: I00ad888ca15ff0f85b85efb8167c7f5ea761a244 Signed-off-by: Phil Burk <philburk@google.com>
* Rename tee sink file name and add prefix to macrosGlenn Kasten2015-03-061-12/+12
| | | | Change-Id: If316b9e32963d9baef8f4382fcc73dc6c4ff684d
* Rename formal parameter to match type nameGlenn Kasten2015-03-061-8/+8
| | | | Change-Id: I0761005b751f5c4a4b28729b1820961ff3077afd
* Remove redundant semicolon from namespace closingGlenn Kasten2015-03-031-1/+1
| | | | Change-Id: I163f9d3d216c283ae1160ce4802e5247cf44fba7
* Fix for getMicMute in AudioFlingerRicardo Garcia2015-02-191-4/+10
| | | | | | | | | | Previous logic will only check for mic state of Primary Hardware Device. Current logic checks state of all devices with valid microphone input. This is needed for audio_output feature support. bug: 19439530 Change-Id: Ibbb92412ac70cf2915bbe8660c04fbaf0ab74171
* Line length 100Glenn Kasten2014-12-301-1/+2
| | | | Change-Id: I6c8fe626a3825fa9e139319656d682a57b887c97
* am 93118cd9: am 99429b40: am 277c7b8c: Merge "Fix permission check for audio ↵Jean-Michel Trivi2014-12-171-7/+0
|\ | | | | | | | | | | | | recording" into lmp-mr1-dev * commit '93118cd96233b682be95a3eb114d88d69c8cc416': Fix permission check for audio recording
| * am 99429b40: am 277c7b8c: Merge "Fix permission check for audio recording" ↵Jean-Michel Trivi2014-12-171-7/+0
| |\ | | | | | | | | | | | | | | | | | | into lmp-mr1-dev * commit '99429b40411790b85e19c57392bbd292a237c470': Fix permission check for audio recording
| | * Fix permission check for audio recordingJean-Michel Trivi2014-12-151-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | am 72215491: am 1a475921: am 223fd5c9: audio: new routing strategies and ↵Eric Laurent2014-11-261-7/+30
|\ \ \ | |/ / | | | | | | | | | | | | | | | stream types * commit '72215491c60fbcdb9a2f0be782e24e39cca249c5': audio: new routing strategies and stream types
| * | am 1a475921: am 223fd5c9: audio: new routing strategies and stream typesEric Laurent2014-11-261-7/+30
| |\ \ | | |/ | | | | | | | | | * commit '1a475921c0577a4650d1bbe40a85b732d1766939': audio: new routing strategies and stream types
| | * audio: new routing strategies and stream typesEric Laurent2014-11-211-7/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | resolved conflicts for merge of e78a27ca to lmp-mr1-dev-plus-aospMarco Nelissen2014-11-171-1/+1
| |\ \ | | |/ | |/| | | | Change-Id: If10a9cc17245f95d5e10b1507445abbb4020670e
| | * 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
* | | Update calls to IInterface::asBinder()Marco Nelissen2014-11-141-1/+1
| | | | | | | | | | | | | | | | | | to use the new static version. Change-Id: I89a5988a0ac694ffc04d88cf939e8455bf925d4c
* | | am d202ac37: am b7092547: Merge "remove some restrictions on effect output ↵Eric Laurent2014-11-041-1/+2
|\ \ \ | |/ / | | | | | | | | | | | | | | | channels" into lmp-mr1-dev automerge: ed1e55c * commit 'd202ac37fc1f5f31e180af55cebd22810a80251b': remove some restrictions on effect output channels
| * | remove some restrictions on effect output channelsEric Laurent2014-11-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Do not prevent from attaching effects to a non stereo output thread, unless the output thread is a mixer thread. Bug: 18157592. Change-Id: I6ac3187187a1b8aade7db04ea6dfbc47dacc25c3
* | | am 1f4b82a2: am b14e6dc8: Merge "Always use an address for remote submix" ↵Jean-Michel Trivi2014-10-301-2/+2
|\ \ \ | |/ / | | | | | | | | | | | | | | | into lmp-mr1-dev automerge: 6e8212b * commit '1f4b82a20d75b5aa8d7801d342ac3a9b48fa0863': Always use an address for remote submix
| * | Always use an address for remote submixJean-Michel Trivi2014-10-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usage of remote submix device for audio rerouting (e.g. wifi display) didn't mandate the use of addresses. Use "0" as the default address when none is specificed. In logs, only use hex format for audio devices Bug 16009464 Change-Id: Ibfb1ce6881eba8b7e34420293b8a7077a6e659e6
* | | am 6efbadac: am b6a89512: am 9d0d5958: Merge "audioflinger: new HW A/V sync ↵Eric Laurent2014-10-221-9/+57
|\ \ \ | |/ / | | | | | | | | | | | | | | | ID allocation flow" into lmp-mr1-dev * commit '6efbadac3ff5c3ddc194faaba44f1fe63e452c7f': audioflinger: new HW A/V sync ID allocation flow
| * | audioflinger: new HW A/V sync ID allocation flowEric Laurent2014-10-221-9/+57
| |/ | | | | | | | | | | | | | | | | | | | | | | | | The HW A/V sync ID is now allocated by the audio HAL before the output stream is created by a call to global get_parameters() with key AUDIO_PARAMETER_HW_AV_SYNC. When the AudioTrack is created, the HW A/V sync ID is communicated to the output stream by stream set_parameters() with key AUDIO_PARAMETER_STREAM_HW_AV_SYNC. Bug: 17112525. Change-Id: Ia8bc6f3bf9f358aa89f3f56ac554e893a19811ad
* | Check for duplicate uuids when parsing audio_effects.confMarco Nelissen2014-10-081-0/+3
|/ | | | | | | | | uuids need to be unique, and things don't work properly when they're not. Also fix/enhance/extend the dumpEffectDescriptor() method, and include a list of effects in audioflinger dumpsys. Change-Id: I3dfbc5ed0f7272c7809e337f2929212ece047ee4
* audioflinger: fix pre processing transfer between record threads.Eric Laurent2014-10-021-5/+43
| | | | | | | | | | | | Fix two problems remaining with pre processing effects transfer from one record thread to the next in case of tear down due to device connection: 1 - the enabled state of the effects was not communicated to the new HAL input stream. 2 - the effects saved in orphan chains list were not transfered to the new thread when a AudioRecord was created. Bug: 17757378. Change-Id: I0923c98470db3b51154dc89846157780a4c21e86
* Merge "audioflinger: fix pre processing effect leak" into lmp-devEric Laurent2014-09-151-1/+68
|\
| * audioflinger: fix pre processing effect leakEric Laurent2014-09-151-1/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a capture thread was closed, the effects attached to this thread were left dangling and the associated effect chain destroyed. When their last client was disconnected, the effects were not released properly from the effect library because the destruction process could not be completed without the effect being attached to a thread. A similar problem prevented a RecordTrack to be properly released if its client was destroyed after the capture thread. The fix consists in allowing the effect or record track to be properly released even if its parent thread cannot be promoted. Also save any effect chain still present on a closed capture thread in case a new client wants to reuse the effects on the same session later. Bug: 17110064. Change-Id: I5cd644daa357afd1f3548f9bcb28e6152d95fdb8
* | audioflinger: send mic mute command to all audio HALsEric Laurent2014-09-151-2/+7
|/ | | | | | | | | Mic mute should be sent to all audio HALs, not only the primary HAL as telephony can use capture devices on other HALs (e.g USB) Bug: 17321604. Change-Id: I658f6084d5b5cdc5a70784661d5cea0b6f81c3a9
* Restore the ability to build tee sink for debuggingGlenn Kasten2014-09-021-10/+14
| | | | | | | | | | | | This changelist does not enable tee sink, but makes it possible to do so. Tee sink had suffered some bit rot since it is not built by default. Also fixes a crash for > 2 byte per sample or > 2 channels. Still does not write correct header for floating-point; that will be best solved by moving to libsndfile. Bug: 16990102 Change-Id: I8e92c588ccc513d7802d696fcfb324e815772df6
* AudioSystem: add API to query audio HW sync sourceEric Laurent2014-08-061-0/+19
| | | | | | | | | | | 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
* audio flinger: fix service fuzz test crashEric Laurent2014-08-041-0/+6
| | | | | Bug: 13744704. Change-Id: I572c89f88dcab2b8b612ec6860983306f9f159ab
* rename AudioSystem::newAudioSessionId()Eric Laurent2014-07-281-1/+1
| | | | | | | | | Rename AudioSystem::newAudioSessionId() to AudioSystem::newAudioUniqueId() as it can be used also for I/O handles. Bug: 12378680. Change-Id: I611ea3b5eb57a4b0774437f477ee87dc4ccc2cc2
* AudioFlinger: update openInput() and openOutput()Eric Laurent2014-07-281-117/+85
| | | | | | | | | | 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
* Add multichannel capability to AudioFlingerAndy Hung2014-07-241-13/+31
| | | | | | But not enabled (kEnableExtendedChannels == false). Change-Id: I62f7e31fbd29ad703a9a02f5d1a280b6972dd423
* audio flinger: add patch connection between hw modulesEric Laurent2014-07-241-87/+140
| | | | | | | | | | | | | | | | | | Add support for audio device connections between different audio hw modules. The patch is performed by creating a bridge between the playback thread connected to the sink device and the record thread connected to the source device using a pair of specialized PlaybackTrack and RecordTrack. - Added PatchTrack and PatchRecord classes. - Added TrackBase type to indicate more clearly the track behavior. - A TrackBase can allocate the buffer or reuse an existing one. - Factored some code in openOutput() and openInput() for internal use by PatchPanel. Bug: 14815883. Change-Id: Ib9515fcda864610458a4bc81fa8f59096ff4d7db
* Add audio_input_flags_t to IAudioFlinger::openInputGlenn Kasten2014-07-171-3/+4
| | | | | | | For backward compatibility, until flags are correctly calculated, we will assume that the request is for a low latency input stream. Change-Id: I76746834e870df00833dc77cbdaa2edd2ffeec95
* Add audio_input_flags_t to HAL open_input_streamGlenn Kasten2014-07-151-2/+3
| | | | | | | For backward compatibility, until flags are added to openInput(), we will assume that the request is for a low latency input stream. Change-Id: I5e6f7e574418917ff1b41b0a47199203c69cb40f
* stagefright: Pass audio aac sub formats in offloadinfoaarti jadhav-gaikwad2014-07-111-7/+16
| | | | | | | | Pass audio aac sub formats in offloadinfo according to aac profile. Audio HAL can take decision about offload using DSP capabilities Change-Id: If269a3654b5d2b09c183212b0646ef03e06f2d8f
* Merge "IAudioFlinger::openRecord now suggests notificationFrames"Glenn Kasten2014-07-021-1/+2
|\
| * IAudioFlinger::openRecord now suggests notificationFramesGlenn Kasten2014-07-031-1/+2
| | | | | | | | Change-Id: I08885cc381d03c522a23289e74f0e1ed46563863
* | Merge "Remove obsolete IAudioFlinger::channelCount()"Glenn Kasten2014-07-021-11/+0
|\ \ | |/ |/|
| * Remove obsolete IAudioFlinger::channelCount()Glenn Kasten2014-06-021-11/+0
| | | | | | | | Change-Id: Ie623edae2e795f9155f1f452fe4e6c7217a4a4c8
* | Add enabling variable for extended precision audioAndy Hung2014-06-251-3/+16
| | | | | | | | | | | | | | | | Set AudioFlinger::kEnableExtendedPrecision = true to enable extended precision. Enabling will be required for devices (such as USB) which report 24 bit or 32 bit sink formats. Change-Id: I0dc1d7a4f7607086d7b536ea0e43aef0e696f2ee
* | Add mPrimaryOutputSampleRateGlenn Kasten2014-06-021-1/+4
|/ | | | Change-Id: I46b527fc3f2b5a5720a74b4f0b9a8f2e0d570b09
* Merge "audioflinger: first patch panel implementation."Eric Laurent2014-05-281-0/+3
|\
| * audioflinger: first patch panel implementation.Eric Laurent2014-05-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a new PatchPanel subclass to AudioFlinger to handle audio ports and audio patches configuration and connection. The first implementation does not add new functionnality. AudioPolicyManager uses patch panel interface to control device routing. AudioFlinger: - Added PatchPanel class. The first implementation does not add new functionnality. PatchPanel handles routing commands for audio HAL after 3.0 or converts to setParameters for audio HALs before 3.0. - Added config events to ThreadBase to control synchronized audio patch connection. AudioPolicyManager: - Use PatchPanel API to control device selection isntead of setParameters. - New base class AudioPort common to audio device descriptors and input output stream profiles. This class is RefBase and groups attributes common to audio ports. - Use same device selection flow for input as for outputs: getNewInputDevice -> getDeviceForInptusiource -> setInputDevice Change-Id: Idaa5a883b19a45816651c58cac697640dc717cd9
* | audioflinger: fix deadlock upon AudioRecord creation errorEric Laurent2014-05-261-5/+18
|/ | | | | | | | | | | | | | AudioFlinger:openRecord() should not hold mClientLock when releasing the local reference on AudioRecord as the destructor will also lock mClientLock. Same fix for AudioFlinger::createTrack(). Also make sure that AudioFlinger::createEffect() holds mClientLock when clearing local reference to the Client in case of error. Regression introduced by 021cf9634ab09c0753a40b7c9ef4ba603be5c3da Bug: 15118096. Change-Id: Ie961c398c8e0460bca9b95e2ee4ce6859316c275
* audioflinger: test min HAL version instead of currentEric Laurent2014-05-221-1/+1
| | | | Change-Id: Ibce2353b4390329b4c1a453e829178e3986c25a7
* resolved conflicts for merge of f285c91e to masterElliott Hughes2014-05-221-4/+4
|\ | | | | | | Change-Id: I4c995e297d09c0854a42142cc57dce8b771acf65
| * Move frameworks/av from fdprintf to POSIX dprintf.Elliott Hughes2014-05-221-4/+4
| | | | | | | | | | Bug: 11156955 Change-Id: Ia98cd16b4c1f7be87cf060b7456de4f40896bacb
* | Use new channel count functions for audio masksAndy Hung2014-05-161-2/+4
| | | | | | | | | | Change-Id: Ia658ab4b6320d19fdb50f123c930918724ff0ef3 Signed-off-by: Andy Hung <hunga@google.com>