Package name will be cached in ModuleClient when attaching a client. It
will be used when querying permission of capturing hotword.
Test: test with logging.
Bug: 74078996
Bug: 122721589
Change-Id: Icd2911f5d331d243c9eb5d58003ce5525c70c81e
The technique of bouncing lock attempts does not work well
in the case when another lock has higher priority and acquires
the lock frequently. Timed lock works better in this case
because the acquiring thread is then put in a queue and gets
the lock as soon as another thread releases it. The wait time
in the worst case (deadlock) is the same.
Bug: 118842894
Test: Run VOICE_COMMUNICATION capture + AEC effect, dump audioflinger
Change-Id: Idc4fc2b6f5faf6988979f9354dd92441af33e600
as regular recognition events
The application will differentiate between DSP and app triggered
regcognition events.
Test: manual test with STTA and NowPlaying app on p19
Bug: 119386757
Change-Id: Ia93aea9f56f8b9fcd31347169245f21724ac93c8
Use sound trigger V2_2 if available, otherwise fall back to earlier
versions.
Note: V2_1 will be removed in a subsequent cl.
Test: built android with V2_2 enabled and tested using
SoundTriggerTestApp
Bug: 70206501
Change-Id: I85b817b396b5765fea6507b8362d2f8509785557
See build/soong/README.md for more information.
Removed AUDIOSERVER_MULTILIB because it should be unnecessary -- almost
every device does not set it, and the only other value is "64" for
64-bit only devices, which will act the same as "" for libraries.
Test: cd frameworks/av; mma
Change-Id: I8f62a549bcd5ea9eaf9aa6ead48ca6748a31c873
Add a verification on actual size of the fd backing up the IMemory
recevied for sound model or recognition config.
Fix similar problem for AudioTrack shared buffer.
Bug: 78596657
Test: run POC. OK Google regression.
Change-Id: I7cb02785f8ba46c437c7fcaa5b821f4b7e3240a0
Both core and effect Hal now have one single point of entry.
This point of entry is their respective factories:
- DevicesFactoryHalInterface::create
- EffectsFactoryHalInterface::create
Each entry point looks for their respective services supported
version, starting from the highest (currently only 2.0) and
returning the subclass wrapping this version to the most recent audio.h
framework api.
Note that EffectBufferHalInterface were previously created from static
methods (mirror and allocate) which broke the single point of entry
requirement.
As a result, buffers have now to be created from the factory like the
other classes.
Note that the death handler also need to be its own library as it is
used by versioned code and is version independent.
Bug: 38184704
Test: compile
Change-Id: Iac9b1fda561bb486193d5b9e025a870f50cda530
Signed-off-by: Kevin Rocard <krocard@google.com>
Use HAL V2.1 methods if this version is deployed on the device.
Initially the middleware layer requests for HAL V2.0, but if
the interface can be cast to V2.1, then new methods are used.
Made changes to avoid C-style type coercion as it was leading
to erroneous results when using V2.1 and V2.0 data structures
simultaneously.
Bug: 68823037
Test: use "ok google" and music IQ with HAL V2.0 and V2.1
Change-Id: I34924afe3cd4fb45a75fa34888e6e5c72727dbce
During the callback event processing loop in the SoundTrigger::Module,
it used to grab the ISoundTriggerClient from the ModuleClient that it
needed to send an event to. However, this could be removed/destroyed
while the callback thread is trying to snapshot it, since there was no
common locking between the model client and the module.
By now using the ModuleClient directly in the Module's callback, the
appropriate locks can be obtained to prevent segfaults.
Test: On device with GSA/Now Playing
Change-Id: I9e3d150aa77051caab1fc009c3fc1ae8eec61a72
If an event is generated from the HAL on a separate thread, it is
possible to enter a deadlocked state. This is due to the HAL typically
holding a lock when it starts the callback, which then needed to grab
the SoundTriggerHwService's main lock. However, if there was another
call coming down from somewhere else in the framework, it typically
tries to grab the service's main lock, then enter the HAL (which also
will likely try to grab a lock).
By removing the need to grab the mServiceLock on any of the paths that
respond to events generated by the HAL, this deadlock can be avoided.
Test: Manually on device.
Change-Id: Iac5f96ea67f618ce70e7f75300165f3588613947
Do not hold Module mutex when calling into audio policy manager to
avoid cross deadlock with audio poicy service mutex: Audio policy manager
can call into sound trigger service with its mutex held in methods like
stopInput().
Regression introduced by fix for b/64340921 commit f759b8c4
Bug: 64340921
Bug: 67310830
Test: repro steps in b/67310830
Change-Id: Ie50b2e7c55fe9828a3fd8de6b31eb4a492791583
Check android.permission.RECORD_AUDIO permission in addition to
android.permission.CAPTURE_AUDIO_HOTWORD for DSP hotword operations
as those require access to device microphone.
Bug: 62265680
Test: check "OK Google" detection with and without DSP
Change-Id: Icba2520331164bcd618e91916ca701e677d419b8
* Owners are selected from top CL approvals or owners.
They will be suggested to review/approve future CLs.
* OWNERS files are recognized by the new find-owners plugin, see .md files in
https://gerrit.googlesource.com/plugins/find-owners/+/master/src/main/resources/Documentation/
Test: build/make/tools/checkowners.py -c -v OWNERS
Change-Id: I7c848855a2d7a0d7f33123ea4ef5c2d03977b495
Test: make systemimage
Change-Id: I5f83786afe3f2c65819b127b041cb74fc4c989ac
Merged-In: I5f83786afe3f2c65819b127b041cb74fc4c989ac
Signed-off-by: YOUNG HO CHA <ganadist@gmail.com>
(cherry picked from commit 2ee7aab4a3)
"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
- All the required SoundTrigger models of a module client
are not getting unloaded and removed as part of detach.
- mModels.size() is evaluated for every iteration which
gives current size of vector which results in exit of
loop without checking for all models in case elements
are removed in loop.
removeItemsAt would modify the vector indices for each
iteration and this would result in skipping access of
some models.
- Iterate from end of models to check and unload.
Bug: 35910617
Test: mmm frameworks/av/services/soundtrigger/
Author: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>
Change-Id: I72415e53d2e6f366f8ba6e6eeb0cd8323364a231
Identified by static analysis as a potential problem.
Test: mmma frameworks/av/services/soundtrigger
Change-Id: If24519faeec260c3d357b369d53d0f68689bdf8a
Hwbinder 'linkToDeath' mechanism is used to track abrupt
disappearance of server hal objects due to hal server crash.
Upon hal server crash, notifications can be sent to binder
clients if needed, then the audioserver crashes itself as the
current audio HAL design does not provide an easy way to restore
all the transient objects (devices, streams, effects) in their
pre-crash state.
Bug: 34158778
Test: In binderized mode, kill audio hal server
Change-Id: If9265711edc445984601fcb5c29d2c173a370762
Remove ENABLE_TREBLE flag usage for legacy hal fallback.
Introduce new build flag USE_LEGACY_LOCAL_AUDIO_HAL for fallback.
Bug: 32978887
Test: checked "OK Google" (from standby), Hangouts, YouTube,
Play Music, fake radio hal + test app
KI: issues when using equializer and virtualuzer in Play Music
Change-Id: I1c279e622c885f799481f1287e0660ca576fcea0
audioflinger doesn't have a proper way to re-establish all
the opened streams if HAL crashes. The only valid way of dealing
with them is to restart the audioserver.
Although broadcastradio and sountrigger have cleaner protocols
for dealing with HAL failures and can handle HAL crash and restart,
since the audio side will anyway get broken, it makes sense
to also kill the audioserver when they detect HAL crash.
Change-Id: I5f8e8c1d0981042cdd435a3ddbb6526e9f226e6b
Test: kill audio-hal process, watch dmesg and logcat
audioflinger doesn't have a proper way to re-establish all
the opened streams if HAL crashes. The only valid way of dealing
with them is to restart the audioserver.
Although broadcastradio and sountrigger have cleaner protocols
for dealing with HAL failures and can handle HAL crash and restart,
since the audio side will anyway get broken, it makes sense
to also kill the audioserver when they detect HAL crash.
Test: kill audio-hal process, watch dmesg and logcat
Change-Id: Ib2150b69c791ac49de9404de08fc6c309a3fcbd5
Currently service allows only a single client to be attached to a Module.
This limits only a single client can use sound trigger at a time.
Add changes to attach multiple clients to a given Module through ModuleClient
interface so that multiple clients can paralelly use sound trigger on a given
Module. ModuleClient class is introduced as a client interface to a Module.
Service provides a unique instance of ModuleClient to each client being attached
and adds this client to the module clients list.
Test: Manual with modified version of SoundTriggerTestApp that talks to
the module directly
Bug:32030191
Change-Id: I66912e862b8c4232a49d92c0464a9a8b876bdb26
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
Various media components were linking against dynamic libraries that weren't needed.
Test: built and booted
Change-Id: I7379506fd06d4e28e0eff0001fd073a2d3860f8e
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