For easy transition from SchedTune to UtilClamp, direct access to these
cgroups should be abstracted by using task profiles. Replace writepid
commands with new task_profiles command.
Bug: 155419956
Test: change .rc file and confirm task profile is applied
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Id00370b25af973a4b3813a4a1d6ccbd1e555c87f
Merged-In: Id00370b25af973a4b3813a4a1d6ccbd1e555c87f
Some system services (e.g. SoundTriggerMiddleware) assume that
whenever they start, the audio HAL is in its default (reset) state.
init.rc scripts tie the lifetimes of the audio HAL and system
processes, but when using stop/start this is not the case, and this
may cause spurious crashes in this case.
stop/start is apparently being relied on in some test infrastructure,
so this change is needed to avoid causing problems for those systems
or false detection of problems, which are not actually present in
production.
Bug: 154029444
Test: Manually verify that the audio HAL is stopped on
'adb shell stop', restarted on 'adb shell start' and that the
system boots correctly after.
Change-Id: Icb6eeddfa48b1a49a4d48baae41f9086eb83a9ca
Use media utility function limitProcessMemory().
Test: restrict mediametrics memory by property, ensure restart
Bug: 152084875
Change-Id: I20b51cecd67e9ac5e03ab34c1c68b1cfd0b8a964
This change:
- Removes the old ISoundTriggerHw service and removes its code.
- Connects AudioPolicyManager to the new service via AIDL RPC (using
a new utility, BinderProxy).
Change-Id: I00366e2c5f252708e903b2311816d9eceb132a05
Bug: 142070343
Test: push V6 to device and check audio works fine
Kill the audioserver and check that the HAL restarts
Bug: 134940862
Change-Id: I3347ee3aabe753d34c69dacbd707c60105d80a47
Signed-off-by: Kevin Rocard <krocard@google.com>
Since these were combined into libhidlbase.
Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: I6cc85a91afb603e31b85090917f9f3b59d82a4d1
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
Split AudioMixer into the base part which doesn't rely on
the framework and can be used in vendor code and the derived part
which is intended to be used by Audioflinger.
Test: A/B compare output from test scripts, manual testing on the phone
Change-Id: I24c390f67f20baa8109902099359ca6e34eebcfd
libhidltransport symbols are being moved into libhidlbase in order to
optimize linking/memory usage. libhidltransport will no longer be
required in the future (however removing references to it will come
separately).
Bug: 134961554
Test: boot
Change-Id: Ie8b9b03a53ae1f5672ce2565550768b4bcd321ee
audioserver should not link directly the code generated from
IAudioRecord.aidl because it also gets it as a result of
depending on libmedia.so and other libraries.
Linking IAudioRecord.o directly causes violation of ODR
because it contains global data.
Bug: 117507477
Test: make
Change-Id: If165768e9097d1c95980883f1fe6e1aacae97506
Merged-In: If165768e9097d1c95980883f1fe6e1aacae97506
The audioserver process is specifically prohibited from accessing the network.
See
7ca6fc8629/private/audioserver.te (91)
line 91
# Media processing code is inherently risky and thus should have limited
# permissions and be isolated from the rest of the system and network.
# Lengthier explanation here:
# https://android-developers.googleblog.com/2016/05/hardening-media-stack.html
neverallow audioserver domain:{ tcp_socket udp_socket rawip_socket } *;
Since SELinux doesn't allow audioserver to access tcp/udp sockets, it
doesn't make any sense to have audioserver be in the inet group.
Discovered while reviewing
https://android-review.googlesource.com/c/platform/frameworks/base/+/968497
Similarly, I suspect other groups listed here are also unnecessary and
can be cleaned up in a future commit.
Test: compiles and boots
Change-Id: Ic331f301565aee911de30322dd4c3811529597ee
Query the package manager to check if the app has not opt-out of its
playback being captured.
Test: adb shell audiorecorder --target /data/file1.raw &
adb shell am start -a android.intent.action.VIEW -d file:///system/media/audio/ringtones/Lollipop.ogg -t audio/ogg
adb dumpsys media.audio_policy # check playback is not recorded
# change media player manifest to allowPlaybackCapture=true
adb dumpsys media.audio_policy # check playback is recorded
kill %1
adb pull /data/file1.raw && sox -r 48000 -e signed -b 16 -c 2 file1.raw file.wav&& audacity file.wav
# check silence then sound
Bug: 111453086
Change-Id: Id6fb7d0e10c02b0473bcbc0786e8360536996f48
Signed-off-by: Kevin Rocard <krocard@google.com>
The haptic playback should be controlled by vibrator service. Via the
interface, audio server could notify vibrator service about starting or
stopping haptic playback and get vibrator intensity from vibrator
service. Vibrator service could call mute/unmute to control the haptic
playback.
Test: Manually
Change-Id: Iad24813977e4dea0d67a91f8f8b390a016ce4ca2
SEPolicy rule prevents the audioserver to use tcp / udp sockets.
The Parameter-framework has been updated to use unix socket.
This patch makes use of the unix socket and adds the corresponding
sepolicy rules.
Test: make
Change-Id: I61fcf6fec06a78cf3189c93a86469070ef15bba4
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
audioserver should not link directly the code generated from
IAudioRecord.aidl because it also gets it as a result of
depending on libmedia.so and other libraries.
Linking IAudioRecord.o directly causes violation of ODR
because it contains global data.
Bug: 117507477
Test: make
Change-Id: If165768e9097d1c95980883f1fe6e1aacae97506
The more recent work that this was supposed to become is reflected in
dumpsys media.log, so this commit removes some code clutter that is not
used anymore.
Other Changes:
- Use std::make_unique for creating unique_ptr objects
Test: build, dumpsys media.audio_flinger
Bug: 68148948
Change-Id: I4841e118c2cdee4ada4c6cdc0fff1ec2e12b38c4
NBLog.cpp was deleted and split up into Entry.cpp, Merger.cpp,
Reader.cpp, Timeline.cpp, and Writer.cpp. NBLog.h was split up into
Entry.h, Events.h, Merger.h, Reader.h, Timeline.h, and Writer.h. NBLog.h
now includes all of these new headers except Merger.h, which is managed
exclusively by MediaLogService.
Other changes:
- changed NBLog from a class to a namespace
- changed NBLog::thread_info_t.type to enum and replaced magic numbers
- fixed some fragile build dependencies in libaudioclient and medialog
No other changes were made, and all functionalities that existed prior
to this commit remain the same.
Test: build, dumpsys media.log
Bug: 68148948
Change-Id: I1ce6dcb7b30d004f90584edfad7103a89f7bab0c
This allows instantiating the MSD device if the HAL is present.
The directive in the .rc about restarting "vendor.audio-hal-4-0-msd"
service is ignored when the service is not present.
The current policy for handling HAL service restarts is to
terminate the audio service. It is possible to do better,
e.g. only re-open the devices of the crashed HAL when possible,
without affecting devices from other HALs. Will try to implement
that later.
Remove the MSD-related code from the V2.0 shim, as MSD isn't
supported on HAL V2.0.
Bug: 63901775
Test: manual on a MSD HAL prototype, also on taimen with no MSD HAL
Change-Id: I7f9de692d6e7b8ff52cdbcaba1074692c5f1c90e
Impose restrictions to limit effect of excessive memory
allocation.
adb shell setprop audio.maxmem SOME_VALUE_GREATER_THAN_60MB_IN_BYTES
adb shell pkill audioserver
and see what happens when AudioTracks / AudioRecords are created
Test: as above
Bug: 69927864
Change-Id: I0a6a90db3321f066a25fb2fcd01e9f834d199979
Use 4 threads instead of default 1, since audioserver
serves many clients.
Bug: 67203473
Test: audio still works
Change-Id: I7b191974f1a912fd8adf0096c3a1abf33a3d12fa
Another CL in OC-DEV may have turned it off.
This was added to resolve merge conflicts and to
only enable AAudioService when supported by the vendor.
Bug: 65280854
Bug: 65262790
Test: Enter adb shell setprop aaudio.mmap_policy 1
Test: Enter adb shell killall audioserver
Test: Enter adb shell dumpsys media.aaudio
Test: It should print "Can't find service: media.aaudio".
Test: Enter adb shell setprop aaudio.mmap_policy 2
Test: Enter adb shell killall audioserver
Test: Enter adb shell dumpsys media.aaudio
Test: It should print a short dump because the service is running.
Change-Id: Ic68d136c99c16134aa704495311ab25285fd76a9
We have seen sometimes SystemServer's StartAudioService wait for native
audio policy service.
This CL will move audioserver to be started on "boot" trigger of init.rc
where class 'hal' is started and data/ access are also ready, so it will
give audioserver more time to initialize to avoid service backoff.
Bug: 64218899
Test: 50 reboot cycles on Taimen
Change-Id: Ic220eb74a7a0df64b531a28c7b9d6fb6d38d3699
To prevent property name collisions between properties of system and
vendor, 'vendor.' prefix must be added to a vendor HAL service name.
You can see the details in http://go/treble-sysprop-compatibility.
Test: succeeded building and tested on a walleye device
Bug: 36796459
Change-Id: I9b51b48ae553707b9f140480b9e630c7dbbfa471
Use AIDL to generate the IAudioRecord interface rather than using
a manually implemented interface.
Bug: 64223827
Test: Ran the AudioNativeTest and CtsMediaTestCases CTS tests.
Change-Id: Iade23c73253a97c358050bbd697ebe592b89a4c0
Call the MmapStreamInterface from AudioFlinger instead of the FakeHAL.
Fix sending timestamps from the thread.
Add shared mode in service.
Bug: 35260844
Test: CTS test_aaudio.cpp
Change-Id: I44c7e4ecae4ce205611b6b73a72e0ae8a5b243e5
Signed-off-by: Phil Burk <philburk@google.com>