Reduce blocking time when streaming audio data 50/284950/3
authorJi-hoon Lee <dalton.lee@samsung.com>
Wed, 30 Nov 2022 09:05:43 +0000 (18:05 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Thu, 1 Dec 2022 11:53:41 +0000 (20:53 +0900)
commitb024d6c4d2e9742a3bb2dbe31833dffa1cc7efe3
treeee257ef221d144353947d63fb08003676e9727d0
parent28fe4a4d91258f8a4f1f1a7db87a657f947e1be2
Reduce blocking time when streaming audio data

When the CPU is busy handling many tasks, there are times
that the streaming thread gets blocked while calling some
undelying platform API functions. To avoid this problem,
applied several methods for reducing the blocking time
and added log messages for displaying time information.

List of methods used for reducing the blocking time:
1. Cache appid / pid information that is acquired by
   calling AUL API functions, since they sometimes
   do not return immediately and take a while to complete.
2. Instead of passing a pointer to the shared audio data
   into the message transmission module while holding the
   lock to protect the shared audio data, make a copy of
   audio data and release the lock immediately so that
   the copy of audio data can be used without the risk of
   race condition. This is because sometimes the message
   transmission also takes a bit of time to complete, and
   the other threads waiting for the lock cannot proceed
   in such cases.

Change-Id: I6c6959fadddbc557dbb77849fa25ce4949155f4b
inc/service_common.h
plugins/wakeup-manager/src/wakeup_audio_manager.cpp
src/application_manager_aul.cpp
src/service_ipc_dbus.cpp
src/service_plugin.cpp