audio: reduce logspam from MMAP mode
Bug: 63760826
Test: run CTS nativemedia/aaudio and notice less logging
Change-Id: I04564963f85577a53f40f1bad064f5e79723ac76
diff --git a/media/libaaudio/src/binding/AAudioBinderClient.cpp b/media/libaaudio/src/binding/AAudioBinderClient.cpp
index 6464334..a268e49 100644
--- a/media/libaaudio/src/binding/AAudioBinderClient.cpp
+++ b/media/libaaudio/src/binding/AAudioBinderClient.cpp
@@ -57,7 +57,7 @@
, Singleton<AAudioBinderClient>() {
mAAudioClient = new AAudioClient(this);
- ALOGD("AAudioBinderClient() created mAAudioClient = %p", mAAudioClient.get());
+ ALOGV("AAudioBinderClient() created mAAudioClient = %p", mAAudioClient.get());
}
AAudioBinderClient::~AAudioBinderClient() {
@@ -90,8 +90,11 @@
if (binder != 0) {
// Ask for notification if the service dies.
status_t status = binder->linkToDeath(mAAudioClient);
- ALOGD("getAAudioService: linkToDeath(mAAudioClient = %p) returned %d",
- mAAudioClient.get(), status);
+ // TODO review what we should do if this fails
+ if (status != NO_ERROR) {
+ ALOGE("getAAudioService: linkToDeath(mAAudioClient = %p) returned %d",
+ mAAudioClient.get(), status);
+ }
mAAudioService = interface_cast<IAAudioService>(binder);
needToRegister = true;
// Make sure callbacks can be received by mAAudioClient
diff --git a/services/oboeservice/AAudioClientTracker.cpp b/services/oboeservice/AAudioClientTracker.cpp
index c0bea13..75392bd 100644
--- a/services/oboeservice/AAudioClientTracker.cpp
+++ b/services/oboeservice/AAudioClientTracker.cpp
@@ -64,7 +64,7 @@
// Create a tracker for the client.
aaudio_result_t AAudioClientTracker::registerClient(pid_t pid,
const sp<IAAudioClient>& client) {
- ALOGD("AAudioClientTracker::registerClient(), calling pid = %d, getpid() = %d\n",
+ ALOGV("AAudioClientTracker::registerClient(), calling pid = %d, getpid() = %d\n",
pid, getpid());
std::lock_guard<std::mutex> lock(mLock);
@@ -84,7 +84,7 @@
}
void AAudioClientTracker::unregisterClient(pid_t pid) {
- ALOGD("AAudioClientTracker::unregisterClient(), calling pid = %d, getpid() = %d\n",
+ ALOGV("AAudioClientTracker::unregisterClient(), calling pid = %d, getpid() = %d\n",
pid, getpid());
std::lock_guard<std::mutex> lock(mLock);
mNotificationClients.erase(pid);
@@ -103,12 +103,12 @@
aaudio_result_t
AAudioClientTracker::registerClientStream(pid_t pid, sp<AAudioServiceStreamBase> serviceStream) {
aaudio_result_t result = AAUDIO_OK;
- ALOGD("AAudioClientTracker::registerClientStream(%d, %p)\n", pid, serviceStream.get());
+ ALOGV("AAudioClientTracker::registerClientStream(%d, %p)\n", pid, serviceStream.get());
std::lock_guard<std::mutex> lock(mLock);
sp<NotificationClient> notificationClient = mNotificationClients[pid];
if (notificationClient == 0) {
// This will get called the first time the audio server registers an internal stream.
- ALOGD("AAudioClientTracker::registerClientStream(%d,) unrecognized pid\n", pid);
+ ALOGV("AAudioClientTracker::registerClientStream(%d,) unrecognized pid\n", pid);
notificationClient = new NotificationClient(pid);
mNotificationClients[pid] = notificationClient;
}
@@ -120,11 +120,11 @@
aaudio_result_t
AAudioClientTracker::unregisterClientStream(pid_t pid,
sp<AAudioServiceStreamBase> serviceStream) {
- ALOGD("AAudioClientTracker::unregisterClientStream(%d, %p)\n", pid, serviceStream.get());
+ ALOGV("AAudioClientTracker::unregisterClientStream(%d, %p)\n", pid, serviceStream.get());
std::lock_guard<std::mutex> lock(mLock);
auto it = mNotificationClients.find(pid);
if (it != mNotificationClients.end()) {
- ALOGD("AAudioClientTracker::unregisterClientStream(%d, %p) found NotificationClient\n",
+ ALOGV("AAudioClientTracker::unregisterClientStream(%d, %p) found NotificationClient\n",
pid, serviceStream.get());
it->second->unregisterClientStream(serviceStream);
} else {
@@ -158,11 +158,7 @@
aaudio_result_t AAudioClientTracker::NotificationClient::unregisterClientStream(
sp<AAudioServiceStreamBase> serviceStream) {
std::lock_guard<std::mutex> lock(mLock);
- ALOGD("AAudioClientTracker::NotificationClient() before erase() count = %d\n",
- (int)mStreams.size());
mStreams.erase(serviceStream);
- ALOGD("AAudioClientTracker::NotificationClient() after erase() count = %d\n",
- (int)mStreams.size());
return AAUDIO_OK;
}
@@ -176,8 +172,6 @@
{
std::lock_guard<std::mutex> lock(mLock);
- ALOGV("AAudioClientTracker::binderDied() pid = %d, # streams = %d\n",
- mProcessId, (int) mStreams.size());
for (auto serviceStream : mStreams) {
streamsToClose.insert(serviceStream);
}
diff --git a/services/oboeservice/AAudioServiceEndpointPlay.cpp b/services/oboeservice/AAudioServiceEndpointPlay.cpp
index 86ccde0..e609ab5 100644
--- a/services/oboeservice/AAudioServiceEndpointPlay.cpp
+++ b/services/oboeservice/AAudioServiceEndpointPlay.cpp
@@ -57,7 +57,6 @@
mLatencyTuningEnabled = true;
burstsPerBuffer = BURSTS_PER_BUFFER_DEFAULT;
}
- ALOGD("AAudioServiceEndpoint(): burstsPerBuffer = %d", burstsPerBuffer);
int32_t desiredBufferSize = burstsPerBuffer * getStreamInternal()->getFramesPerBurst();
getStreamInternal()->setBufferSize(desiredBufferSize);
}
@@ -66,7 +65,6 @@
// Mix data from each application stream and write result to the shared MMAP stream.
void *AAudioServiceEndpointPlay::callbackLoop() {
- ALOGD("AAudioServiceEndpointPlay(): callbackLoop() entering");
int32_t underflowCount = 0;
aaudio_result_t result = AAUDIO_OK;
int64_t timeoutNanos = getStreamInternal()->calculateReasonableTimeout();
@@ -102,6 +100,8 @@
}
}
- ALOGD("AAudioServiceEndpointPlay(): callbackLoop() exiting, %d underflows", underflowCount);
+ ALOGW_IF((underflowCount > 0),
+ "AAudioServiceEndpointPlay(): callbackLoop() had %d underflows", underflowCount);
+
return NULL; // TODO review
}
diff --git a/services/oboeservice/AAudioServiceStreamMMAP.cpp b/services/oboeservice/AAudioServiceStreamMMAP.cpp
index 68be3c3..b139119 100644
--- a/services/oboeservice/AAudioServiceStreamMMAP.cpp
+++ b/services/oboeservice/AAudioServiceStreamMMAP.cpp
@@ -154,9 +154,9 @@
status);
return AAUDIO_ERROR_UNAVAILABLE;
} else {
- ALOGD("createMmapBuffer status %d shared_address = %p buffer_size %d burst_size %d"
- "Sharable FD: %s",
- status, mMmapBufferinfo.shared_memory_address,
+ ALOGD("createMmapBuffer status %d, buffer_size, %d burst_size %d"
+ ", Sharable FD: %s",
+ status,
abs(mMmapBufferinfo.buffer_size_frames),
mMmapBufferinfo.burst_size_frames,
mMmapBufferinfo.buffer_size_frames < 0 ? "Yes" : "No");