summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioRecord.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * AudioRecord::openRecord_l use flagsGlenn Kasten2013-08-021-2/+14
| | | | | | | | | | | | Use the flags to determine input parameters for IAudioFlinger::openRecord. Change-Id: I98d2726503af75c8830ce80ceaf3b94a755b342f
* | Merge "AudioRecord::openRecord_l now take flags"Glenn Kasten2013-08-061-2/+3
|\ \ | |/
| * AudioRecord::openRecord_l now take flagsGlenn Kasten2013-08-021-2/+3
| | | | | | | | | | | | | | The new parameter 'flags' of type audio_input_flags_t will be used for requesting a fast track, but is currently ignored. Change-Id: If68dfda8b2d4eaaca42927d721b4630c47f71f3b
* | Merge "IAudioFlinger::openRecord track_flags_t flags is in/out"Glenn Kasten2013-08-051-1/+2
|\ \ | |/
| * IAudioFlinger::openRecord track_flags_t flags is in/outGlenn Kasten2013-08-021-1/+2
| | | | | | | | | | | | This will allow AudioFlinger to tell client it is denying a request. Change-Id: Iff2be3ad6636371bbda9c9899a283c94620c1f06
* | Merge "AudioRecord::set and constructor now take flags"Glenn Kasten2013-08-051-2/+6
|\ \ | |/
| * AudioRecord::set and constructor now take flagsGlenn Kasten2013-08-021-2/+6
| | | | | | | | | | | | | | The new optional parameter 'flags' of type audio_input_flags_t will be used for requesting a fast track. Change-Id: Ia7e070cb57c833e608352da354fb30dc26df6918
* | Merge "AudioRecord callback thread waits for priority boost"Glenn Kasten2013-08-051-0/+20
|\ \ | |/
| * AudioRecord callback thread waits for priority boostGlenn Kasten2013-08-021-0/+20
| | | | | | | | Change-Id: Iae38fa4ac20a45751566169213a08a15deb0a2f6
* | Merge "AudioRecord has no default sample rate"Glenn Kasten2013-08-051-1/+2
|\ \
| * | AudioRecord has no default sample rateGlenn Kasten2013-08-021-1/+2
| |/ | | | | | | Change-Id: I72feefdd6f3a623fd3669b80d4b264518fdc0929
* | Recording of non-linear formats is not supportedGlenn Kasten2013-08-021-9/+5
|/ | | | | | Such formats are already rejected in AudioRecord::set() Change-Id: I5ba1fd9e4cd659e5226c75aa4f63e52f655e0521
* Rename control block flags to mFlagsGlenn Kasten2013-07-301-2/+2
| | | | Change-Id: I7b6d31e24531954ab1ecdf3ed56c19433700bd89
* AudioRecord and HAL input stream must be 16-bit PCM onlyGlenn Kasten2013-07-241-0/+5
| | | | | | | | | | | | | Currently there are 16-bit PCM assumptions in several places for capture: - resampler API - mRsmpInBuffer and mRsmpOutBuffer - RecordThread::threadLoop upmix, downmix, and resampling - possibly other places Until those assumptions are removed, this CL enforces 16-bit PCM in both client and server at all places where a format is checked. Change-Id: I08b0570bff626ad0d341804825a72c14e61b4233
* Include what is neededGlenn Kasten2013-07-021-0/+1
| | | | | | | Remove old includes. Header files only include other header files that they directly need themselves. Change-Id: Ic471386808d9f42ea19ccbd59cb50a5f83a89dd0
* New control block for AudioTrack and AudioRecordGlenn Kasten2013-06-121-358/+474
| | | | | | | | Main differences between old and new control block: - removes the mutex, which was a potential source of priority inversion - circular indices into shared buffer, which is now always a power-of-2 size Change-Id: I4e9b7fa99858b488ac98a441fa70e31dbba1b865
* Consistent whitespaceGlenn Kasten2013-05-301-1/+1
| | | | Change-Id: I118cce68d3b777f9ec9b6bfb70367496422a40f2
* Miscellaneous cleanupGlenn Kasten2013-03-041-3/+3
| | | | | | | | | | Abbreviation framesReady to fRdy for new systrace. Put inline const on one line. Use local copy of mState in state. Improve logging. Line length 100. Change-Id: I8201c3ce0e53fd464fd33d02544e52c342d40b68
* Fix AudioRecordGlenn Kasten2013-01-101-2/+2
| | | | | Bug: 7965744 Change-Id: Ic024e7fb32f7459b8093c2cf6cd5752aade21ddb
* Fix bug in AudioRecord() constructorGlenn Kasten2013-01-041-1/+1
| | | | | | | It was calling set() with wrong parameter list. This goes back to commit be916aa1267e2e6b1c148f51d11bcbbc79cb864c from 2010. Change-Id: I2f6917765baf58260bf35e89a2cc59c199734ff6
* Merge "Start isolating control block accesses in a proxy"Glenn Kasten2012-12-211-16/+31
|\
| * Start isolating control block accesses in a proxyGlenn Kasten2012-12-121-16/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Remove unnecessary parameter"Glenn Kasten2012-12-211-1/+1
|\ \
| * | Remove unnecessary parameterGlenn Kasten2012-12-181-1/+1
| |/ | | | | | | | | | | Just get the parameter on server side Change-Id: I433a63104dbb257e0d862be2ab61847cb36d1c15
* | Fix bug with discarded AudioRecord::read countGlenn Kasten2012-12-171-1/+2
|/ | | | | | | | | | | Formerly, if an AudioRecord::read() got a timeout on obtainBuffer() after already successfully transferring some data, then it returned zero. This had the effect of discarding a partial transfer, which resulted in a gap in the audio data delivered to the app. Now if a timeout occurs after a partial transfer, it returns that partial transfer count so that no data is lost. Change-Id: I0d9c2f4e495a400b56ef916a06613ba26537ca97
* Clean up channel count and channel maskGlenn Kasten2012-11-191-12/+8
| | | | | | | | Channel count is uint32_t. Remove redundant mask parameter to AudioTrack::createTrack_l() and AudioRecord::openRecord_l(). Change-Id: I5dc2b18eb609b2c0dc3091994cbaa4628062c17f
* Merge ""if" statements use curly braces per media style"Glenn Kasten2012-11-161-2/+4
|\
| * "if" statements use curly braces per media styleGlenn Kasten2012-11-161-2/+4
| | | | | | | | Change-Id: I130e7849fd1da7a0b7fe56c3c53919d26e3843b8
* | Don't use control block frame count after createGlenn Kasten2012-11-161-4/+4
|/ | | | | | This is part of a series to clean up the control block. Change-Id: I7f4cb05aef63053f8e2ab05b286d302260ef4758
* Use size_t for frame countsGlenn Kasten2012-11-151-6/+12
| | | | | | Also fix typo: bufferCount should be frameCount. Change-Id: Ibed539504db75ef99dc21c8ff1bf2987122063a5
* Use uint32_t for sample rateGlenn Kasten2012-11-141-2/+2
| | | | Change-Id: Ie240b48fb54b08359f69ecd4e5f8bda3d15cbe80
* Simplify AudioRecord::restoreTrack_l()Glenn Kasten2012-11-131-49/+44
| | | | | | | | | | | | | | Finish removing CBLK_RESTORING and CBLK_RESTORED from control block flags, and remove constant RESTORE_TIMEOUT_MS. Also minor cleanup: - Cache mCblk in local variable cblk and make cblk allocatable in a register. - Use "iMem" for sp<IMemory>. - Add missing error log to AudioRecord; it was already in AudioTrack. This is part of a series to clean up the control block. Change-Id: Ia5f5ab4763c392bc06a45851b167ddaee29e3455
* Move frame size out of the control blockGlenn Kasten2012-11-121-11/+9
| | | | | | 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-2/+2
| | | | | | 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-5/+4
| | | | | | This is part of a series to clean up the control block. Change-Id: I0265fece3247356b585d4d48fbda6f37aea8a851
* Removed unused fields in AudioRecord::BufferGlenn Kasten2012-11-061-3/+0
| | | | Change-Id: I89fc6d8f695b48516d956b0a9a4a43d408f369f9
* Simplify control block flag namesGlenn Kasten2012-11-051-11/+11
| | | | | | Use only one symbol per flag Change-Id: Ia3582e2134abd60c896d11337face65383e79c7c
* Line length 100Glenn Kasten2012-11-011-2/+4
| | | | Change-Id: Ib28fd7b9ce951a6933f006e7f8812ba617625530
* AudioRecord: Fix minimum frame count calculation.Eric Laurent2012-09-061-1/+1
| | | | | | | AudioRecord::set() was calling getMinFrameCount() with a channel count instead of a channel mask. Change-Id: Iabace7686426430fd53deac0c71b0c36aa64171c
* AudioRecord lockingGlenn Kasten2012-07-171-14/+31
| | | | | | | | | | | | | | | | Fix race conditions for EVENT_MARKER and EVENT_NEW_POS callbacks. Marker and new position update fields are protected by lock. getSampleRate() doesn't need a lock because it reads from shared memory control block. Enforce that the parameter passed with EVENT_MARKER and EVENT_NEW_POS cannot not be changed by the callback handler, and will not change during the call by another thread. Session ID should never change; log if it does. Change-Id: Ia2c63cf1a71b10bb06c37981bd76437f83fffa91
* AudioRecord::stop() return voidGlenn Kasten2012-07-131-3/+1
| | | | | | like AudioTrack::stop() Change-Id: Iab62f4665151345f1ad5874c97a21d1a331f0154
* AudioRecord client threading cleanupGlenn Kasten2012-07-131-55/+62
| | | | | | | | | | | | | | | | | | | Rename ClientRecordThread to AudioRecordThread to be more similar to AudioTrack naming. Only create the thread once, and use resume() and pause() for start() and stop(). This will allow us to have a known client callback thread tid that we can pass to AudioFlinger before start(). mActive: Made mActive a bool not int. mActive is protected by mLock; volatile is meaningless. Fixed a few places where mActive was accessed without a lock: - stopped() - processAudioBuffer() These aren't used internally, so no need for _l() versions. Change-Id: I4b8a5c90f3a22d3894b344564cb1c5aef4f1fda2
* getMinFrameCount error handlingGlenn Kasten2012-07-131-0/+5
| | | | | | | | Convention is for "get" APIs that directly return status_t and indirectly return a value via a pointer, to return BAD_VALUE if the pointer is NULL. Also indirectly return 0 for other errors. Change-Id: I1599f20ecb26e9723f9fb384ffbf911ff3a2ce1c
* Add tid parameter to IAudioFlinger::openRecordGlenn Kasten2012-07-121-0/+4
| | | | | | Not yet implemented Change-Id: I35523fb15ad71727ecc9f4bb870f07e4b7397dc4
* Simplify AudioRecord::getInputFramesLost()Glenn Kasten2012-07-121-4/+2
| | | | | | This also fixes a benign race in reading mActive without a lock. Change-Id: I19e953d4f275e5c266ca1ca3fece7b6c02ad1707
* Use audio_channel_mask_t more consistentlyGlenn Kasten2012-07-031-4/+5
| | | | | | | | | | | | | | | 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/+0
| | | | Change-Id: I29fb3ee5664c1f0ee0409c1bb2be087ecca637db
* Use audio_channel_mask_t in AudioRecordGlenn Kasten2012-06-251-4/+4
| | | | Change-Id: I9e1b918b2635d961604a4a9d88eb1c7179a167a7
* Include what you useGlenn Kasten2012-06-251-17/+7
| | | | Change-Id: I12ef9367d05dbe069c037b1b4acd6347a8cf3ece
* Remove AudioRecord record_flagsGlenn Kasten2012-06-221-6/+3
| | | | Change-Id: I021ddcc1bcb63132a4597d13e3d09db2a5f2c628