Index: /trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp	(revision 89834)
+++ /trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp	(revision 89835)
@@ -211,11 +211,40 @@
 }
 
-/** @copydoc ATSCALLBACKS::pfnTestSetBegin */
-static DECLCALLBACK(int) drvHostValKitTestSetBegin(void const *pvUser, const char *pszTag)
-{
-    PDRVHOSTVALKITAUDIO pThis = (PDRVHOSTVALKITAUDIO)pvUser;
-
-    LogRel(("Audio: Validation Kit: Beginning test set '%s'\n", pszTag));
-    return AudioTestSetCreate(&pThis->Set, pThis->szPathTemp, pszTag);
+/**
+ * Performs some internal cleanup / housekeeping of all registered tests.
+ *
+ * @param   pThis               ValKit audio driver instance.
+ */
+static void drvHostValKitCleanup(PDRVHOSTVALKITAUDIO pThis)
+{
+    LogRel(("Audio: Validation Kit: Cleaning up ...\n"));
+
+    if (pThis->cTestsRec)
+        LogRel(("Audio: Validation Kit: Warning: %RU32 guest recording tests still outstanding:\n", pThis->cTestsRec));
+
+    PVALKITTESTDATA pTst, pTstNext;
+    RTListForEachSafe(&pThis->lstTestsRec, pTst, pTstNext, VALKITTESTDATA, Node)
+    {
+        size_t const cbOutstanding = pTst->t.TestTone.u.Rec.cbToWrite - pTst->t.TestTone.u.Rec.cbWritten;
+        if (cbOutstanding)
+            LogRel(("Audio: Validation Kit: \tRecording test #%RU32 has %RU64 bytes (%RU32ms) outstanding\n",
+                    pTst->idxTest, cbOutstanding, PDMAudioPropsBytesToMilli(&pTst->t.TestTone.Parms.Props, cbOutstanding)));
+        drvHostValKiUnregisterRecTest(pThis, pTst);
+    }
+
+    if (pThis->cTestsPlay)
+        LogRel(("Audio: Validation Kit: Warning: %RU32 guest playback tests still outstanding:\n", pThis->cTestsPlay));
+
+    RTListForEachSafe(&pThis->lstTestsPlay, pTst, pTstNext, VALKITTESTDATA, Node)
+    {
+        size_t const cbOutstanding = pTst->t.TestTone.u.Play.cbToRead - pTst->t.TestTone.u.Play.cbRead;
+        if (cbOutstanding)
+            LogRel(("Audio: Validation Kit: \tPlayback test #%RU32 has %RU64 bytes (%RU32ms) outstanding\n",
+                    pTst->idxTest, cbOutstanding, PDMAudioPropsBytesToMilli(&pTst->t.TestTone.Parms.Props, cbOutstanding)));
+        drvHostValKiUnregisterPlayTest(pThis, pTst);
+    }
+
+    Assert(pThis->cTestsRec == 0);
+    Assert(pThis->cTestsPlay == 0);
 }
 
@@ -225,4 +254,13 @@
 *********************************************************************************************************************************/
 
+/** @copydoc ATSCALLBACKS::pfnTestSetBegin */
+static DECLCALLBACK(int) drvHostValKitTestSetBegin(void const *pvUser, const char *pszTag)
+{
+    PDRVHOSTVALKITAUDIO pThis = (PDRVHOSTVALKITAUDIO)pvUser;
+
+    LogRel(("Audio: Validation Kit: Beginning test set '%s'\n", pszTag));
+    return AudioTestSetCreate(&pThis->Set, pThis->szPathTemp, pszTag);
+}
+
 /** @copydoc ATSCALLBACKS::pfnTestSetEnd */
 static DECLCALLBACK(int) drvHostValKitTestSetEnd(void const *pvUser, const char *pszTag)
@@ -242,4 +280,7 @@
     if (RT_SUCCESS(rc))
         LogRel(("Audio: Validation Kit: Packed up to '%s'\n", pThis->szTestSetArchive));
+
+    /* Do some internal housekeeping. */
+    drvHostValKitCleanup(pThis);
 
     int rc2 = AudioTestSetWipe(pSet);
@@ -869,34 +910,9 @@
     if (RT_SUCCESS(rc))
     {
-        LogRel(("Audio: Validation Kit: Shutdown of Audio Test Service complete\n"));
-
-        if (pThis->cTestsRec)
-            LogRel(("Audio: Validation Kit: Warning: %RU32 guest recording tests still outstanding:\n", pThis->cTestsRec));
-
-        PVALKITTESTDATA pTst, pTstNext;
-        RTListForEachSafe(&pThis->lstTestsRec, pTst, pTstNext, VALKITTESTDATA, Node)
-        {
-            size_t const cbOutstanding = pTst->t.TestTone.u.Rec.cbToWrite - pTst->t.TestTone.u.Rec.cbWritten;
-            if (cbOutstanding)
-                LogRel(("Audio: Validation Kit: \tRecording test #%RU32 has %RU64 bytes outstanding\n", pTst->idxTest, cbOutstanding));
-            drvHostValKiUnregisterRecTest(pThis, pTst);
-        }
-
-        if (pThis->cTestsPlay)
-            LogRel(("Audio: Validation Kit: Warning: %RU32 guest playback tests still outstanding:\n", pThis->cTestsPlay));
-
-        RTListForEachSafe(&pThis->lstTestsPlay, pTst, pTstNext, VALKITTESTDATA, Node)
-        {
-            size_t const cbOutstanding = pTst->t.TestTone.u.Play.cbToRead - pTst->t.TestTone.u.Play.cbRead;
-            if (cbOutstanding)
-                LogRel(("Audio: Validation Kit: \tPlayback test #%RU32 has %RU64 bytes outstanding\n", pTst->idxTest, cbOutstanding));
-            drvHostValKiUnregisterPlayTest(pThis, pTst);
-        }
-
-        Assert(pThis->cTestsRec == 0);
-        Assert(pThis->cTestsPlay == 0);
+        LogRel(("Audio: Validation Kit: Shutdown of Audio Test Service (ATS) complete\n"));
+        drvHostValKitCleanup(pThis);
     }
     else
-        LogRel(("Audio: Validation Kit: Shutdown of Audio Test Service failed, rc=%Rrc\n", rc));
+        LogRel(("Audio: Validation Kit: Shutdown of Audio Test Service (ATS) failed, rc=%Rrc\n", rc));
 
     /* Try cleaning up a bit. */
