History log of /frameworks/av/media/libaudioclient/AudioTrack.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ad2e7b902c0432a0db40906a4b1f5b693ce439dd 15-Sep-2017 Eric Laurent <elaurent@google.com> Fix various AAudio device selection issues

Bug: 65292224
- Audio policy manager should not use an unavailable device when an explicit
route is requested. This causes a device selection made by a client to
become sticky after device disconnection.

Bug: 64945845
- Remove spurious device change callback occuring after registering a
new client to audio server by creating a specific configuration event
for client registration.
- Do not keep strong references to device callback interfaces in
AudioTrack, AudioRecord and AudioSystem.
- Do not update selected device in AudioTrack and AudioRecord when
not active as the new device selection on the stream is because of other
clients activity which is not relevant to an inactive client.

Bug: 65693340
- Fix missing increment of SessionRoute ref count in getInputForAttr() for
MMAP inputs

Test: AAudio CTS tests

Change-Id: I2a01b02e8b064d352004f6065495fd99aee55745
/frameworks/av/media/libaudioclient/AudioTrack.cpp
13969262f704ca27c82d60e3c7cf4b271e3b5918 12-Sep-2017 Andy Hung <hunga@google.com> AudioTrack, AudioRecord: Fix latency computation

Force 64 bit arithmetic to avoid integer overflow on 32 bit
platforms.

Test: CTS AudioTrackTest
Bug: 65536481
Change-Id: I774a7811fce08c7cbe59f0a062fd2c2d72220203
/frameworks/av/media/libaudioclient/AudioTrack.cpp
310dd0a2d96e97d4f3983a6e70b5e0653a521030 07-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix failure at AudioTrack_ListenerTest#testAudioTrackCallback" into oc-mr1-dev
c7bb8324c7c19ed4ab5bdafae0d750bf41c299f1 07-Sep-2017 jiabin <jiabin@google.com> Fix failure at AudioTrack_ListenerTest#testAudioTrackCallback

After cold start, running the test will cause failure. The reason is
that with cold start, the buffer is being processed faster than the
position callback.
Calling the callback earlier at the very start will fix this issue.

Bug: 63056426
Test: adb shell am instrument -e class 'android.media.cts.AudioTrack_ListenerTest#testAudioTrackCallback'
-w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner'

Change-Id: I7416cecb2837fac4a966e832412948c357e7b8dc
/frameworks/av/media/libaudioclient/AudioTrack.cpp
c4e60eb165608f08cd85ed2fccbdaa6700f271cd 06-Sep-2017 Andy Hung <hunga@google.com> AudioTrack: Fix extended timestamp offset

The extended timestamp server and kernel location positions
need the proper client side delta offset for native AudioTrack API calls.
The client location position is unaffected along with the legacy timestamp.

Test: test_timestamp, Photos, kill audioserver
Bug: 65386236
Change-Id: Idd71b6a31e0e86a323d0e5e343a2836e34c08673
/frameworks/av/media/libaudioclient/AudioTrack.cpp
ffa3695a012d22c6c81cf311232c5c84c06f9219 17-Aug-2017 Andy Hung <hunga@google.com> AudioTrack: Limit timestamp time lag after start

Test: Photos with long pause and resume
Bug: 63614330
Bug: 63976584
Change-Id: I81ac650c821600fee507c72c3b0c1be60f5e7ab6
/frameworks/av/media/libaudioclient/AudioTrack.cpp
2b01f009428797ee9154649411a64b522946e966 05-Jul-2017 Andy Hung <hunga@google.com> Replace old audio time conversion macros and functions

Test: Play Movies, Youtube, CTS
Bug: 25569135
Change-Id: Ib6e304f149c381dc7af7f4aa959c3d79d7bdb2aa
/frameworks/av/media/libaudioclient/AudioTrack.cpp
325b2997d92c4ba2c116b47e6c3d0d0045c5386b 26-Jun-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Set initial audio device for AudioTrack and AudioRecord"
9ae8c597d9a0c8cedc4047fc4716d7361453f6ab 23-Jun-2017 Eric Laurent <elaurent@google.com> Set initial audio device for AudioTrack and AudioRecord

Bug: 62090113
Test: run AAudio test and verify a valid device is reported just
after opening playback or capture streams in legacy mode.

Change-Id: Ic8be42e1735690eb00c811ef0cb8b5abb36172d6
/frameworks/av/media/libaudioclient/AudioTrack.cpp
adbb75af4d3224194b9b772855db93fae19cf4ce 16-Jun-2017 Phil Burk <philburk@google.com> AudioTrack: explain why FAST mixer denied

Also for AudioRecord

Bug: 62692443
Test: write_sine.cpp
Change-Id: I5b281476af4703798129df66584d813b9a8db8bb
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/media/libaudioclient/AudioTrack.cpp
0b86e57b61b46652585008679e48b6961b40122d 08-Jun-2017 Andreas Gampe <agampe@google.com> audio: Fix read of uninitialized memory

Follow-up to fb12e20e426bc6bcff06e39fba45a931cf787040.

Bug: 62425341
Test: m
Test: Device boots, com.android.phone doesn't crash
Change-Id: Ib54c7efae88cb0bff0f92e1cf1bd20a22fdcbdba
/frameworks/av/media/libaudioclient/AudioTrack.cpp
b27f9af593c73aa8537f37f0956af7e471051d4d 08-Jun-2017 Andreas Gampe <agampe@google.com> audio: Fix read of uninitialized memory

Follow-up to fb12e20e426bc6bcff06e39fba45a931cf787040.

Bug: 62425341
Test: m
Test: Device boots, com.android.phone doesn't crash
Change-Id: Ib54c7efae88cb0bff0f92e1cf1bd20a22fdcbdba
/frameworks/av/media/libaudioclient/AudioTrack.cpp
5573544e1052e3cff3f98482a6258a3cba47372a 01-Jun-2017 Andy Hung <hunga@google.com> Merge "audio: Output latency update in Audio Track"
fb12e20e426bc6bcff06e39fba45a931cf787040 06-Apr-2017 Haynes Mathew George <hgeorge@codeaurora.org> audio: Output latency update in Audio Track

AudioTrack needs to query latency from the output descriptor each
time it uses mAfLatency to calculate timestamp or return the track
latency. Until now, the output descriptor latency was queried and
stored when a track is created. On a device switch, IO descriptors
table saved in AudioSystem is updated to reflected the latest
latency values. Unless a device switch lead to a track teardown,
AudioTrack will be unaware of the latest latency value. Therefore
explicitly check the latest mAfLatency value on each getTimeStamp
call.

Test: Podkicker 2.2x, Photos 240fps and BT
Bug: 35075600
authored-by: Aniket Kumar Lata <alata@codeaurora.org>
Change-Id: I06282182364703574a7d66d2b5cd1301679dfade
/frameworks/av/media/libaudioclient/AudioTrack.cpp
ef44fb4115270883da829fea91174c8cc003b777 30-May-2017 Eric Laurent <elaurent@google.com> aaudio: fix device switch detection in legacy path am: fb00fc77f5
am: 0bbea62ed4

Change-Id: I80dfc949c206c1572f867f3ffedb6ff556a7b8f2
fb00fc77f59ed5ebec4d38bac666e6521b6c1de0 26-May-2017 Eric Laurent <elaurent@google.com> aaudio: fix device switch detection in legacy path

Implement device switch detection on legacy path (AudioTrack and
AudioRecord) based on audio routing callbacks forcing the stream state
to disconnected.

Bug: 33355262
Bug: 62090113
Test: tested with write_sine and input_monitor command line tools.
Change-Id: I9e0421fee233964b1bf318acb640569196a00f13
/frameworks/av/media/libaudioclient/AudioTrack.cpp
34d606c66ffcd536daccf415132facd3cbfe1a8f 25-May-2017 Glenn Kasten <gkasten@google.com> Merge "Add TODOs for checking return value of wait"
47d5517331f41f8583f4e47752132de96e14a96f 23-May-2017 Glenn Kasten <gkasten@google.com> Add comments explaining about SCHED_FIFO

Test: builds OK
Change-Id: I7fa39defb081c27eb32abb241c0aa2a210744954
/frameworks/av/media/libaudioclient/AudioTrack.cpp
75f79038715b4b1cf28e0457abfa84ccd17bb57e 23-May-2017 Glenn Kasten <gkasten@google.com> Add TODOs for checking return value of wait

Test: builds OK
Change-Id: I750b73de54deeccbae846189fdf385e636d9e4cd
/frameworks/av/media/libaudioclient/AudioTrack.cpp
2f35206b77dd7d8a8c761e0a81ea327c10787036 11-May-2017 Andy Hung <hunga@google.com> Merge "VolumeShaper: Fixes for updated Cts test" into oc-dev am: 2d12b8e367
am: d906ad023d

Change-Id: I27856718a4914e396a7c387da7b4f4e4b7c245e6
f370264dfa5237524a3535f5242a0c68cbbb13eb 06-May-2017 Andy Hung <hunga@google.com> VolumeShaper: Fixes for updated Cts test

1) Limit number of VolumeShapers that can be created.
a) 16 system VolumeShapers
b) 16 application/client VolumeShapers
2) Return proper volume before VolumeShaper is started.
3) Consistent xOffset definition used internally:
a) this is now always the position on the volumeshaper curve
which can go backwards if in REVERSE.
b) normalized time is always forward going and is scaled
to 0.f and 1.f depending on progress relative to
the curve's duration.
4) Fix replace method.
5) Add comments.

Test: Use updated CTS VolumeShaperTest
Bug: 37536598
Change-Id: I837ab2a481adc0abbd3f1338bfe2cb79831b11fa
/frameworks/av/media/libaudioclient/AudioTrack.cpp
296ee17ce39af4fa3173bbf21fbc719db4b8f329 02-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "ALOGW when failing to open audio track because of playback rate"
39399b6b08b4e9fd7eae50e58e93b07216ad697f 22-Apr-2017 Andy Hung <hunga@google.com> VolumeShaper: Improve restore

Consider whether VolumeShaper has been started or not when
restoring (position). If the VolumeShaper hasn't been started
we restore in that state. If it has been started already,
we advance to the end assuming the duration has been played out.

Test: CTS and headset / kill audioserver
Bug: 37536598
Change-Id: I4b55dca6f6a859563fd20bad4c8f67d2c92321c0
/frameworks/av/media/libaudioclient/AudioTrack.cpp
4e728d4bbc683a50096f052a31c8eb5cbb1e100e 07-Apr-2017 Kevin Rocard <krocard@google.com> ALOGW when failing to open audio track because of playback rate

This will help debuging errors linked the associated bug.

Test: compile

Bug: 36509278
Change-Id: I3034a8a40d20cee15dc394baf0743be3d996a155
Signed-off-by: Kevin Rocard <krocard@google.com>
/frameworks/av/media/libaudioclient/AudioTrack.cpp
6d8018f0b7be9deec6b0acab10a0dca6e91d0fb8 21-Feb-2017 Glenn Kasten <gkasten@google.com> Improve audio logs and dumpsys media.audio_flinger

Include mFrameCount in shared memory corrupt error log.

Fix typo in log for primary audio interface.

Include the new server frame count in logs for fast tracks.

Always log when fast is successful for output tracks, as it helpful
(was already there for input).

Cleanup dumpsys for threads.

Bug: 37153050
Test: builds OK, and logs contain more information
Change-Id: I2b5b4d700e8eb7c261a3125fb03ddc00bf08537e
(cherry picked from commit 1bfe09a0b1755a79abd32b41c0dd433b88fc260c)
/frameworks/av/media/libaudioclient/AudioTrack.cpp
1bfe09a0b1755a79abd32b41c0dd433b88fc260c 21-Feb-2017 Glenn Kasten <gkasten@google.com> Improve audio logs and dumpsys media.audio_flinger

Include mFrameCount in shared memory corrupt error log.

Fix typo in log for primary audio interface.

Include the new server frame count in logs for fast tracks.

Always log when fast is successful for output tracks, as it helpful
(was already there for input).

Cleanup dumpsys for threads.

Test: builds OK, and logs contain more information
Change-Id: I2b5b4d700e8eb7c261a3125fb03ddc00bf08537e
/frameworks/av/media/libaudioclient/AudioTrack.cpp
d3bb645f0b7f567b033b8664499d685f8ec10628 06-Dec-2016 Glenn Kasten <gkasten@google.com> Re-format to decrease the maximum line length of files to 100 characters

Test: compiles OK
Change-Id: Ibe663032cd390ed2bcca6dc921d47732e6e15e21
/frameworks/av/media/libaudioclient/AudioTrack.cpp
4ef88d7106c01f81109ee163cb6789073d80c6ae 22-Feb-2017 Andy Hung <hunga@google.com> VolumeShaper: Add AudioTrack restore

MediaPlayer VolumeShaper can now be set before start().

Test: CTS and Ducking
Bug: 31015569
Change-Id: Idf63c167e164161b200e2467fbeb9409b3097dbe
/frameworks/av/media/libaudioclient/AudioTrack.cpp
9fc8b5cd4a64ef07e84c69112461324d5c13a0b0 24-Jan-2017 Andy Hung <hunga@google.com> VolumeShaper: Initial implementation

The VolumeShaper is used to apply a volume
envelope to an AudioTrack or a MediaPlayer.

Test: CTS
Bug: 30920125
Bug: 31015569
Change-Id: I42e2f13bd6879299dc780e60d143c2d465483a44
/frameworks/av/media/libaudioclient/AudioTrack.cpp
fff204c192f7e16c635a79f6a85786afb8522a3d 13-Jan-2017 Andy Hung <hunga@google.com> AudioTrack: Control deep buffer from AudioAttributes

Test: AudioTrack CTS test, Play Movies
Bug: 30687201
Change-Id: I6a46a05dbf3fd61c8d47dade5b4baee69b923195
/frameworks/av/media/libaudioclient/AudioTrack.cpp
20b9ef0b55c9150ae11057ab997ae61be2d496ef 05-Dec-2016 Eric Laurent <elaurent@google.com> Add unique audio port IDs to AudioTrack and AudioRecord

This will allow to track activity at the track level instead of
at audio session level as only possible with current implementation.

AudioTracks and AudioRecords will receive a unique audio port ID the
first time they register to audio policy with
getOutputForAttr()/getInputForAttr() and keep this ID for their
lifetime.

This CL is the first partial change and just updates the
audio policy and audio flinger APIs used at track creation time.

Test: basic regression test of audio playback and capture use cases

Change-Id: I8d612e67738e120494f61e3f7c60bfd0b2c6a329
/frameworks/av/media/libaudioclient/AudioTrack.cpp
2148bf0e79c436b8764b9edc4c8f2730cce98a32 29-Nov-2016 Andy Hung <hunga@google.com> Log audio information to ensure complete delivery

Test: Audio playback
Bug: 30572472
Change-Id: Ibad6fc202692cd3480ae726627252afdead083f3
/frameworks/av/media/libaudioclient/AudioTrack.cpp
1f12a8ad958344c50733b948628ffa06db9c5bc6 08-Nov-2016 Andy Hung <hunga@google.com> Audio: Use uid_t for uids

Test: Power manager shows correct uids for audio
Bug: 32713790
Change-Id: If5337e17283268f74dc0f00cc66ece9153d680ef
/frameworks/av/media/libaudioclient/AudioTrack.cpp
538ec5e04f389cba637b030757be317fcb8677a8 02-Nov-2016 Marco Nelissen <marcone@google.com> Split libmedia into libmedia and libaudioclient

This makes it so audioserver doesn't need to link against the entire libmedia,
which has dependencies on camera, ICU, OpenGL and other things that aren't
needed for audio.

Test: build/boot

Change-Id: I99ba1a3dc3b33ca9b3abd98e7519dbf228ee62af
/frameworks/av/media/libaudioclient/AudioTrack.cpp