Loading media/libaaudio/src/binding/AAudioBinderClient.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ AAudioBinderClient::AAudioBinderClient() , Singleton<AAudioBinderClient>() { mAAudioClient = new AAudioClient(this); ALOGD("AAudioBinderClient() created mAAudioClient = %p", mAAudioClient.get()); ALOGV("AAudioBinderClient() created mAAudioClient = %p", mAAudioClient.get()); } AAudioBinderClient::~AAudioBinderClient() { Loading Loading @@ -90,8 +90,11 @@ const sp<IAAudioService> AAudioBinderClient::getAAudioService() { if (binder != 0) { // Ask for notification if the service dies. status_t status = binder->linkToDeath(mAAudioClient); ALOGD("getAAudioService: linkToDeath(mAAudioClient = %p) returned %d", // 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 Loading services/oboeservice/AAudioClientTracker.cpp +6 −12 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ std::string AAudioClientTracker::dump() const { // 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); Loading @@ -84,7 +84,7 @@ aaudio_result_t AAudioClientTracker::registerClient(pid_t pid, } 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); Loading @@ -103,12 +103,12 @@ int32_t AAudioClientTracker::getStreamCount(pid_t pid) { 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; } Loading @@ -120,11 +120,11 @@ AAudioClientTracker::registerClientStream(pid_t pid, sp<AAudioServiceStreamBase> 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 { Loading Loading @@ -158,11 +158,7 @@ aaudio_result_t AAudioClientTracker::NotificationClient::registerClientStream( 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; } Loading @@ -176,8 +172,6 @@ void AAudioClientTracker::NotificationClient::binderDied(const wp<IBinder>& who { 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); } Loading services/oboeservice/AAudioServiceEndpointPlay.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -57,7 +57,6 @@ aaudio_result_t AAudioServiceEndpointPlay::open(const AAudioStreamConfiguration& mLatencyTuningEnabled = true; burstsPerBuffer = BURSTS_PER_BUFFER_DEFAULT; } ALOGD("AAudioServiceEndpoint(): burstsPerBuffer = %d", burstsPerBuffer); int32_t desiredBufferSize = burstsPerBuffer * getStreamInternal()->getFramesPerBurst(); getStreamInternal()->setBufferSize(desiredBufferSize); } Loading @@ -66,7 +65,6 @@ aaudio_result_t AAudioServiceEndpointPlay::open(const AAudioStreamConfiguration& // 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(); Loading Loading @@ -102,6 +100,8 @@ void *AAudioServiceEndpointPlay::callbackLoop() { } } ALOGD("AAudioServiceEndpointPlay(): callbackLoop() exiting, %d underflows", underflowCount); ALOGW_IF((underflowCount > 0), "AAudioServiceEndpointPlay(): callbackLoop() had %d underflows", underflowCount); return NULL; // TODO review } services/oboeservice/AAudioServiceStreamMMAP.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -154,9 +154,9 @@ aaudio_result_t AAudioServiceStreamMMAP::open(const aaudio::AAudioStreamRequest 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"); Loading Loading
media/libaaudio/src/binding/AAudioBinderClient.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ AAudioBinderClient::AAudioBinderClient() , Singleton<AAudioBinderClient>() { mAAudioClient = new AAudioClient(this); ALOGD("AAudioBinderClient() created mAAudioClient = %p", mAAudioClient.get()); ALOGV("AAudioBinderClient() created mAAudioClient = %p", mAAudioClient.get()); } AAudioBinderClient::~AAudioBinderClient() { Loading Loading @@ -90,8 +90,11 @@ const sp<IAAudioService> AAudioBinderClient::getAAudioService() { if (binder != 0) { // Ask for notification if the service dies. status_t status = binder->linkToDeath(mAAudioClient); ALOGD("getAAudioService: linkToDeath(mAAudioClient = %p) returned %d", // 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 Loading
services/oboeservice/AAudioClientTracker.cpp +6 −12 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ std::string AAudioClientTracker::dump() const { // 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); Loading @@ -84,7 +84,7 @@ aaudio_result_t AAudioClientTracker::registerClient(pid_t pid, } 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); Loading @@ -103,12 +103,12 @@ int32_t AAudioClientTracker::getStreamCount(pid_t pid) { 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; } Loading @@ -120,11 +120,11 @@ AAudioClientTracker::registerClientStream(pid_t pid, sp<AAudioServiceStreamBase> 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 { Loading Loading @@ -158,11 +158,7 @@ aaudio_result_t AAudioClientTracker::NotificationClient::registerClientStream( 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; } Loading @@ -176,8 +172,6 @@ void AAudioClientTracker::NotificationClient::binderDied(const wp<IBinder>& who { 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); } Loading
services/oboeservice/AAudioServiceEndpointPlay.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -57,7 +57,6 @@ aaudio_result_t AAudioServiceEndpointPlay::open(const AAudioStreamConfiguration& mLatencyTuningEnabled = true; burstsPerBuffer = BURSTS_PER_BUFFER_DEFAULT; } ALOGD("AAudioServiceEndpoint(): burstsPerBuffer = %d", burstsPerBuffer); int32_t desiredBufferSize = burstsPerBuffer * getStreamInternal()->getFramesPerBurst(); getStreamInternal()->setBufferSize(desiredBufferSize); } Loading @@ -66,7 +65,6 @@ aaudio_result_t AAudioServiceEndpointPlay::open(const AAudioStreamConfiguration& // 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(); Loading Loading @@ -102,6 +100,8 @@ void *AAudioServiceEndpointPlay::callbackLoop() { } } ALOGD("AAudioServiceEndpointPlay(): callbackLoop() exiting, %d underflows", underflowCount); ALOGW_IF((underflowCount > 0), "AAudioServiceEndpointPlay(): callbackLoop() had %d underflows", underflowCount); return NULL; // TODO review }
services/oboeservice/AAudioServiceStreamMMAP.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -154,9 +154,9 @@ aaudio_result_t AAudioServiceStreamMMAP::open(const aaudio::AAudioStreamRequest 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"); Loading