summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.h
Commit message (Collapse)AuthorAgeFilesLines
...
| * Start isolating control block accesses in a proxyGlenn Kasten2012-12-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The proxy object will eventually be the only code that understands the details of the control block. This should make it easier to change the control block in the future. Initial set of control block fields that are isolated: - sample rate - send level - volume Prepare for streaming/static separation by adding a union to the control block for the new fields. Fix bug in handling of max sample rate on a track. It was only checking at re-configuration, not at each mix. Simplify OutputTrack::obtainBuffer. Change-Id: I2249f9d04f73a911a922ad1d7f6197292c74cd92
* | Remove unnecessary parameterGlenn Kasten2012-12-181-3/+1
|/ | | | | | Just get the parameter on server side Change-Id: I433a63104dbb257e0d862be2ab61847cb36d1c15
* AudioTrack::mute() is unused so remove itGlenn Kasten2012-12-031-1/+0
| | | | | | | If ever needed again, it could be implemented on client side by forcing a track volume of 0. Change-Id: I88a9b4f675b6dca2948549414f9ec2c192d29269
* AudioFlinger files reorganizationEric Laurent2012-11-191-1555/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Audioflinger.cpp and Audioflinger.h files must be split to improve readability and maintainability. This CL splits the files as follows: AudioFlinger.cpp split into: - AudioFlinger.cpp: implementation of IAudioflinger interface and global methods - AFThreads.cpp: implementation of ThreadBase, PlaybackThread, MixerThread, DuplicatingThread, DirectOutputThread and RecordThread. - AFTracks.cpp: implementation of TrackBase, Track, TimedTrack, OutputTrack, RecordTrack, TrackHandle and RecordHandle. - AFEffects.cpp: implementation of EffectModule, EffectChain and EffectHandle. AudioFlinger.h is modified by inline inclusion of header files containing the declaration of complex inner classes: - AFThreads.h: ThreadBase, PlaybackThread, MixerThread, DuplicatingThread, DirectOutputThread and RecordThread - AFEffects.h: EffectModule, EffectChain and EffectHandle AFThreads.h includes the follownig headers inline: - AFTrackBase.h: TrackBase - AFPlaybackTracks: Track, TimedTrack, OutputTrack - AFRecordTracks: RecordTrack Change-Id: I512ebc3a51813ab7a4afccc9a538b18125165c4c
* Clean up channel count and channel maskGlenn Kasten2012-11-191-3/+3
| | | | | | | | Channel count is uint32_t. Remove redundant mask parameter to AudioTrack::createTrack_l() and AudioRecord::openRecord_l(). Change-Id: I5dc2b18eb609b2c0dc3091994cbaa4628062c17f
* Merge "Fix time vs. bytes units bug in getRenderPosition"Glenn Kasten2012-11-161-5/+7
|\
| * Fix time vs. bytes units bug in getRenderPositionGlenn Kasten2012-11-161-5/+7
| | | | | | | | | | | | | | Rename correctLatency since it requires thread to be locked. Use size_t for byte and frame counts. Change-Id: I178fdd18bdb823813b9563927bdff8c0d28ca5a5
* | Don't use control block frame count after createGlenn Kasten2012-11-161-0/+2
|/ | | | | | This is part of a series to clean up the control block. Change-Id: I7f4cb05aef63053f8e2ab05b286d302260ef4758
* Use size_t for frame countsGlenn Kasten2012-11-151-11/+11
| | | | | | Also fix typo: bufferCount should be frameCount. Change-Id: Ibed539504db75ef99dc21c8ff1bf2987122063a5
* Clean up frame size in AudioTrack and AudioFlingerGlenn Kasten2012-11-141-4/+3
| | | | | | | | | | | | | TrackBase::mFrameSize, mChannelMask, and mChannelCount are now const. Use TrackBase::mFrameSize instead of re-calculating frame size. AudioFlinger only sees 16-bit PCM format, conversion from 8-bit is now entirely on the client side. Previously a small part of the responsibility was on server side also. size_t is unsigned, so use %u in logs. Fix theoretical bug where TrackBase constructor was over-allocating space for non-linear AudioTrack or 8-bit PCM AudioRecord (probably benign). Change-Id: I7cbbba0bf4dba29ea751d8af341ab8e5cbbdc206
* Use uint32_t for sample rateGlenn Kasten2012-11-141-2/+2
| | | | Change-Id: Ie240b48fb54b08359f69ecd4e5f8bda3d15cbe80
* Update audio commentsGlenn Kasten2012-11-141-1/+5
| | | | Change-Id: I85d7d2f6381b251db5695202fec75128883a8662
* Rename TrackBase::mFrameCount to mStepCountGlenn Kasten2012-11-131-2/+3
| | | | | | | This prepares for adding a new field TrackBase::mFrameCount with a different meaning. Change-Id: I6bbe2c59f2a882be57caeec2e2e06f439a0e9e83
* Move frame size out of the control blockGlenn Kasten2012-11-121-0/+4
| | | | | | This is part of a series to clean up the control block. Change-Id: Ifab1c42ac0f8be704e571b292713cd2250d12a3f
* Move buffers pointer out of the control blockGlenn Kasten2012-11-081-0/+1
| | | | | | This is part of a series to clean up the control block. Change-Id: Ie474557db7cb360f2d9a0f11600a68f5a3d46f07
* Remove CBLK_DIRECTION from control block flagsGlenn Kasten2012-11-071-0/+6
| | | | | | This is part of a series to clean up the control block. Change-Id: I0265fece3247356b585d4d48fbda6f37aea8a851
* Remove CBLK_FAST from control block flagsGlenn Kasten2012-11-061-2/+2
| | | | | | This is part of a series to clean up the control block. Change-Id: Ic881a3560d9547cb63fcc0cefec87aa3da480e0d
* Line length 100Glenn Kasten2012-11-011-17/+28
| | | | Change-Id: Ib28fd7b9ce951a6933f006e7f8812ba617625530
* Save copy of mic input, disabled by defaultGlenn Kasten2012-11-011-1/+12
| | | | Change-Id: I4f5e95a5ddf016530d1b2747a0a5ca0962caabda
* Merge "Clean up constructor and derivation whitespace"Glenn Kasten2012-10-301-15/+16
|\
| * Clean up constructor and derivation whitespaceGlenn Kasten2012-10-261-15/+16
| | | | | | | | Change-Id: I47d688a9c10c4c3c868accc34102fb402ebcac62
* | Mark volume fields privateGlenn Kasten2012-10-261-1/+1
|/ | | | Change-Id: I8ffca0460195263d159aa13015c246122d8556a2
* bug 7253033 clean up before closing an outputJean-Michel Trivi2012-09-301-0/+5
| | | | | | | | | | An output can only be closed if there is no lock contention that prevents ThreadBase::exit() from being blocked. If an output device is waiting for an operation to complete (here a write in the remote_submix module, because the pipe is full), signal the module that it's entering the "exiting" state. Change-Id: I8248add60da543e90c25a4c809866cdb26255651
* Implement android.media.AudioManager.getProperty()Glenn Kasten2012-09-251-1/+6
| | | | | Bug: 6635041 Change-Id: I3386a4a6c226bc4eceaf65556119e4fb15f73224
* audioflinger: send priority request from a threadEric Laurent2012-09-131-6/+56
| | | | | | | | | | | | | | | | | | | When creating a fast AudioTrack, a request is sent to SchedulingPolicyService to elevate the requesting thread priority. This generates a binder call into system_server process and to a JAVA service via JNI. If the thread from which the track was created is in the system_server process and does not have the "can call java" attribute, a crash occurs because the binder optimization reuses the same thread to process the returning binder call and no JNI env is present. The fix consists in sending the priority change request from the AudioFlinger mixer thread, not from the binder thread. This also reverts the workaround in commit 73431968 Bug 7126707. Change-Id: I3347adf71ffbb56ed8436506d4357eab693078a3
* Communicate audio session ID to downmixerJean-Michel Trivi2012-09-101-3/+3
| | | | | | | | The audio downmixer effect might need the audio session Id, pass it from the track creation in AudioFlinger to the downmix effect creation in AudioMixer. Change-Id: I5e29540542ae89cf4a0cdb537b3e67f04442a20a
* audioflinger: changes for new audio devices enumsEric Laurent2012-09-071-6/+9
| | | | | | | | | | | | | | The ThreadBase class now has a separate member for input and output devices (mInDevice, mOutDevice). Only query get_supported_devices() from audio HAL if the function is exposed and if the audio policy manager did not specify the audio module to open. Also fixed bug in AEC preprocessing that would reset to default output device when an input device was given. Change-Id: I19d4d06aeb920b068e3ef31e6e6be6345ce5d67a
* AudioFlinger: send audio source to audio effectsEric Laurent2012-08-311-0/+3
| | | | | | | | Added support for EFFECT_CMD_SET_AUDIO_SOURCE audio effect command to inform preprocessings of current audio source selection for capture. Change-Id: Ib2418a9aa8114e8457fe828ecd43b230ed86cdd6
* Update audio commentsGlenn Kasten2012-08-301-4/+7
| | | | Change-Id: Ie7504d0ddb252f7e4d4f99ed0b44cfc7b1049816
* Move libnbaio out of AudioFlingerGlenn Kasten2012-08-301-3/+3
| | | | | | | | | | libnbaio is now a separate shared library from AudioFlinger, rather than a static library used only by AudioFlinger. AudioBufferProvider interface is now also independent of AudioFlinger, moved to include/media/ Change-Id: I9bb62ffbc38d42a38b0af76e66da5e9ab1e0e21b
* const methodsGlenn Kasten2012-08-131-11/+11
| | | | Change-Id: I92e32ee16274c032c9d0ce910676be2a7fa52471
* AudioFlinger: Better handling for master volume/muteJohn Grossman2012-08-081-73/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit 93d906837e0e89aa1d9c913ab2b531b809f9bb9e) > AudioFlinger: Better handling for master volume/mute > > Changes to address bug 6842827. > > When a HAL is loaded, cache whether or not the HAL supports > set_master_volume/mute in the AudioHwDevice structure. Store an > AudioHwDevice in AudioStream(In|Out) structures instead of just an > audio_he_device_t. This give threads (PlaybackThreads in > particular) access to the cached capabilities. > > When setting master volume/mute, change the system to always set the > setting on all HAL which support it and also to set the setting on all > PlaybackThreads. Change PlaybackThreads to apply the setting at the > in SW mix stage of the pipeline if its assigned HAL does not support > the setting, or to ignore the setting of the assigned HAL does support > it. > > Change-Id: Ia14137a30b4c3ee6f2d7ddcc8cba87bf5eec87f4 > Signed-off-by: John Grossman <johngro@google.com> Change-Id: Icb6bc13764e100a2003eb1dee2231132ab287d98 Signed-off-by: John Grossman <johngro@google.com>
* Change audio flinger to user HAL master mute if availableJohn Grossman2012-08-081-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit 91de9b56282d126ffb36344266af5fee3cefcfdd) > Change audio flinger to user HAL master mute if available > > Hand merge from ics-aah > > > Change audio flinger to user HAL master mute if available: DO NOT MERGE > > > > Replicate the pattern used for HAL master volume support to make use > > of master mute support if the HAL supports it. This is part of the > > change needed to address bug 6828363. Because of the divergences > > between ICS and master, this change will need to be merged by hand. > > > > Signed-off-by: John Grossman <johngro@google.com> > > Change-Id: I6d83be524021d273d093bcb117b8f2fe57c23685 > > Change-Id: I32280582905c969aaec2bb166ec5c61df82d737a > Signed-off-by: John Grossman <johngro@google.com> Change-Id: I5cd709187221d307fe25c5117ccaadca5f6b197b Signed-off-by: John Grossman <johngro@google.com>
* Start adding support for multiple record tracksGlenn Kasten2012-08-011-2/+18
| | | | | | | | Replace single mTrack by vector mTracks. Destroy record tracks similarly to playback tracks. Dump all record tracks, in addition to the active record track. Change-Id: I503f10b51928b6b92698fe1c51a9ddd3215df1f4
* Clean up start() parametersGlenn Kasten2012-07-271-5/+4
| | | | | | | | Document where int is used instead of AudioSystem::sync_event_t (probably because of a header file dependency). TrackBase::start() and RecordTrack::start() don't need default parameters. Change-Id: I82f4a4d078be900f3aa4bd926697e32f5ed68ec8
* Extract methods to enter standby and standby modeGlenn Kasten2012-07-271-0/+6
| | | | | | Also move initial standby from to threadLoop to avoid a race condition. Change-Id: I65afca83c36fb41b983b3b1d3dab35d4029560e3
* Use valueAt instead of editValueAt when possibleGlenn Kasten2012-07-251-1/+1
| | | | Change-Id: I885b169f4b176a6b5c2ca9a534214b4ffff1700e
* effect_descriptor_t const correctnessGlenn Kasten2012-07-251-2/+2
| | | | Change-Id: Iad008f20d35a18acf500f773900164552fd0c19e
* Fix races in AudioRecord stop()Glenn Kasten2012-07-251-1/+5
| | | | Change-Id: Id0ac1915f57fef4a938c7f90989c1162a8b6c51c
* Internal dump methods return void not status_tGlenn Kasten2012-07-201-13/+13
| | | | | | Only the IAudioFlinger::dump() needs to return a status_t. Change-Id: Iffeb2a7db4846df850b6b2ed960276f1fd75dba0
* Use audio_devices_t more placesGlenn Kasten2012-07-191-9/+9
| | | | Change-Id: Id0ace02ca6f480a6c46e11880acf6cdc66d83184
* Don't call virtual methods in destructorGlenn Kasten2012-07-161-2/+8
| | | | | | The result of calling virtual methods from a destructor is undefined. Change-Id: I0fd4a19626e5ae564a60b753315b5f6c4b8d1f2c
* Use atomic ops for thread suspend countGlenn Kasten2012-07-131-4/+21
| | | | | | | There was a theoretical but unlikely race if two binder threads executed suspend() or restore() concurrently. Also added comments. Change-Id: I0908acc810b83bdd66455b27ca3429de1662a2cd
* Add tid parameter to IAudioFlinger::openRecordGlenn Kasten2012-07-121-0/+3
| | | | | | Not yet implemented Change-Id: I35523fb15ad71727ecc9f4bb870f07e4b7397dc4
* Remove dead codeGlenn Kasten2012-07-111-3/+0
| | | | Change-Id: If22a6c4e572b0734eba0c5a7ce29a2c61c581e5d
* Record overflow cleanupGlenn Kasten2012-07-101-3/+4
| | | | | | Add comments and rename one method for clarity Change-Id: I04a9147e46e88a072256c0211b112d52202419e2
* Use audio_channel_mask_t more placesGlenn Kasten2012-07-101-12/+13
| | | | | | | | | | 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
* Add comments on use of volatile for track countGlenn Kasten2012-07-101-4/+7
| | | | | | and add acquire load at the read Change-Id: Ib41a58f5b1f6af87a8bd63d3f77d2ec0e48cb479
* Remove 'volatile' from mMute and add commentsGlenn Kasten2012-07-101-2/+6
| | | | Change-Id: I386ba27b2305a397aba70331c6bf0d35ea727cf6
* Whitespace and indentationGlenn Kasten2012-07-101-3/+2
| | | | Change-Id: I424052b4ff9218147a5cfc8e6dcd67fe8105d229