- BufferQueue consumer may detach buffers, and BufferManager isn't
aware. Hook up onBufferRemoved callback so that BufferManager's internal
handoutBuffer and attachedBuffer counts can be updated when a buffer
is detached.
- Deleted some code that's not exercised any more.
Test: Camera CTS and burst capture.
Bug: 38238747
Change-Id: I6861da6e013fe5609907f807639c5d691c0c3af9
To facilitate testing of MMAP mode.
Bug: 38268547
Test: set properties, see framesPerBurst in write_sine_callback.cpp
Change-Id: I6e15c563215017f6a5020d89ac312ff8331afc4f
Signed-off-by: Phil Burk <philburk@google.com>
Previously the patch I98a8913d6faf5092a1e43a0bdd0f1ce1482221a9
forbade two tracks from different application to be offloaded
concurrently.
Concurrent offload is only needed for back to back playback...
Detect this use case by checking the session id instead of the
PID.
Test: call & play music & assistant
Test: run new CTS testConcurentPlayAudio
Bug: 35841692
Change-Id: I2c09c54adedf12644205bef115f1a2e16b05de91
Signed-off-by: Kevin Rocard <krocard@google.com>
Providers could have devices with same id but different
API versions. The total number of API1 compatible devices
needs to consider only the unique ids in this case.
Bug: 38237265
Test: Manual using application
Change-Id: I5a31c3cd28f00e8af3029213711505e4075a61b2
Buffers that didn't get a chance to be processed
might still hold valid acquire fences. Check and
close those if necessary.
Bug: 38229510
Test: Manual using application
Change-Id: I8e823a655cc30ed966e277ace090e96c64ba1c8c
Camera service should enumarate newly added
camera providers.
Bug: 37592461
Test: Manual using camera application
Change-Id: I4c886b99127d23148c70ce1e1e773cb8393d91b4
Close some file descriptors for shared memory that were not getting closed.
Bug: 37947848
Test: see bug for test procedure
Change-Id: Icdc13188b0a49d08b67babff0852c3a4eda8fd2b
Signed-off-by: Phil Burk <philburk@google.com>
Better estimation of wait time in suspended audio threads.
Bug: 34772697
Test: phone calls with BT headset.
Change-Id: Icf99c0671def810b57332a321e4de4680697715b
android.hidl.base@1.0 and android.hidl.manager@1.0 are built into libhidltransport.
Test: links
Bug: 33276472
Change-Id: I1e33404a582a3707e0990634467c1fc7430c23a2
(cherry picked from commit 240b83a455)
The performance mode affects the latency and the implementation of the
data path.
MMAP is still disabled for now.
Bug: 37867485
Test: write_sine.cpp
Change-Id: I9bf5d5d13d1047d5ace69bd5ebdce7b6d65c14e7
Signed-off-by: Phil Burk <philburk@google.com>
PlaybackThread::Track is missing checks for the track state
when reporting underruns. These checks present on other instances
when tallyUnderrunFrames is being called.
This eliminates fake underrun reportings when playing
multichannel tracks via deep buffer.
Bug: 36181621
Test: play multichannel track and check underrun count at the end
Change-Id: Ieff338b33807e66df91234d85b782ee383fe95b9
Bring media metrics 'summarizer' construct across from master so
that we can use it in oc-dev.
This is the functionality described in b/36736083, along
with a bug fix (b/37276863).
Simple CP didn't work because of some header file movement.
the do-not-merge is because this is already in master as a couple
of separate commits and we don't want any auto-merger complaints.
(The Merged-in line documents the commit into master)
Bug: 37915543
Test: read 'dumpsys media.metrics -summary' output
Merged-in: I325c2d2b25720d384bcc75b73c97e5b3d8fa9731
Change-Id: I8d1c29c066f6289863e99379e4bd5989af5688ea
Treble audio HAL mandates that a valid device address is passed when
opening an output or input stream and teh device type requires and
address.
Bug: 37905534
Test: USB capture at various sampling rates. Audio playback and capture regression
Change-Id: I12f2128120b1bbe8530e8c2428e3e2cba1ba1535
android.hidl.base@1.0 and android.hidl.manager@1.0 are built into libhidltransport.
Test: links
Bug: 33276472
Change-Id: I6ffb95645e767ab2575623333b12ba720f64d58b
(cherry picked from commit 5e732cdddf)
Plus other small fixes for CTS and cleanup
Bug: 37910599
Test: test_aaudio.cpp
Change-Id: I65a23daf99e9de857d3ce9fd12e9f11c614e298e
Signed-off-by: Phil Burk <philburk@google.com>
Was checking for nullptr not MAP_FAILED
Bug: 33398120
Test: see mmap() docs
Change-Id: I02d178cb0188f8b0d6cd009699dccc7c97952e4b
Signed-off-by: Phil Burk <philburk@google.com>
Fix -Wundefined-var-template and -Wsign-compare warnings that were
hidden by the use of -isystem to include frameworks/av.
Test: m -j native
Bug: 31751828
Change-Id: I28e07b238d5bc913ea2f3dfa09fa02f577d5a250
Merged-In: I28e07b238d5bc913ea2f3dfa09fa02f577d5a250
(cherry picked from commit d995c0186e)
Check for transaction errors in all calls to the HIDL interface;
return DEAD_OBJECT consistently if a transaction error occurs.
Test: Camera CTS does not regress; killing camera HAL does not kill camera service.
Bug: 37748853
Change-Id: Iab3ad08376e164db340f8f29c3cfc7fdf261cc00
The volume scaling is in AudioStreamInternal and not the mixer
because we will need volume scaling in EXCLUSIVE mode too.
Bug: 37518243
Test: play a tone using NativeOboe app then press volume keys
Change-Id: Ibbac9770ea4493f8ade64681be86f109a92803cd
Signed-off-by: Phil Burk <philburk@google.com>
This flag is obsolete now that the conversion
to treble is complete.
Change-Id: I7073d337939da43bddf99644bfe52db9baa2f605
Merged-In: I7073d337939da43bddf99644bfe52db9baa2f605
related-to-bug: 32815560
(cherry picked from commit 99a5aba027)
Fix -Wundefined-var-template and -Wsign-compare warnings that were
hidden by the use of -isystem to include frameworks/av.
Test: m -j native
Bug: 31751828
Change-Id: I28e07b238d5bc913ea2f3dfa09fa02f577d5a250
(cherry picked from commit d995c0186e)
Test: verify that build has no failures
Change-Id: Ib249b276c6295e55eb54fa37b6d15486415dfbed
Merged-In: Ib249b276c6295e55eb54fa37b6d15486415dfbed
(cherry picked from commit 5f5ee1110d)
CameraModule is already part of the HIDL wrapper and
is no longer needed in the service code.
Add extra logic in camera provder manager for identifying
camera API1 compatible devices.
Bug: 34392075
Test: Complete Camera CTS
Change-Id: I64a49e9091557c88859872d0c599c5be378db8b5
This CL allows IOmx to attempt registration even when IOmxStore fails to
register.
Test: Manual use of Camera
Bug: 37657124
Bug: 37726880
Change-Id: I108c507326ee55c17acc524233e70afa5cb5a4f0
This syscall is used by the linker to detect files located on tmpfs
Bug: http://b/37245203
Bug: http://b/37590327
Test: boot an angler and check that mediacodec does not crash
Change-Id: I7147063db7d6b8ec39a25d39b60e8e6882addf6e
(cherry picked from commit 1516b02c1a)
RAW boost value will be inserted by HIDL wrapper. The logic
needs to move there.
Bug: 34392075
Test: runtest -x
cts/tests/camera/src/android/hardware/camera2/cts/DngCreatorTest.java
Change-Id: I7d4321d728eba11b5ec1345536bb669d70f3cffc
Camera device related code should be agnostic w.r.t.
device version as much as possible. Specifically the
following requirements must hold true:
- Since support for devices 3.0&3.1 is deprecated
"ANDROID_QUIRKS_USE_PARTIAL_RESULT" is no longer considered.
- "ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS" is always
used instead of the deprecated "ANDROID_SCALER_AVAILABLE_JPEG_SIZES".
- Buffer manager for camera streams is used for dynamic buffer
allocation.
- "flush" is always used instead of waiting for buffers to drain.
- Similar to "flush" stream "tearDown" is always available.
- Dead code handling buffer registration is removed.
Bug: 34392075
Test: Manual using camera application
Change-Id: If1b215f785ba61c6991fdf163d4eb18733690471
Move various things around so mediadrmserver doesn't need
libstagefright and libmedia
Test: build/boot
Change-Id: I48b713cd679b992cb6ad1262c20394a9892d7027
Merged-In: I48b713cd679b992cb6ad1262c20394a9892d7027
(cherry picked from commit 75571e4bc7)
This syscall is used by the linker to detect files located on tmpfs
Bug: http://b/37245203
Bug: http://b/37590327
Test: boot an angler and check that mediacodec does not crash
Change-Id: I7147063db7d6b8ec39a25d39b60e8e6882addf6e
First try to use HW volume control and then fall back
to volume control in AAudio service.
Bug: 37518243
Test: play a sound and check AAudio volume callback is called
when pressing volume keys.
Change-Id: Ie18be9f553ae23c247974d8923e7dcddeb1047c8
Make sure we don't keep any stale available callback buffer
references after recording stops. This can lead to resource
leaks.
Bug: 36478361
Test: Complete Camera/Camera2 CTS tests
Change-Id: I9f72b784ba3ae1cf9f9b16064a13b7ba8a1d0394
Fixed some buffer miscalculations, and some NPEs in the close() code.
Added debugging and some general cleanup.
Fixed data conversion.
Fixed start/pause/flush in server.
Added reference counting in server for endpoints.
Programs can now be ran more than once.
General code cleanup.
Reconnect with service if server dies.
Move stop() logic into server for better synchronization.
Add sleep to prevent race condition when closing an MMAP stream.
Bug: 33398120
Test: two write_sine_callback.cpp can be run simultaneously
Change-Id: Ibb006215a498868c222228d675ff961d7e0bf514
Signed-off-by: Phil Burk <philburk@google.com>
Fix bad casting from MmapPlaybackThread to VolumeInterface causing
volume commands to be lost by audio flinger for MMAP threads.
Bug: 37518243
Test: Verify volume is received by the audio HAL on MMAP streams
Verify no regression for other stream types.
Change-Id: I584ae868245358b2edefecc46a5249092f8be229
Bufer handle hashing and comparison currently uses the buffer
'Int' section along with the Fd section. However the values there
can dynamically change after the buffer gets allocated which will
introduce side-effects in the buffer id map.
Bug: 37257356
Test: Complete Camera/Camera2 CTS
Change-Id: I2cf09ced69f155285dae67b3a2502e6b87f7d9cc
Non-treble process can no longer load .so from /vendor/lib.
Move the clear key plugin to /system/lib until MediaCas is converted
to treble.
bug: 37476803
Change-Id: I563b4576aeada5470355e7e168fa2c73997004d7
Allow shifted metadata when the buffer is allocated by
hwbinder (which might allocate buffers to 4 bytes boundary
on 32-bits CPU)
Test: compile, GCA working
Bug: 37095012
Change-Id: I404b73ac3b460f5ff03cb64001c24f7a05b91396
There could be race in application where finalizeOutputconfigurations
doesn't include any new surface. Do not fail in this case.
Test: CameraStressTest#testBackCameraSwitchPreview
Bug: 36811459
Bug: 35137641
Change-Id: Ic185e6d8bfcb8af5b81a33fbbd2fd4e49cc647ce
If the minimum duration of JPEG is less than the frame duration derived
from maximum fps, enable slowJpeg mode so that JPEG doesn't slow down
preview.
Cap the default max fps to 30 so that the switch between different
sensor modes can be minimized while still allowing the app to go higher
than 30fps.
Test: Camera1 CTS
Bug: 36692074
Change-Id: If4d367ac587c0f4d3620ca2d25063c5a12ebfceb
This CL provides additional sandboxing to ensure that the ban on using
/dev/binder to communicate between system and vendor is enforced (even
if SE policy might otherwise permit it.) This is done only on
full-Treble devices.
b/36604251 OMX HAL (aka mediacodec) uses Binder and even exposes a
Binder service
Test: marlin
Change-Id: I344f5eb9d8719beec02207be65caca78336afff5
Signed-off-by: Iliyan Malchev <malchev@google.com>
"default" implies using "primary" legacy device module.
This doesn't change anything for binderized mode, because
the server was only registering itself as "sound_trigger.primary",
so it was the only possibility anyways.
Usage of "stub" (debugging) module is still possible
if audioflinger and corresponding services are built with
USE_LEGACY_LOCAL_AUDIO_HAL=true (added makefile check to ensure
that).
Test: "Ok Google" from screen off state on sailfish
Bug: 36570720
Change-Id: Ibef7fb312ce593d71255cfac71ba4e8f1dd28666
Fix logic for global music effects (e.g Visualizer) attachement to
output streams.
- Consider only outputs with active music sessions first and then all
outputs
- Reevaluate effect attachment systematically on music playback start/stop
and when outputs are opened/closed
- Use the same logic every where.
Bug: 33397379
Test: CTS: AudioEffectTest, VisualizerTest, EqualizerTest, BassBoostTest
Manual test with music playback with and without Effects in
offload and non offload mode on speaker, headset, BT A2DP.
Change-Id: Iabc23bc8a24f36b68942b7f32749c535781497b4
As requested by native API council.
Bug: 30210002
Bug: 33398120
Test: CTS test_aaudio
Change-Id: I5ea7c53d09469221263d84cf6f82082e67c2523b
Signed-off-by: Phil Burk <philburk@google.com>
Disable concurrent capture until the corresponding UI is available.
Restore preemption for HOTWORD audio source.
Bug:36891272
Test: capture regression tests, run CTS AudioRecordTest, run GTS SearchHostTest
Change-Id: I1b6c32c2a76ae0e004e14e46fedd596a8844c0d4
Call the MmapStreamInterface from AudioFlinger instead of the FakeHAL.
Fix sending timestamps from the thread.
Add shared mode in service.
Bug: 35260844
Bug: 33398120
Test: CTS test_aaudio.cpp
Change-Id: I44c7e4ecae4ce205611b6b73a72e0ae8a5b243e5
Signed-off-by: Phil Burk <philburk@google.com>
(cherry picked from commit 7f6b40d78b)
Do not trigger the callback for recording events when the patch
handle is NONE, the patch handle will be updated for the
recording session later.
When stopping recording, only stop the record thread if the
track is not active, not if it's not the first one.
Test: cts-tradefed run cts-dev -m CtsMediaTestCases -t android.media.cts.AudioRecordingConfigurationTest
Bug: 36569938
Change-Id: I1b7445ef4115d6337ba7b926f7e6b068361926a7
Appending to a source with valid vendor id from a metadata without
vendor id should be supported.
Bug: 37198452
Test: CameraProviderManagerTest.MultipleVendorTagTest
Change-Id: Ic0b160216386fcfe1aa57b7e4a363b405459b3d0
Bug: 36481537
Test: logcat does not show "Waiting for service media.log"
Change-Id: Ia69b679d3b1f1dd292237c63855ff650566df133
(cherry picked from commit 04b96fc3a6)
-- Update pre-compiled xml files due to a misalignment with
EDD files from previous bug fixes.
-- Add support for AUDIO_USAGE_ASSISTANT in engineconfigurable.
-- Fix UsbDevice select for strategy accessibility.
Volume cannot be changed when play music via UsbHeadset.
Strategy accessibility selects Speaker instead of UsbHeadset
This corrects the device selected by accessibility strategy.
-- Fix Sonification respectful with A2DP devices issue. No
notification sound is heard on BT A2DP devices. This
corrects the applicable list of audio output devices in
case of Sonification Respectful strategy.
Bug: 37157254
Test: built angler with CAP enabled
Change-Id: Ie6b401d28d3211846bb2b5345509d80f31440708
Signed-off-by: David Brageul <david.brageul@intel.com>
Signed-off-by: Mohamed LAHMADI <mohamedx.lahmadi@intel.com>
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 1bfe09a0b1)
Changes for the new HAL structure have brought about a build time
circular dependency between libmedia and libmediadrm. This set of
changes the media metrics code into its own library and arranges
for the relevant consumers of the media metrics code to link
to this new library (where they had previously picked it up by
including libmedia).
Bug: 36990807
Test: build, boot.
Change-Id: I81768eecca88d5e59e6e6e547f29308a94e30c7b
Different vendors could have different vendor tags.
A global vendor tag cache will store all available
vendor tag descriptors from different providers.
The cache will then be shared with each camera client.
Camera metadata will use specific vendor ids stored
in the metadata buffer to identify the correct vendor
tag provider.
Bug: 34275821
Test: adb shell /data/nativetest/cameraservice_test/cameraservice_test
--gtest_filter=CameraProviderManagerTest.MultipleVendorTagTest
Complete Camera/Camera2 CTS tests
Change-Id: I2262128f21a0167504f018230624e2a89786c467
Mark immediate zoom as not supported in case the camera has
maximum digial zoom close to 1. This will avoid corner
cases wehere we can have 'NUM_ZOOM_STEPS' all equal to 1.
Bug: 33093106
Test: Complete CameraTest CTS package
runtest -x cts/tests/camera/src/android/hardware/cts/
Change-Id: I039276385de74192375f36b1504dd89cb8ae0c52
AE/AWB lock availability is present in the camera static metadata.
Check whether they are supported before advertising them in Camera
Parameters.
Bug: 33091727
Test: Complete CameraTest CTS
runtest -x cts/tests/camera/src/android/hardware/cts/
Change-Id: I9a8cc8ffcc28b6b476904c3c011ab0ec65b162c9
To cleanup caches of obsolete buffers.
This CL addressed the input stream bit, the output
stream hook will be a followup CL.
Also cleanup some dead API in CameraDeviceBase.h
Test: fix CTS ReprocessCaptureTest
Bug: 34461678
Change-Id: I801cd81c29becaa45630ed0a5c2dab8df1278a6a
Make it possible for clients to clear the internal inflight queue
as part of error result notifications. For this to work all pending
buffers must be returned previously with the exception of the
result metadata.
Bug: 35652756
Test: Complete Camera/Camera2 CTS without any regressions.
Change-Id: I9d8a6b63364fd254311cda2f8c836b99ee05cacb
Test: Manual use of Camera, Movies, Photos and YouTube apps.
Test: With CtsMediaTestCases.apk installed,
adb shell am instrument -e size small -w
'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Bug: 34274385
Change-Id: I5251fea337f33460d1f0db174cedc465822f2a47
Otherwise some bits aren't where they're supposed to be.
Also stop using HW_CAMERA_ZSL; we need to only set HW_CAMERA_READ, and it's
confusing to set a producer flag on the consumer usage side.
Test: Camera CTS passes
Bug: 35215313
Change-Id: I23e6e60bf875fe9d8f2d7a1f805d2ef854c16b97
We are ready for devices to begin migrating to a 64-bit Media DRM
Server. However, not all devices are ready to make this jump yet. A
device needs to have all of its DRM Plugins ready to run as 64-bit
before it can do this. This includes having 64-bit hardware
integrations.
So that devices can turn on 64-bit support as they get ready, I am
adding flags that can be set in a device's device.mk file. There are two
parts:
* ENABLE_MEDIADRM_64 enables building the mediadrmserver as 64-bit.
* Setting drm.64bit.enabled=true in PRODUCT_PROPERTY_OVERRIDES switches
mediadrmserver to searching for DRM Plugins in the 64-bit directory.
Test: Validated that turning on these flags enables a 64-bit
mediadrmserver that loads 64-bit DRM Plugins from the lib64
directory (after setting DISABLE_TREBLE_DRM to true to load this
code as opposed to the Legacy DRM Plugin HAL)
Bug: 36076017
Change-Id: I141cfd57ff75b40c8b0cb40a5bf1439a1ab5b766
Remove binder call to MediaServer for reading files.
Test: Photos, Play Music, Play Movies, Youtube
Bug: 29125703
Change-Id: Id6abf592bf6d70b81158f6038b1982f0a537b9b9
Method 'indexOfKey' will return 'NAME_NOT_FOUND' error
status in case it doesn't find any values matching the
given key. Checking for anything other than this error
code could lead to instabilities.
Bug: 35925482
Test: Manual using application
Change-Id: Ie72eb29776b27a6d485f6e42ee7e62c62795ca9e
(cherry picked from commit 4219c290e5)
Add missing rules for USB headset devices in routing, volume and effects
management.
Test: playback and catpure regression tests.
Change-Id: I42cd157f483deba2371a05d332cd11dceb2b2fa3