summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
Commit message (Collapse)AuthorAgeFilesLines
* Increase allowed number of VHQ resamplers to 3Glenn Kasten2012-10-221-1/+1
| | | | | Bug: 7378660 Change-Id: I69e33ca2eb4bb9bd38e2c63df62cd1130d68baf6
* Fix a typo that caused the high quality resampler to produce garbageMathias Agopian2012-10-211-1/+1
| | | | | | | | | the problem is that if libaudio_resampler is present, it is those coefficients that will always be selected, but the correct meta-data. Bug: 7385994 Change-Id: Ieebeb37b4dfb62a1a051bc29fae2ce056dbc6621
* Remove active track when thread goes to standbyGlenn Kasten2012-10-181-3/+3
| | | | | Bug: 7369232 Change-Id: I7ff9f525dad4be0aef562a53015b06ee7d3d50f1
* Fix track estimation for presentation completeJean-Michel Trivi2012-10-161-4/+2
| | | | | | | | | | | | | | Audio tracks were not using the right latency estimation for signalling the completion of their presetation. This caused the synchronization mechanism between playback and record to be off, and a synchronized recording would contain some of the audio that was meant to be over once recording would start. Use the playback thread's latency reporting which takes the audio pipe into account. Bug 7237669 Change-Id: I23a907a53ad0b0d68d246789ec595a77a79fced5
* Support querying active record sourcesJean-Michel Trivi2012-10-102-0/+13
| | | | | | | | | Add support for querying whether there is currently a recording underway from the specified audio source. Bug 7314859 Change-Id: I986b231a10ffd368b08ec2f9c7f348d28eaeb892
* audio policy: deprecate ro.camera.sound.forcedEric Laurent2012-10-081-4/+0
| | | | | | | | | | | The volume and routing policy of AUDIO_STREAM_ENFORCED_AUDIBLE is now controlled by AudioService. Do not read ro.camera.sound.forced is not needed anymore. Bug 7032634. Change-Id: Ic0a6396fc4b6efb91cdb4dffe0c8eb035d0440bd
* audioflinger/resampler: add build source for libaudio-resamplerty.lee2012-10-071-0/+2
| | | | | | | Bug: 7229644 Change-Id: I93bde36be1c3ec84174a4c98423e28f8b3d8782f Signed-off-by: ty.lee <ty.lee@lge.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* Integrate improved coefficient sinc resampler: VHQGlenn Kasten2012-10-047-124/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Very high quality is enabled only for 44.1 -> 48 or 48 -> 44.1, and uses low quality for all other use cases. Track estimated CPU load and throttles the quality based on load; as currently configured it should allow up to 2 instances of very high quality. Medium quality and high quality are currently disabled unless explicitly requested. Details: Only load .so the first time it is needed. Cleanup code style: formatting, indentation, whitespace. Restore medium quality resampler, but it is not used (see next line). Fix memory leak for sinc resampler. Check sample rate in resampler constructor. Add logs for debugging. Rename DEFAULT to DEFAULT_QUALITY for consistency with other quality levels. Renumber VERY_HIGH_QUALITY from 255 to 4. Use enum src_quality consistently. Improve parsing of property af.resampler.quality. Fix reentrancy bug - allow an instance of high quality and an instance of very high quality to both be active concurrently. Bug: 7229644 Change-Id: I0ce6b913b05038889f50462a38830b61a602a9f7
* Disable audio watchdogGlenn Kasten2012-09-302-2/+12
| | | | | | | It's not critical, and is wasting power Bug: 7241714 Change-Id: I6ad4375f0000c92529688723dbe0ff0caa809c5d
* bug 7253033 clean up before closing an outputJean-Michel Trivi2012-09-302-0/+16
| | | | | | | | | | 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
* audioflinger: use resample coefficients from audio-resampler library.SathishKumar Mani2012-09-265-22/+114
| | | | | | | | | | | -Add a separate quality VERY_HIGH_QUALITY in resampler -Use resample coefficients audio-resampler library for quality VERY_HIGH_QUALITY. -This improves the quality of resampled output. Bug: 7024293 Change-Id: Ia44142413bed5f5963d7eab7846eec877a2415e4 Signed-off-by: Iliyan Malchev <malchev@google.com>
* audioflinger/resampler: Add VERY_HIGH_QUALITY audio-resamplerSathishKumar Mani2012-09-264-0/+4725
| | | | | | Change-Id: I34f5d36ae60010ec64222d6660d10a84da3bf566 Bug: 7024293 Signed-off-by: Iliyan Malchev <malchev@google.com>
* Revert "Don't wait for presentation complete if terminated"Glenn Kasten2012-09-261-6/+6
| | | | | | This reverts commit 44cda3a4e7ca3de0db9cb49145def3803b03ebb4 Change-Id: I7fd29b77690dab057ac966a42fb198b2772f092c
* Implement android.media.AudioManager.getProperty()Glenn Kasten2012-09-252-1/+24
| | | | | Bug: 6635041 Change-Id: I3386a4a6c226bc4eceaf65556119e4fb15f73224
* audioflinger: improve record start and thread exitEric Laurent2012-09-251-2/+2
| | | | | | | | | | | | Use broadcast() instead of signal() on the thread wake up condition when starting record or requesting thread exit to make sure that if another thread is waiting for the same condition (e.g binder thread calling setParameters()) the mixer thread will be woken up. Bug 7184317. Change-Id: I3154a4509ca7af6ffae5236e522b0fab8e75ed06
* Merge "Check clock_gettime(CLOCK_MONOTONIC) for failure" into jb-mr1-devGlenn Kasten2012-09-241-0/+3
|\
| * Check clock_gettime(CLOCK_MONOTONIC) for failureGlenn Kasten2012-09-241-0/+3
| | | | | | | | | | Bug: 7100774 Change-Id: I15a84a19bb6d6ef1d9dac4beaa03587638196404
* | fix end of track presentation on suspended outputEric Laurent2012-09-231-2/+13
|/ | | | | | | | | | | | | | | | | | | The code detecting the end of an audio track presentation before removing it from the active track list is based on the count of audio frames sent to audio HAL. When an output stream is suspended (e.g. A2DP when SCO is active), this count does not change and a track in stopped state will never be removed from active track list causing the mixer thread to never release the wake lock. The fix consists in incrementing the audio HAL frame count even if the output is suspended. Also fix a problem in getRenderPosition() when the output is suspended. Bug 7167534. Change-Id: I3be836cbbea29b65dc087199cac6a1cd84c0a41d
* audioflinger: send priority request from a threadEric Laurent2012-09-132-36/+105
| | | | | | | | | | | | | | | | | | | 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
* Handle audio HAL returning 0 bytes in record threadJean-Michel Trivi2012-09-131-4/+4
| | | | | | | Enter standby when HAL returns an error, but also consider 0 bytes returned as NOT_ENOUGH_DATA. Change-Id: Ica83142310e9c176f936e0440571a6034cbc575f
* Don't deadlock on AudioRecord start when reads return 0Jean-Michel Trivi2012-09-121-8/+14
| | | | | | | | | | | When calling start() on an AudioRecord with a HAL that returns 0 on a read() operation, the start blocking condition was never unblocked. Add a boolean to track the first read operation so the returned number of bytes (mBytesRead) is only evaluated after that first read. Change-Id: I8c735a00d48cd6a0da467ccdf75d3616b38f6afa
* Communicate audio session ID to downmixerJean-Michel Trivi2012-09-105-14/+17
| | | | | | | | 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
* Merge "Add outlier statistics for fast mixer cycle times" into jb-mr1-devGlenn Kasten2012-09-091-1/+40
|\
| * Add outlier statistics for fast mixer cycle timesGlenn Kasten2012-09-071-1/+40
| | | | | | | | Change-Id: I31c964caeb8b5d9ae0a426224f030cdcb01114a0
* | audioflinger: changes for new audio devices enumsEric Laurent2012-09-072-69/+53
|/ | | | | | | | | | | | | | 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-312-1/+40
| | | | | | | | 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-302-10/+14
| | | | Change-Id: Ie7504d0ddb252f7e4d4f99ed0b44cfc7b1049816
* Remove dead codeGlenn Kasten2012-08-301-0/+4
| | | | | | | RecordThread::isValidSyncEvent() returns false, so most of RecordThread::setSyncEvent() is never executed. Change-Id: I0cf848beb46a367a45126d2df3073c5afa2ca59c
* Move libnbaio out of AudioFlingerGlenn Kasten2012-08-3032-2459/+14
| | | | | | | | | | 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
* Make tee sink compile OK againGlenn Kasten2012-08-222-2/+2
| | | | Change-Id: Ie865ceeabaeb698a62c11eac9f96e303c44c28ae
* const methodsGlenn Kasten2012-08-132-17/+17
| | | | Change-Id: I92e32ee16274c032c9d0ce910676be2a7fa52471
* Simplify AudioFlinger::PlaybackThread::isValidSyncEvent()Glenn Kasten2012-08-131-7/+1
| | | | Change-Id: I3e4af69b929d4ca04afaac26c7e41c89fce25b9c
* Discard setSyncEvent() return valueGlenn Kasten2012-08-131-4/+4
| | | | | | | setSyncEvent() returns a status_t which is sometimes ignored. Emphasize this is intentional by casting to void. Change-Id: Ic614988347cba36bd2504d7ad321594a355b0d9d
* Merge "Replace hard-coded "2" by a constant and comment" into jb-mr1-devGlenn Kasten2012-08-131-2/+11
|\
| * Replace hard-coded "2" by a constant and commentGlenn Kasten2012-08-091-2/+11
| | | | | | | | | | Bug: 6679403 Change-Id: I6c2701f9afedc26540dfad0b4e23348bbc4cb01a
* | am ff4c64d6: am c64a1787: Merge "Fix initialization of audio mixer track ↵Jean-Baptiste Queru2012-08-101-1/+5
|\ \ | |/ |/| | | | | | | | | resources for MIPS." * commit 'ff4c64d6b1b58494a1b15f1a664e5c421d095d15': Fix initialization of audio mixer track resources for MIPS.
| * Fix initialization of audio mixer track resources for MIPS.Paul Lind2012-08-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The value 1 << 32 (maxNumTracks defaults to 32) is surprisingly not defined in C, and differs on MIPS than the other arch. Therefore the track resources were not initialized properly, resulting in failure to play any audio. The fix allows the mConfiguredNames bitmask to be correctly set to all 1's in the 32-track case, for all arch. Change-Id: Ied3e1305952e9567602e2cd76c5ef3acb0809ee0 Signed-off-by: Paul Lind <plind@mips.com>
* | Tune the overrun correctionGlenn Kasten2012-08-081-2/+2
| | | | | | | | | | | | | | | | | | | | The new overrun correction is: if the previous write() cycle time is < 50% of expected, then sleep enough extra to make the total cycle time = 95% of expected. This should help compensate for HAL implementations that have uneven cycle times due to sample rate conversion. Bug: 6881638 Change-Id: I5ab58afdfceee7ac523177f021fbf62d743d571a
* | AudioFlinger: fix timed audioJohn Grossman2012-08-0813-24/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit e20ac92c564a2f4e8123885807abdf0a78de0dd7) > AudioFlinger: fix timed audio > > Addresses Bug 6900517. > > Finish up support for timed audio in the new FastMixer world. Pay special > attention to remaining lock-less and voluntary yield free on the FastMixer > thread. This fixes audio playback for Q on JB. > > Change-Id: Iaf815e58a1b1d0a0190051794bec8dc5c9231785 > Signed-off-by: John Grossman <johngro@google.com> Change-Id: I9bd687acc345a05867af48e71116690fdb0ce1b5 Signed-off-by: John Grossman <johngro@google.com>
* | AudioFlinger: Better handling for master volume/muteJohn Grossman2012-08-082-244/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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-082-10/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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>
* | Don't wait for presentation complete if terminatedGlenn Kasten2012-08-011-6/+6
| | | | | | | | Change-Id: Ia04cf6c620693457dca87b4ffea5dd0fe71efdce
* | Start adding support for multiple record tracksGlenn Kasten2012-08-012-39/+141
| | | | | | | | | | | | | | | | 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-272-6/+5
| | | | | | | | | | | | | | | | 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-272-16/+25
| | | | | | | | | | | | Also move initial standby from to threadLoop to avoid a race condition. Change-Id: I65afca83c36fb41b983b3b1d3dab35d4029560e3
* | Use valueAt instead of editValueAt when possibleGlenn Kasten2012-07-252-5/+5
| | | | | | | | Change-Id: I885b169f4b176a6b5c2ca9a534214b4ffff1700e
* | effect_descriptor_t const correctnessGlenn Kasten2012-07-253-6/+6
| | | | | | | | Change-Id: Iad008f20d35a18acf500f773900164552fd0c19e
* | Fix races in AudioRecord stop()Glenn Kasten2012-07-252-25/+32
| | | | | | | | Change-Id: Id0ac1915f57fef4a938c7f90989c1162a8b6c51c
* | Use upmix/downmix utility routinesGlenn Kasten2012-07-231-16/+6
| | | | | | | | Change-Id: I9ae2ec938fb695ec576ea008a42205325af7bbf1
* | fix audio effect not destroyed when needed.Eric Laurent2012-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | commit a5f44eba contained an error which made that audio effect modules where not destroyed but left in the destroyed state rendering them unuseable after being released. Bug 6805168. Change-Id: Ia4e683b3c970ffd01846c482fde73d799ff219de