| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Add tones to the ToneGenerator that are
to be used for Local Hold Recall.
Change-Id: I92cc1d63a3f6d38fc224774909b5b27d58be969c
|
|
|
|
|
|
|
| |
while (count--) causes an unsigned overflow when count = 0, refactor the
condition to avoid this.
Change-Id: I91a8c93e6be715d80070a4c94c1de712cb659265
|
|
|
|
|
|
|
|
|
| |
DTMF tones are played at the hardware module sampling rate.
Until now, this rate was limited to 48k. Tones sound not too
pleasant at higher rates (like 96k and 192k). Ergo, limit the rate
to 48k.
Change-Id: I7fbc3185d988628ce3ee478076a322857221dece
|
|
|
|
| |
Change-Id: Ic00d2c5d0bbb1605e96666e25c9ccc22bea6d3ff
|
|
|
|
|
|
|
| |
Clang compiler gives warning to old gnu syntax.
BUG: 18193625
Change-Id: I1b5237d60866fc357fc808f6a6955ab20418a7d8
|
|
|
|
|
|
|
|
| |
AUDIO_INTERLEAVE_*
AUDIO_STREAM_MIN
AUDIO_SESSION_ALLOCATE
Change-Id: I31dd6f327204685e50716079ce21c4ba206dff11
|
|
|
|
|
|
|
| |
Remove old includes.
Header files only include other header files that they directly need themselves.
Change-Id: Ic471386808d9f42ea19ccbd59cb50a5f83a89dd0
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change prepares for the new implementation of AudioTrack client, which
will require clients to use only sp<AudioTrack>, not raw AudioTrack *.
A raw delete will cause a race condition during AudioTrack destruction.
AudioTrack was made a RefBase by commit b68a91a70bc8d0d18e7404e14443d4e4020b3635
on 2011/11/15, when it was needed by OpenSL ES (for the callback protector).
At that time, the only other client that was also converted from
AudioTrack * to sp<AudioTrack> was android.media.AudioTrack JNI in
project frameworks/base (file android_media_AudioTrack.cpp).
Details:
* Use .clear() instead of delete followed by = NULL.
* ALOG %p need .get().
* sp<> don't need to be listed in constructor initializer, if initially 0.
* Use == 0 for sp<> vs == NULL for raw pointers.
* Use if (sp != 0) instead of if (raw).
Change-Id: Ic7cad25795d6e862e112abdc227b6d33afdfce17
|
|
|
|
|
|
|
|
| |
Commit 09108ade introduced a regression by not releasing
the ToneGenerator mutex before exiting in case of error.
Bug: 8852855
Change-Id: I8ba2755b218842e2034ed8dbd54b18bf2a5fc571
|
|
|
|
|
|
|
|
|
| |
Fix overflow in tone duration calculation introduced in
commit 681be039.
Bug 6607077
Change-Id: Ie12f13701345c2b2d3be0b3c4d71cbfa2394a29b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The first DTMF tone after a silent period is truncated.
This is because the phone app starts and stops the tone
when the user presses and releases the key.
This combined to the fact that the tones use the low latency path
and that when the output stream exists standby there is a period
of several milliseconds during which no audio is mixed until the
stream is "warmed up".
The result is that much less audio is generated than the actual
key press duration.
The fix consists in storing the tone start time and making sure that
the number of samples generated corresponds at least to the time difference
between the tone start and stop commands.
Bug 6607077
Change-Id: I070d20dd8600c25a9e5d5a60c1d3313b7917b00d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is a problem if the stopTone() method is called
from two different threads (for instance if the destructor is called
while stopTone() is waiting for the audio callback to finish).
In this case, the second call to stopTone() will not wait for the
condition to be signaled and call clearWaveGens() while the callback
can still be active, thus causing a crash.
There is a similar problem in case of concurrent calls to startTone()
and stopTone().
The fix consists in making sure that stopTone() always waits for call
back completion or timeout and exits before calling clearWaveGens()
if a concurrent start request is detected.
Bug 8163071
Change-Id: I9ddb4390407701dcad5bf83660fd9903f0d72268
|
|
|
|
|
|
|
|
|
|
| |
The pointer to AudioTrack should be initialized before
early return from ToneGenerator constructor because
it is tested by the destructor.
Bug 8140963
Change-Id: I9a7dfb60ba162b75dfaa5630ab7fc9485afd0074
|
|
|
|
|
|
|
|
|
| |
Do not create an AudioTrack and start playback when a silent
tone is requested to ToneGenerator.
Bug 7946399
Change-Id: Ib9282871a56f7a862af7d1504ce3fbd7c18e34e2
|
|
|
|
|
|
|
| |
Add combined channel APIs setVolume to AudioTrack,
and remove obsolete getVolume.
Change-Id: I0c87bfdbff4f4292259fa33e65f67badbafd270b
|
|
|
|
| |
Change-Id: If4152169778df124c750dc45023322ee23c80587
|
|
|
|
|
| |
Bug: 6378847
Change-Id: Ib3324c7a5951ac95f99993bfae27ea02bfda08ff
|
|
|
|
| |
Change-Id: I27c46bd1d1b2b5f96b87af7d05b951fef18a1312
|
|
|
|
|
|
| |
Also add comments to AudioTrack::set() parameter list
Change-Id: I28c76e9d813778d86b15d75cf7f01a17c258b6d9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
This affects:
- IAudioFlinger::openOutput
- AudioTrack::AudioTrack
- AudioTrack::set
- apps that call these
Change-Id: I26fb281bac6cb87593d17697bc9cb37a835af205
|
|
|
|
|
|
| |
We no longer put the filename at start of file.
Change-Id: Ic435b159a23105681e3d4a6cb1ac097bc853302e
|
|
|
|
|
|
|
|
| |
Unconditional delete for raw pointers.
Use "if (sp != 0)" not "if (sp.get() != 0)" or "if (sp != NULL)".
Use "if (raw != NULL)" not "if (raw)".
Change-Id: I531a8da7c37149261ed2f34b862ec4896a4b785b
|
|
|
|
| |
Change-Id: I0bef580cbc818cb7c87aea23919d26f1446cec32
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Also remove defaults in startToneCommand(), they're not needed and the
default for tone type was nonsense.
Change-Id: I70fa8cee4f3dbb8c66ceb3719c8d3d2f447f05b9
|
|/
|
|
|
|
| |
Use if (p != NULL) instead of if (ptr)
Change-Id: Iaec3413a59ccbf233c98fcd918cc7d70ac5da9fa
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: Ie79dd5abb8078b35474bf0f1b3a6ff994a3a3360
|
|
|
|
|
|
|
| |
See https://android-git.corp.google.com/g/#/c/157220
Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
|
|
|
|
|
|
|
| |
See https://android-git.corp.google.com/g/157065
Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
|
|
|
|
|
|
|
| |
See https://android-git.corp.google.com/g/#/c/143865
Bug: 5449033
Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
|
|
|
|
|
|
| |
Suggested in code review for previous change.
Change-Id: Ic3225b240367dc6c9bf56fb4498fb8a0f9f806ec
|
|
|
| |
This reverts commit 2225e4b7049fa3fb9d39a068b8268b63c952d7c1
|
|
|
|
| |
Change-Id: Ifefc708d46874e04fd0d01cb6e2d43b987ee796c
|
|
|
|
|
| |
Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5
Signed-off-by: Dima Zavin <dima@android.com>
|
|
|
|
|
| |
Tone format for TONE_CDMA_ANSWER should be 660Hz + 1000Hz, with a 500ms ON
duration.
|
|
|
|
|
|
|
|
|
|
|
| |
Create a new IAudioTrack interface to AudioFlinger when start() fails due to a broken pipe error.
Do the same if start fails due to the same error after time out in obtainBuffer().
Do not indicate that the AudioTrack is started to AudioPolicyManager if IAudioTrack start fails.
This avoids that an AudioTrack keeps a dead IAudioTrack after a media server crash.
Same modifications for AudioRecord.
Add a flag to ToneGenerator indicating that the callback thread can call Java. Without it, when the media server crashes and restarts, the AudioSystem error callback will crash in JNI if the IAudiotrack is created from AudioTrack callback thread.
|
|
|
|
|
|
|
| |
waiting for the stop sequence to complete.
Unlock mLock mutex when exiting upon wait stop timeout condition.
Increase timeout delays to avoid timing out when A2DP exits standby.
|
|
|
|
|
|
|
|
|
|
| |
high).
This change is a complement to the main fix in kernel driver for the same issue (partner change #1250).
It removes clicks sometimes heard after the end of the tones while audio flinger is sending 0s to the audio output stream.
The problem was that the sleep time between two writes was more than the duration of one audio output stream buffer which could cause some underrun.
Also fixed a recent regression in ToneGenerator that made that the end of previous tone was repeated at the beginning of current one under certain timing circumstances when the maximum tone duration was specified.
|
|
|
|
|
|
|
|
|
|
| |
or over A2DP.
When the AudioTrack callback notification size is relatively high (Which is the case on Sholes and over A2DP), it is likely that the end of tone is reached during the first callback. In this case, the AudioTrack is stopped before exiting the callback which causes 2 problems:
- 1: If the AudioFlinger thread is scheduled before we exit the ToneGenerator callback, the track can be stopped and reset before the data is actually marked as present in the buffer by the AudioTrack callback => no audio will be processed by AudioFlinger.
- 2: In this case, the data write index in the AudioTrack buffer is incremented after the track was reset by the AudioFlinger which leaves unplayed data in the buffer. This data will be played the next time the AudioTrack is started if not flushed in between.
The fix consists in adding an intermediate state to ToneGenerator state machine so that we exit the callback function when the stop condition is reached and stop the AudioTrack the next time we execute the callback.
|
|
|
|
|
| |
Add a parameter to ToneGenerator.startTone() allowing the caller to specify the tone duration. This is used by the phone application to have a precise control on the DTMF tone duration which was not possible with the use of delayed messaged.
Also modified AudioFlinger output threads so that 0s are written to the audio output stream when no more tracks are ready to mix instead of just sleeping. This avoids an issue where the end of a previous DTMF tone could stay in audio hardware buffers and be played just before the beginning of the next DTMF tone.
|
|
|
|
|
| |
There is a void statement at line 917 of ToneGenerator.cpp: mState == TONE_IDLE;
This problem is harmless as in current code this execution path is never taken; it can only happen if a "new" operator fails in prepareWave() which is a case we usually consider as unlikely in android audio framework.
|
|
|
|
|
|
|
| |
Initial commit for review.
Integrated comments after patch set 1 review.
Fixed lockup in AudioFlinger::ThreadBase::exit()
Fixed lockup when playing tone with AudioPlocyService startTone()
|
|
|
|
|
|
| |
The cause is very likely that the WaveGenerator *lpWaveGen returned by lpToneGen->mWaveGens.valueFor(lFrequency) just before calling lpWaveGen->getSamples(lpOut, lGenSmp, lWaveCmd) is invalid. The frequency lFrequency is not part of the frequencies in mWaveGens.
This can happen if a different tone is started while the callback function is active: The state is changed to TONE_RESTARTING and the call to prepareWave() at line 1226 will change the tone descriptor pointed to by mpToneDesc as well as the content of mWaveGens. However, mpToneDesc was cached in a local variable lpToneDesc when entering the callback and is not reloaded when exiting prepareWave(). This causes a mismatch between the tone frequencies listed in lpToneDesc and the frequencies present in mWaveGens.
This regression was introduced in change 973 when mpToneDesc was cached in a local variable.
|
| |
|
|
|
|
| |
Bug 1836596
|
|
|
|
|
|
|
|
|
|
| |
Added new tone types for CDMA IS-95 specific tones.
Automatic selection between IS-95, CEPT and JAPAN version base on operator
country code for call supervisory tones.
Also improved tone generator capabilities:
- Each tone segment can now generate its own set of frequencies
- A tone does not have to be a succession of alternating ON/OFF segments
- The sequence repetition does not have to start from first segment
|
| |
|