Move ExtendedAudioBufferProvider.h to libaudioclient. This is
a more appropriate location because EABP extends AudioBufferProvider.
Move SingleStateQueue.h to libnbaio_mono. This is a more appropriate
location because SSQ is a non-blocking queue.
This allows to remove the dependency of libnbaio on libmedia
which is a good thing because libnbaio provides more low-level
abstractions than libmedia.
Also, replace a dependency of libnbaio on libbinder with
a dependency on libaudiohal header library.
Test: make
Change-Id: Ie48b523790cd8230695ec2e4710e50981b616289
Header files of libnbaio include files from audio_utils
yet the module did not export include path for those. This was
requiring modules depending on libnbaio[_mono] to add those
include paths into their build files.
Test: make
Change-Id: I8982e04db0f3646ce7945fb55529727766f2dfa1
No longer needed as RecordThread overrun handling has improved.
Test: Directed test, see bug.
Bug: 79145022
Change-Id: Iee72da1f628639632e030218fb717400a1cc1bd8
audio.h and its dependencies (audio-effect.h, sound_trigger.h...)
used to be shared between system and vendor code.
This led to multiple problems:
1) Such sharing contradicts the Treble policy of
strict independence of framework and vendor code.
2) When audio.h was changed, every vendor needed to update
its code in the next release. This meant that audio*.h
headers were mostly changed in backward compatible manner.
Nevertheless, for P the HIDL interface and thus the audio.h
interface are changed in backward incompatible way.
(Some enum are becoming 64 bit long).
3) As the headers were common, some API used only by the framework
needed to be visible to the vendors (mostly enum values).
4) Treble policy is to support at least one previous HAL version
As a result the audio*.h headers are now duplicated,
one set for the framework, and one for the vendor.
Each set will evolve independently. After this split,
the framework-only APIs will be removed from the vendor headers
and vice versa.
The split is implements as such:
+ for system code
- NOT moving the libaudio_system_headers
Eg: system/audio.h and system/audio_effects/effect_equalizer.h
are still in system/media/audio
- the legacy audio HAL API that were in libhardware headers
are now in libaudiohal_legacy_headers
Eg: hardware/audio.h and hardware/audio_effect.h
are now in frameworks/av/media/libaudiohal/legacy/
+ for vendor code
- moving libaudio_system_headers and the legacy audio HAL API
that were in libhardware_headers in
android.hardware.audio.common.legacy@2.0
Note that those headers are now versioned, so migrating to a @4.0
HIDL HAL will mean changing the legacy dependency too.
Eg: system/audio.h, system/audio-effect.h, hardware/audio.h
are now in hardware/interfaces/audio/common/2.0/legacy
- the legacy audio effect HAL API that was in libaudioeffects
is now moved in android.hardware.audio.effect.legacy@2.0
Eg: audio_effects/effect*.h are now in
hardware/interfaces/audio/effect/2.0/legacy
- the legacy sound trigger HAL API that were in libhardware_headers
is now moved in android.hardware.soundtrigger.legacy@2.0
Eg: hardware/sound_trigger.h is now in
hardware/interfaces/audio/effect/2.0/legacy
libaudioutil being used by both system and vendor, had
to be renamed for system to libaudioutil_system.
Vendor libs that now depend on the audio.h of a specific
version and are not extensively referenced in non google code,
append @2.0 to their name.
Note that headers that are not expected to change in the 4.0 HAL are
left in all-versions folder to avoid duplication.
This is an implementation detail as the versioned libraries export
the all-versions headers.
Note that strict vendor-system separation is enforced by the
build-system. The system headers are not available for vendor
libs and vice-versa.
Note that this patch is split between numerous git repository (>10),
all the commits having the same Change-id for searchability.
Note that audio_policy.h is no longer exposed to vendors
as the legacy audio policy HAL API was never officially supported.
As a result the audiopolicy stub implementation has been removed.
Test: compile taimen-userdebug walleye-userdebug
sailfish-userdebug marlin-userdebug
gce_x86_phone-userdebug gce_x86_phone
full-eng aosp_arm aosp_x86-eng
Test: check that the emulator booted and played audio
Test: full QA on sailfish-userdebug and taimen-userdebug
Bug: 38184704
Change-Id: I950f4e0a55613d72e32eba31bd563cb5bafe2d1a
Signed-off-by: Kevin Rocard <krocard@google.com>
nbaio is an acronym for "non-blocking audio I/O", and nblog means
"non-blocking logger" so nblog does not belong with nbaio.
There are a lot of improvements planned for nblog, and having the
restructuring done will make it clearer as more files are added.
Test: builds OK
Change-Id: Ib28bada2566c1d64bdbe9f5d7a5ce40e080178ef
Histograms and related data structures can
store up to 10 hours worth of data. Fixed
histogram logging elapsed time count and
resolution
Test: dumpsys media.log
Change-Id: Ibb394273b7b1be4c791f9dbe64a32a7436714a9d
Add date to WriteToFile filenames and simplify
file format. Add timestamp logging to
NormalMixer. Change histogram resolution
dynamically based on logarithmic distance
from the distribution center. Add context
information: thread, hash and time.
Example of right end of a histogram with
rounding for values >= 27:
1 1 2 1 1 1 2 2 1
| | |
| | | | | | | | |
_____________________________________________
21.1 21.2 22.9 23.0 23.3 27.0 34.0 37.0 38.0 ms
Test: dumpsys media.log
Change-Id: I255e2d28d76a1c7a06d48e7c3eacdf2f846a7ea3
Instead of storing values in buffers and
processing them in batches, process each
sample on its own
Test: dumpsys media.log
Change-Id: I642555f290632cea37907a00b92f61ed6aec4eec
Stores related variables in structs instead of
directly in the class definition
Test: dumpsys media.log
Change-Id: I776e35e74ac69b428170b379a9bcf4d18b3fa041
Each file name starts with either "histogram" or
"outlier" and contains thread and hash (source
file location) information.
Test: dumpsys media.log
Change-Id: I4bbea8b5265ac539e6fb2ce16207e4f5c89d21d4
Use a map of maps of PerformanceAnalysis. The
first key is the thread, the second key the
source file location.
Test: dumpsys media.log
Change-Id: Ib60758e10ce1ddbf65337419db2ff3aa070763fb
Instead first writing to a deque of short-term
histograms and copying the data over to long-term
histograms, write directly to a single deque
of histograms.
Test: dumpsys media.log
Change-Id: I05a283a54b84bc7d061c7fae7b671390c1690def
Every time merge is called by the thread loop,
the data is also processed and written to
PerformanceAnalysis. A call to dump retrieves
the FIFO of processed data in PerformanceAnalysis
instead of the unprocessed Reader FIFO, and prints
the result to the console.
Test: dumpsys media.log
Change-Id: Ic479f48e9e4fdf4523a8f15db514dbdd85b70434
Created new file ReportPerformacne.cpp with file writing
functionality. When short-term histogram array is full,
its data is aggregated into a long-term histogram array.
Cleaned up documentation and comments.
Test: dumpsys media.log
Change-Id: I19f48ea27ffc8205e67ea4ded04615d33a422966
The issue was in the possibility of the 'intervals' vector being
empty if the provided 'samples' vector contains only one
element. That leads to 'intervals.end()' being passed to
'intervals.erase()', and vector::erase produces undefined
behaviour in that case.
I see no other calls to 'erase' or 'max_element' in libnbaio,
so that should be the only fix needed.
Bug: 62536501
Test: see test case at bug
Change-Id: I37f93fa42030ed6f5bcb2d46b0a7a2c0af3c82e4
This releaves reviewing burden from the frameworks/av owners.
Note that the lists of owners are inherited from the parent
directories thus the people listed in these files are owners
*in addition* to people listed in frameworks/av/OWNERS,
and frameworks/av/{media|services}/OWNERS.
Change-Id: I5e2db1c40cb807b906b2701fe446c874a8d19983
Test: not needed
Calls flushTsSeries when a state change was detected
to avoid logging idle audio time as a buffer period.
Test: dumpsys media.log
Change-Id: Ia33bec8829dcd5d2de5c40f904e5ea19c5a2b453
Moves analysis and storage from NBLog to
PerformanceAnalysis. Applies peak analysis to
outlier information to detect changes in the
distribution of outlier frequency.
Adds cleanup, documentation, FIXME comments for
upcoming changes.
Test: dumpsys media.log
Change-Id: Iea393dac62959aef754ae2a9b4afe2556c1f3ecb
When the vndk is enabled (BOARD_VNDK_VERSION=current),
vendor libraries must only link against vendor variants
in the build system. This also means that they receive restricted
sets of headers and that automatic global headers are restricted.
Test: mma -j BOARD_VNDK_VERSION=current
Test: boots device, audio plays over YouTube
Bug: 37342627
Bug: 63269228
Change-Id: Ifa9c96f6b98b456def485be6bc5046ee54c3c3ca
Turning audio on and off does not cause this event to be
written to the buffer. Now, a call to dumpsys media.log
simply writes to console an analysis of the data in memory,
and does not delete it afterwards.
Test: dumpsys media.log
Change-Id: Ie75fb27ec4050fb3891635f4c7933196cfd03643
A call to dumpsys media.log causes the program to read
timestamp data from the circular buffer stored in local memory
to a local data structure which stores this data in a
compressed format.
The current code is a temporary step towards the ultimate
goal (described below). The timestamp data is turned into
historgrams of a small, fixed size, and added to a vector
of histograms. When the vector reaches a given number of
histograms, the oldest one is popped. When dump() is called,
all the short histograms are combined into one large one and
printed. The advantage of this approach is to not delete
data from memory until it is overwritten. Ultimately, this
data structure should be a circular buffer. A second data
structure should be added which keeps a more long-term analysis
of the data.
Test: dumpsys media.log
Change-Id: I39c4818e7d1221d5023a4355b8b57fadd9451de5
erases previous content for each histogram set.
Test: more /data/misc/audioserver/sample_results.txt
Change-Id: I55847f3e61af76992a73084fe2b5c87c88fc504c
A glitch is assumed to occur when the sum of the three
latest buffer periods cause CPU time to be unavailable
for the next buffer. For example, if a buffer period
is 4 ms, requires 3 ms of CPU time, and a running sum of
3 consecutive buffer periods is examined, this sum cannot
exceed 13 = 3*4 + (4-3), where 3*4 is the expected total
time and (4-3) is the CPU time left available by one 4 ms
period. Glitch examples:
4 + 4 + 6; 5 + 4 + 5; 2 + 2 + 10
See NBLog::Reader::alertIfGlitch.
Boolean NBLog::Reader::findGlitch should be set to true
for the notification to occur.
Note: this function needs to be developed to track glitch
occurrences over time and notify when a difference in
trend occurs.
Test: dumpsys media.log
logcat | grep NBLog
Change-Id: Ibf120afd990a71eb40863157a28c3a5a4a610c64
Fix the trivial warnings that are hidden by the use of -isystem to
include frameworks/av and caught by -Werror.
Test: m -j checkbuild
Bug: 31751828
Change-Id: I155f9f772ce0a84b364313814cb7cf528b9de4eb