diff --git a/apps/OboeTester/app/src/main/cpp/NativeAudioContext.cpp b/apps/OboeTester/app/src/main/cpp/NativeAudioContext.cpp
index ee98132..0026610 100644
--- a/apps/OboeTester/app/src/main/cpp/NativeAudioContext.cpp
+++ b/apps/OboeTester/app/src/main/cpp/NativeAudioContext.cpp
@@ -89,10 +89,8 @@
 }
 
 void ActivityContext::close(int32_t streamIndex) {
-    LOGD("ActivityContext::%s() called for stream %d ", __func__, streamIndex);
     stopBlockingIOThread();
     oboe::AudioStream *oboeStream = getStream(streamIndex);
-    LOGD("ActivityContext::%s() close stream %p ", __func__, oboeStream);
     if (oboeStream != nullptr) {
         oboeStream->close();
         LOGD("ActivityContext::%s() delete stream %d ", __func__, streamIndex);
@@ -108,7 +106,6 @@
 }
 
 oboe::Result ActivityContext::pause() {
-    LOGD("ActivityContext::%s() called", __func__);
     oboe::Result result = oboe::Result::OK;
     stopBlockingIOThread();
     for (auto entry : mOboeStreams) {
@@ -122,10 +119,7 @@
 oboe::Result ActivityContext::stopAllStreams() {
     oboe::Result result = oboe::Result::OK;
     stopBlockingIOThread();
-    LOGD("ActivityContext::stopAllStreams() called");
     for (auto entry : mOboeStreams) {
-        LOGD("ActivityContext::stopAllStreams() handle = %d, stream %p",
-             entry.first, entry.second.get());
         oboe::AudioStream *oboeStream = entry.second.get();
         result = oboeStream->requestStop();
         printScheduler();
@@ -208,8 +202,6 @@
     // Open a stream based on the builder settings.
     std::shared_ptr<oboe::AudioStream> oboeStream;
     Result result = builder.openStream(oboeStream);
-    LOGD("ActivityContext::open() builder.openStream() returned %d, oboeStream = %p",
-            result, oboeStream.get());
     AAudioExtensions::getInstance().setMMapEnabled(oldMMapEnabled);
     if (result != Result::OK) {
         freeStreamIndex(streamIndex);
@@ -235,7 +227,6 @@
 }
 
 oboe::Result ActivityContext::start() {
-    LOGD("ActivityContext: %s() called", __func__);
     oboe::Result result = oboe::Result::OK;
     oboe::AudioStream *inputStream = getInputStream();
     oboe::AudioStream *outputStream = getOutputStream();
@@ -249,7 +240,6 @@
     result = startStreams();
 
     if (!mUseCallback && result == oboe::Result::OK) {
-        LOGD("start thread for blocking I/O");
         // Instead of using the callback, start a thread that writes the stream.
         threadEnabled.store(true);
         dataThread = new std::thread(threadCallback, this);
@@ -467,7 +457,6 @@
 }
 
 oboe::Result ActivityRecording::stopPlayback() {
-    LOGD("ActivityRecording::%s() called", __func__);
     oboe::Result result = oboe::Result::OK;
     if (playbackStream != nullptr) {
         result = playbackStream->requestStop();
@@ -481,7 +470,6 @@
 
 oboe::Result ActivityRecording::startPlayback() {
     stop();
-    LOGD("ActivityRecording::%s() called, mSampleRate = %d", __func__, mSampleRate);
     oboe::AudioStreamBuilder builder;
     builder.setChannelCount(mChannelCount)
             ->setSampleRate(mSampleRate)
@@ -489,7 +477,6 @@
             ->setCallback(&mPlayRecordingCallback)
             ->setAudioApi(oboe::AudioApi::OpenSLES);
     oboe::Result result = builder.openStream(&playbackStream);
-    LOGD("ActivityRecording::%s() openStream() returned %d", __func__, result);
     if (result != oboe::Result::OK) {
         delete playbackStream;
         playbackStream = nullptr;
@@ -604,7 +591,6 @@
 
 // =================================================================== ActivityTestDisconnect
 void ActivityTestDisconnect::close(int32_t streamIndex) {
-    LOGD("ActivityTestDisconnect::%s() called for stream %d ", __func__, streamIndex);
     ActivityContext::close(streamIndex);
     mSinkFloat.reset();
 }
diff --git a/apps/OboeTester/app/src/main/cpp/NativeAudioContext.h b/apps/OboeTester/app/src/main/cpp/NativeAudioContext.h
index b86d50a..ed989cd 100644
--- a/apps/OboeTester/app/src/main/cpp/NativeAudioContext.h
+++ b/apps/OboeTester/app/src/main/cpp/NativeAudioContext.h
@@ -245,7 +245,6 @@
     }
 
     void setWorkload(double workload) {
-        LOGD("ActivityContext::%s(%f)", __func__, workload);
         oboeCallbackProxy.setWorkload(workload);
     }
 
@@ -260,9 +259,7 @@
     virtual void runBlockingIO() {};
 
     static void threadCallback(ActivityContext *context) {
-        LOGD("%s: called", __func__);
         context->runBlockingIO();
-        LOGD("%s: exiting", __func__);
     }
 
     void stopBlockingIOThread() {
@@ -654,7 +651,6 @@
     };
 
     void setActivityType(int activityType) {
-        LOGD("%s(%d)", __func__, activityType);
         mActivityType = (ActivityType) activityType;
         switch(mActivityType) {
             default:
diff --git a/include/oboe/AudioStream.h b/include/oboe/AudioStream.h
index faee05b..a158aaf 100644
--- a/include/oboe/AudioStream.h
+++ b/include/oboe/AudioStream.h
@@ -517,6 +517,8 @@
 
 
 private:
+    // Log the scheduler if it changes.
+    void                 checkScheduler();
     int                  mPreviousScheduler = -1;
 
     std::atomic<bool>    mDataCallbackEnabled{false};
diff --git a/src/aaudio/AudioStreamAAudio.cpp b/src/aaudio/AudioStreamAAudio.cpp
index 383e9f6..52d85b9 100644
--- a/src/aaudio/AudioStreamAAudio.cpp
+++ b/src/aaudio/AudioStreamAAudio.cpp
@@ -79,10 +79,8 @@
 // Prevents deletion of the stream if the app is using AudioStreamBuilder::openSharedStream()
 static void oboe_aaudio_error_thread_proc_shared(std::shared_ptr<AudioStream> sharedStream,
                                           Result error) {
-    LOGD("%s() - entering >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", __func__);
     AudioStreamAAudio *oboeStream = reinterpret_cast<AudioStreamAAudio*>(sharedStream.get());
     oboe_aaudio_error_thread_proc(oboeStream, error);
-    LOGD("%s() - exiting <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", __func__);
 }
 
 namespace oboe {
@@ -94,7 +92,6 @@
     : AudioStream(builder)
     , mAAudioStream(nullptr) {
     mCallbackThreadEnabled.store(false);
-    LOGD("AudioStreamAAudio() call isSupported()");
     isSupported();
 }
 
@@ -121,7 +118,7 @@
     if (oboeStream->wasErrorCallbackCalled()) { // block extra error callbacks
         LOGE("%s() multiple error callbacks called!", __func__);
     } else if (stream != oboeStream->getUnderlyingStream()) {
-        LOGD("%s() stream already closed", __func__); // can happen if there are bugs
+        LOGW("%s() stream already closed", __func__); // can happen if there are bugs
     } else if (sharedStream) {
         // Handle error on a separate thread using shared pointer.
         std::thread t(oboe_aaudio_error_thread_proc_shared, sharedStream,
@@ -273,15 +270,14 @@
         mSessionId = SessionId::None;
     }
 
-    LOGD("AudioStreamAAudio.open() app    format = %d", static_cast<int>(mFormat));
-    LOGD("AudioStreamAAudio.open() sample rate   = %d", static_cast<int>(mSampleRate));
-    LOGD("AudioStreamAAudio.open() capacity      = %d", static_cast<int>(mBufferCapacityInFrames));
+    LOGD("AudioStreamAAudio.open() format=%d, sampleRate=%d, capacity = %d",
+            static_cast<int>(mFormat), static_cast<int>(mSampleRate),
+            static_cast<int>(mBufferCapacityInFrames));
 
 error2:
     mLibLoader->builder_delete(aaudioBuilder);
-    LOGD("AudioStreamAAudio.open: AAudioStream_Open() returned %s, mAAudioStream = %p",
-         mLibLoader->convertResultToText(static_cast<aaudio_result_t>(result)),
-         mAAudioStream.load());
+    LOGD("AudioStreamAAudio.open: AAudioStream_Open() returned %s",
+         mLibLoader->convertResultToText(static_cast<aaudio_result_t>(result)));
     return result;
 }
 
@@ -311,7 +307,7 @@
         return result;
     } else {
         if (result == DataCallbackResult::Stop) {
-            LOGE("Oboe callback returned DataCallbackResult::Stop");
+            LOGD("Oboe callback returned DataCallbackResult::Stop");
         } else {
             LOGE("Oboe callback returned unexpected value = %d", result);
         }
diff --git a/src/common/AudioStream.cpp b/src/common/AudioStream.cpp
index f0fd2f2..b1bbbbd 100644
--- a/src/common/AudioStream.cpp
+++ b/src/common/AudioStream.cpp
@@ -39,22 +39,24 @@
     return Result::OK;
 }
 
-DataCallbackResult AudioStream::fireDataCallback(void *audioData, int32_t numFrames) {
-    if (!isDataCallbackEnabled()) {
-        LOGW("AudioStream::%s() called with data callback disabled!", __func__);
-        return DataCallbackResult::Stop; // We should not be getting called any more.
-    }
-
-    // TODO remove
+// Call this from fireDataCallback to monitor CPU scheduler.
+void AudioStream::checkScheduler() {
     int scheduler = sched_getscheduler(0) & ~SCHED_RESET_ON_FORK; // for current thread
     if (scheduler != mPreviousScheduler) {
         LOGD("AudioStream::%s() scheduler = %s", __func__,
              ((scheduler == SCHED_FIFO) ? "SCHED_FIFO" :
-             ((scheduler == SCHED_OTHER) ? "SCHED_OTHER" :
-             ((scheduler == SCHED_RR) ? "SCHED_RR" : "UNKNOWN")))
+              ((scheduler == SCHED_OTHER) ? "SCHED_OTHER" :
+               ((scheduler == SCHED_RR) ? "SCHED_RR" : "UNKNOWN")))
         );
         mPreviousScheduler = scheduler;
     }
+}
+
+DataCallbackResult AudioStream::fireDataCallback(void *audioData, int32_t numFrames) {
+    if (!isDataCallbackEnabled()) {
+        LOGW("AudioStream::%s() called with data callback disabled!", __func__);
+        return DataCallbackResult::Stop; // We should not be getting called any more.
+    }
 
     DataCallbackResult result;
     if (mStreamCallback == nullptr) {
@@ -195,11 +197,9 @@
 }
 
 static void oboe_stop_thread_proc(AudioStream *oboeStream) {
-    LOGD("%s() called ----)))))", __func__);
     if (oboeStream != nullptr) {
         oboeStream->requestStop();
     }
-    LOGD("%s() returning (((((----", __func__);
 }
 
 void AudioStream::launchStopThread() {
diff --git a/src/common/AudioStreamBuilder.cpp b/src/common/AudioStreamBuilder.cpp
index 48be1b7..9f1e31b 100644
--- a/src/common/AudioStreamBuilder.cpp
+++ b/src/common/AudioStreamBuilder.cpp
@@ -128,7 +128,7 @@
             }
 
             // Use childStream in a FilterAudioStream.
-            LOGD("%s() create a FilterAudioStream for data conversion.", __func__);
+            LOGI("%s() create a FilterAudioStream for data conversion.", __func__);
             FilterAudioStream *filterStream = new FilterAudioStream(parentBuilder, tempStream);
             result = filterStream->configureFlowGraph();
             if (result !=  Result::OK) {
diff --git a/src/common/DataConversionFlowGraph.cpp b/src/common/DataConversionFlowGraph.cpp
index ce1d093..c15e92d 100644
--- a/src/common/DataConversionFlowGraph.cpp
+++ b/src/common/DataConversionFlowGraph.cpp
@@ -86,7 +86,7 @@
     int32_t sinkChannelCount = sinkStream->getChannelCount();
     int32_t sinkSampleRate = sinkStream->getSampleRate();
 
-    LOGD("%s() flowgraph converts channels: %d to %d, format: %d to %d, rate: %d to %d, qual = %d",
+    LOGI("%s() flowgraph converts channels: %d to %d, format: %d to %d, rate: %d to %d, qual = %d",
             __func__,
             sourceChannelCount, sinkChannelCount,
             sourceFormat, sinkFormat,
diff --git a/src/fifo/FifoBuffer.cpp b/src/fifo/FifoBuffer.cpp
index f89dca6..8d6b03b 100644
--- a/src/fifo/FifoBuffer.cpp
+++ b/src/fifo/FifoBuffer.cpp
@@ -40,8 +40,6 @@
     int32_t bytesPerBuffer = bytesPerFrame * capacityInFrames;
     mStorage = new uint8_t[bytesPerBuffer];
     mStorageOwned = true;
-    LOGD("%s() capacityInFrames = %d, bytesPerFrame = %d",
-         __func__, capacityInFrames, bytesPerFrame);
 }
 
 FifoBuffer::FifoBuffer( uint32_t  bytesPerFrame,
@@ -60,8 +58,6 @@
                                        writeCounterAddress);
     mStorage = dataStorageAddress;
     mStorageOwned = false;
-    LOGD("%s(*) capacityInFrames = %d, bytesPerFrame = %d",
-         __func__, capacityInFrames, bytesPerFrame);
 }
 
 FifoBuffer::~FifoBuffer() {
diff --git a/src/opensles/AudioInputStreamOpenSLES.cpp b/src/opensles/AudioInputStreamOpenSLES.cpp
index 9fad5b1..fcad183 100644
--- a/src/opensles/AudioInputStreamOpenSLES.cpp
+++ b/src/opensles/AudioInputStreamOpenSLES.cpp
@@ -340,7 +340,7 @@
         SLmillisecond msec = 0;
         SLresult slResult = (*mRecordInterface)->GetPosition(mRecordInterface, &msec);
         if (SL_RESULT_SUCCESS != slResult) {
-            LOGD("%s(): GetPosition() returned %s", __func__, getSLErrStr(slResult));
+            LOGW("%s(): GetPosition() returned %s", __func__, getSLErrStr(slResult));
             // set result based on SLresult
             result = Result::ErrorInternal;
         } else {
diff --git a/src/opensles/AudioOutputStreamOpenSLES.cpp b/src/opensles/AudioOutputStreamOpenSLES.cpp
index 4ca7452..cdb8883 100644
--- a/src/opensles/AudioOutputStreamOpenSLES.cpp
+++ b/src/opensles/AudioOutputStreamOpenSLES.cpp
@@ -271,7 +271,7 @@
 
     SLresult slResult = (*mPlayInterface)->SetPlayState(mPlayInterface, newState);
     if (SL_RESULT_SUCCESS != slResult) {
-        LOGD("AudioOutputStreamOpenSLES(): %s() returned %s", __func__, getSLErrStr(slResult));
+        LOGW("AudioOutputStreamOpenSLES(): %s() returned %s", __func__, getSLErrStr(slResult));
         result = Result::ErrorInternal; // TODO convert slResult to Result::Error
     }
     return result;
@@ -312,7 +312,6 @@
         setState(initialState);
         mLock.unlock();
     }
-    LOGD("AudioOutputStreamOpenSLES(): %s() returning %d", __func__, result);
     return result;
 }
 
@@ -343,7 +342,6 @@
     } else {
         setState(initialState);
     }
-    LOGD("AudioOutputStreamOpenSLES(): %s() returning %d", __func__, result);
     return result;
 }
 
@@ -371,7 +369,6 @@
             result = Result::ErrorInternal;
         }
     }
-    LOGD("AudioOutputStreamOpenSLES(): %s() returning %d", __func__, result);
     return result;
 }
 
@@ -410,7 +407,6 @@
     } else {
         setState(initialState);
     }
-    LOGD("AudioOutputStreamOpenSLES(): %s() returning %d", __func__, result);
     return result;
 }
 
@@ -440,7 +436,7 @@
         SLmillisecond msec = 0;
         SLresult slResult = (*mPlayInterface)->GetPosition(mPlayInterface, &msec);
         if (SL_RESULT_SUCCESS != slResult) {
-            LOGD("%s(): GetPosition() returned %s", __func__, getSLErrStr(slResult));
+            LOGW("%s(): GetPosition() returned %s", __func__, getSLErrStr(slResult));
             // set result based on SLresult
             result = Result::ErrorInternal;
         } else {
diff --git a/src/opensles/AudioStreamOpenSLES.cpp b/src/opensles/AudioStreamOpenSLES.cpp
index d4990ba..3af1a30 100644
--- a/src/opensles/AudioStreamOpenSLES.cpp
+++ b/src/opensles/AudioStreamOpenSLES.cpp
@@ -69,8 +69,7 @@
 
 Result AudioStreamOpenSLES::open() {
 
-    LOGI("AudioStreamOpenSLES::open(chans:%d, rate:%d)",
-         mChannelCount, mSampleRate);
+    LOGI("AudioStreamOpenSLES::open() chans=%d, rate=%d", mChannelCount, mSampleRate);
 
     SLresult result = EngineOpenSLES::getInstance().open();
     if (SL_RESULT_SUCCESS != result) {
