Index: /trunk/src/VBox/Devices/Audio/AudioMixer.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/AudioMixer.cpp	(revision 64967)
+++ /trunk/src/VBox/Devices/Audio/AudioMixer.cpp	(revision 64968)
@@ -68,4 +68,54 @@
 static void audioMixerStreamDestroyInternal(PAUDMIXSTREAM pStream);
 
+
+#ifdef LOG_ENABLED
+/**
+ * Converts a mixer sink status to a string.
+ *
+ * @returns Stringified mixer sink flags. Must be free'd with RTStrFree().
+ *          "NONE" if no flags set.
+ * @param   fFlags              Mixer sink flags to convert.
+ */
+char *dbgAudioMixerSinkStatusToStr(AUDMIXSINKSTS fStatus)
+{
+#define APPEND_FLAG_TO_STR(_aFlag)              \
+    if (fStatus & AUDMIXSINK_STS_##_aFlag)      \
+    {                                           \
+        if (pszFlags)                           \
+        {                                       \
+            rc2 = RTStrAAppend(&pszFlags, " "); \
+            if (RT_FAILURE(rc2))                \
+                break;                          \
+        }                                       \
+                                                \
+        rc2 = RTStrAAppend(&pszFlags, #_aFlag); \
+        if (RT_FAILURE(rc2))                    \
+            break;                              \
+    }                                           \
+
+    char *pszFlags = NULL;
+    int rc2 = VINF_SUCCESS;
+
+    do
+    {
+        APPEND_FLAG_TO_STR(NONE);
+        APPEND_FLAG_TO_STR(RUNNING);
+        APPEND_FLAG_TO_STR(PENDING_DISABLE);
+        APPEND_FLAG_TO_STR(DIRTY);
+
+    } while (0);
+
+    if (   RT_FAILURE(rc2)
+        && pszFlags)
+    {
+        RTStrFree(pszFlags);
+        pszFlags = NULL;
+    }
+
+#undef APPEND_FLAG_TO_STR
+
+    return pszFlags;
+}
+#endif /* DEBUG */
 
 /**
@@ -682,5 +732,9 @@
     }
 
-    LogFlowFunc(("[%s]: enmCmd=%d, fStatus=0x%x, rc=%Rrc\n", pSink->pszName, enmSinkCmd, pSink->fStatus, rc));
+#ifdef LOG_ENABLED
+    char *pszStatus = dbgAudioMixerSinkStatusToStr(pSink->fStatus);
+    LogFlowFunc(("[%s]: enmCmd=%d, fStatus=%s, rc=%Rrc\n", pSink->pszName, enmSinkCmd, pszStatus, rc));
+    RTStrFree(pszStatus);
+#endif
 
     /* Not running anymore? Reset. */
@@ -1009,5 +1063,7 @@
               ("Can't read from a sink which is not an input sink\n"));
 
-#ifndef VBOX_AUDIO_MIXER_WITH_MIXBUF
+#ifdef VBOX_AUDIO_MIXER_WITH_MIXBUF
+# error "Implement me!"
+#else
     uint8_t *pvMixBuf = (uint8_t *)RTMemAlloc(cbBuf);
     if (!pvMixBuf)
@@ -1053,4 +1109,6 @@
                 LogFunc(("[%s] Failed reading from stream '%s': %Rrc\n", pSink->pszName, pMixStream->pszName, rc2));
 
+            Log3Func(("[%s] Stream '%s': Read %RU32 bytes\n", pSink->pszName, pMixStream->pszName, cbReadStrm));
+
             if (   RT_FAILURE(rc2)
                 || !cbReadStrm)
@@ -1095,5 +1153,10 @@
 #endif
 
-    Log3Func(("[%s] cbRead=%RU32, fClean=%RTbool, fStatus=0x%x, rc=%Rrc\n", pSink->pszName, cbRead, fClean, pSink->fStatus, rc));
+
+#ifdef LOG_ENABLED
+    char *pszStatus = dbgAudioMixerSinkStatusToStr(pSink->fStatus);
+    Log2Func(("[%s] cbRead=%RU32, fClean=%RTbool, fStatus=%s, rc=%Rrc\n", pSink->pszName, cbRead, fClean, pszStatus, rc));
+    RTStrFree(pszStatus);
+#endif
 
     int rc2 = RTCritSectLeave(&pSink->CritSect);
@@ -1350,5 +1413,9 @@
     int rc = VINF_SUCCESS;
 
-    Log3Func(("[%s] fStatus=0x%x\n", pSink->pszName, pSink->fStatus));
+#ifdef LOG_ENABLED
+    char *pszStatus = dbgAudioMixerSinkStatusToStr(pSink->fStatus);
+    Log3Func(("[%s] fStatus=%s\n", pSink->pszName, pszStatus));
+    RTStrFree(pszStatus);
+#endif
 
     /* Sink disabled? Take a shortcut. */
@@ -1535,8 +1602,8 @@
         return rc;
 
-    AssertMsg(pSink->fStatus & AUDMIXSINK_STS_RUNNING, ("%s: Can't write to a sink which is not running (anymore)\n",
-                                                        pSink->pszName));
-    AssertMsg(pSink->enmDir == AUDMIXSINKDIR_OUTPUT,   ("%s: Can't write to a sink which is not an output sink\n",
-                                                        pSink->pszName));
+    AssertMsg(pSink->fStatus & AUDMIXSINK_STS_RUNNING,
+              ("%s: Can't write to a sink which is not running (anymore) (status 0x%x)\n", pSink->pszName, pSink->fStatus));
+    AssertMsg(pSink->enmDir == AUDMIXSINKDIR_OUTPUT,
+              ("%s: Can't write to a sink which is not an output sink\n", pSink->pszName));
 
     Log3Func(("[%s] enmOp=%d, cbBuf=%RU32\n", pSink->pszName, enmOp, cbBuf));
