aaudio: show format as text
Some other minor log cleanup.
Test: adb logcat | grep -i audio
Test: then open an MMAP stream with OboeTester.
Test: adb shell dumpsys media.aaudio
Change-Id: I082ffe34fb0dbf4263321a80498e8766b9213ab9
diff --git a/media/libaaudio/src/core/AudioStreamBuilder.cpp b/media/libaaudio/src/core/AudioStreamBuilder.cpp
index 2be3d65..a100aa9 100644
--- a/media/libaaudio/src/core/AudioStreamBuilder.cpp
+++ b/media/libaaudio/src/core/AudioStreamBuilder.cpp
@@ -321,9 +321,8 @@
mFramesPerDataCallback);
ALOGI("usage = %6d, contentType = %d, inputPreset = %d, allowedCapturePolicy = %d",
getUsage(), getContentType(), getInputPreset(), getAllowedCapturePolicy());
- ALOGI("privacy sensitive = %s", isPrivacySensitive() ? "true" : "false");
- ALOGI("opPackageName = %s", !getOpPackageName().has_value() ?
- "(null)" : getOpPackageName().value().c_str());
- ALOGI("attributionTag = %s", !getAttributionTag().has_value() ?
- "(null)" : getAttributionTag().value().c_str());
+ ALOGI("privacy sensitive = %s, opPackageName = %s, attributionTag = %s",
+ isPrivacySensitive() ? "true" : "false",
+ !getOpPackageName().has_value() ? "(null)" : getOpPackageName().value().c_str(),
+ !getAttributionTag().has_value() ? "(null)" : getAttributionTag().value().c_str());
}
diff --git a/services/oboeservice/AAudioServiceEndpoint.cpp b/services/oboeservice/AAudioServiceEndpoint.cpp
index 390cd5c..b55b601 100644
--- a/services/oboeservice/AAudioServiceEndpoint.cpp
+++ b/services/oboeservice/AAudioServiceEndpoint.cpp
@@ -60,7 +60,8 @@
result << " Sample Rate: " << getSampleRate() << "\n";
result << " Channel Count: " << getSamplesPerFrame() << "\n";
result << " Channel Mask: 0x" << std::hex << getChannelMask() << std::dec << "\n";
- result << " Format: " << getFormat() << "\n";
+ result << " Format: " << getFormat()
+ << " (" << audio_format_to_string(getFormat()) << ")\n";
result << " Frames Per Burst: " << mFramesPerBurst << "\n";
result << " Usage: " << getUsage() << "\n";
result << " ContentType: " << getContentType() << "\n";
diff --git a/services/oboeservice/AAudioServiceEndpointMMAP.cpp b/services/oboeservice/AAudioServiceEndpointMMAP.cpp
index a266d5b..2a53ef3 100644
--- a/services/oboeservice/AAudioServiceEndpointMMAP.cpp
+++ b/services/oboeservice/AAudioServiceEndpointMMAP.cpp
@@ -183,7 +183,9 @@
? AAUDIO_SESSION_ID_NONE
: (aaudio_session_id_t) sessionId;
setSessionId(actualSessionId);
- ALOGD("%s() deviceId = %d, sessionId = %d", __func__, getDeviceId(), getSessionId());
+
+ ALOGD("%s(format = 0x%X) deviceId = %d, sessionId = %d",
+ __func__, audioFormat, getDeviceId(), getSessionId());
// Create MMAP/NOIRQ buffer.
if (createMmapBuffer(&mAudioDataFileDescriptor) != AAUDIO_OK) {
@@ -206,12 +208,13 @@
mTimestampGracePeriodMs = ((int64_t) kTimestampGraceBurstCount * mFramesPerBurst
* AAUDIO_MILLIS_PER_SECOND) / getSampleRate();
- ALOGD("%s() actual rate = %d, channels = %d channelMask = %#x, deviceId = %d, capacity = %d\n",
+ ALOGD("%s() got rate = %d, channels = %d channelMask = %#x, deviceId = %d, capacity = %d\n",
__func__, getSampleRate(), getSamplesPerFrame(), getChannelMask(),
deviceId, getBufferCapacity());
- ALOGD("%s() format = 0x%08x, frame size = %d, burst size = %d",
- __func__, getFormat(), calculateBytesPerFrame(), mFramesPerBurst);
+ ALOGD("%s() got format = 0x%X = %s, frame size = %d, burst size = %d",
+ __func__, getFormat(), audio_format_to_string(getFormat()),
+ calculateBytesPerFrame(), mFramesPerBurst);
return result;