Index: /trunk/include/VBox/vmm/pdmaudioifs.h
===================================================================
--- /trunk/include/VBox/vmm/pdmaudioifs.h	(revision 61385)
+++ /trunk/include/VBox/vmm/pdmaudioifs.h	(revision 61386)
@@ -702,4 +702,14 @@
 
     /**
+     * Sets the audio volume of a specific audio stream.
+     *
+     * @returns VBox status code.
+     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
+     * @param   pStream         Pointer to audio stream.
+     * @param   pVol            Pointer to audio volume structure to set the stream's audio volume to.
+     */
+    DECLR3CALLBACKMEMBER(int, pfnStreamSetVolume, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream, PPDMAUDIOVOLUME pVol));
+
+    /**
      * Plays (transfers) all available audio samples of a an output stream via the connected host backend.
      *
@@ -718,5 +728,5 @@
 
 /** PDMIAUDIOCONNECTOR interface ID. */
-#define PDMIAUDIOCONNECTOR_IID                  "9E03C980-64E9-42EC-9C70-316995990BE3"
+#define PDMIAUDIOCONNECTOR_IID                  "9C097435-3276-4D88-A49A-A4FE671D86F8"
 
 
Index: /trunk/src/VBox/Devices/Audio/AudioMixBuffer.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/AudioMixBuffer.cpp	(revision 61385)
+++ /trunk/src/VBox/Devices/Audio/AudioMixBuffer.cpp	(revision 61386)
@@ -1046,6 +1046,5 @@
 
     /* Note: Always count in parent samples, as the rate can differ! */
-    pSrc->cMixed      = cDstMixed;
-    Assert(pSrc->cMixed <= pDst->cSamples);
+    pSrc->cMixed      = RT_MIN(cDstMixed, pDst->cSamples);
 
     pDst->offWrite    = offDstWrite;
@@ -1542,16 +1541,20 @@
     }
 
-    PPDMAUDIOMIXBUF pIter;
-    while (!RTListIsEmpty(&pMixBuf->lstChildren))
-    {
-        pIter = RTListGetFirst(&pMixBuf->lstChildren, PDMAUDIOMIXBUF, Node);
-
-        AUDMIXBUF_LOG(("\tUnlinking \"%s\"\n", pIter->pszName));
-
-        AudioMixBufReset(pIter->pParent);
-        pIter->pParent = NULL;
-
-        RTListNodeRemove(&pIter->Node);
-    }
+    PPDMAUDIOMIXBUF pChild, pChildNext;
+    RTListForEachSafe(&pMixBuf->lstChildren, pChild, pChildNext, PDMAUDIOMIXBUF, Node)
+    {
+        AUDMIXBUF_LOG(("\tUnlinking \"%s\"\n", pChild->pszName));
+
+        AudioMixBufReset(pChild);
+
+        Assert(pChild->pParent == pMixBuf);
+        pChild->pParent = NULL;
+
+        RTListNodeRemove(&pChild->Node);
+    }
+
+    Assert(RTListIsEmpty(&pMixBuf->lstChildren));
+
+    AudioMixBufReset(pMixBuf);
 
     if (pMixBuf->pRate)
Index: /trunk/src/VBox/Devices/Audio/AudioMixer.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/AudioMixer.cpp	(revision 61385)
+++ /trunk/src/VBox/Devices/Audio/AudioMixer.cpp	(revision 61386)
@@ -867,8 +867,6 @@
     RTListForEach(&pSink->lstStreams, pMixStream, AUDMIXSTREAM, Node)
     {
-        if (fOut)
-            AudioMixBufSetVolume(&pMixStream->pStream->MixBuf, &volSink);
-        else
-            AudioMixBufSetVolume(&pMixStream->pStream->MixBuf, &volSink);
+        int rc2 = pMixStream->pConn->pfnStreamSetVolume(pMixStream->pConn, pMixStream->pStream, &volSink);
+        AssertRC(rc2);
     }
 
@@ -900,5 +898,8 @@
     {
         if (!(pMixStream->pConn->pfnStreamGetStatus(pMixStream->pConn, pMixStream->pStream) & PDMAUDIOSTRMSTS_FLAG_ENABLED))
+        {
+            LogFlowFunc(("%s: Disabled, skipping ...\n", pSink->pszName));
             continue;
+        }
 
         int rc2 = pMixStream->pConn->pfnStreamWrite(pMixStream->pConn, pMixStream->pStream, pvBuf, cbBuf, &cbProcessed);
Index: /trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevIchAc97.cpp	(revision 61385)
+++ /trunk/src/VBox/Devices/Audio/DevIchAc97.cpp	(revision 61386)
@@ -1376,4 +1376,6 @@
     pThis->uTimerTS = cTicksNow;
 
+    LogFlowFuncEnter();
+
     uint32_t cbLineIn;
     AudioMixerSinkTimerUpdate(pThis->pSinkLineIn, pThis->cTimerTicks, cTicksPerSec, &cbLineIn);
Index: /trunk/src/VBox/Devices/Audio/DevIchHda.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevIchHda.cpp	(revision 61385)
+++ /trunk/src/VBox/Devices/Audio/DevIchHda.cpp	(revision 61386)
@@ -3465,5 +3465,4 @@
         Assert(cbRead <= cbBuf);
         Assert(cbRead <= pBDLE->u32BufSize - pBDLE->State.u32BufOff);
-        //Assert(cbRead <= pStream->u16FIFOS);
 
         /*
@@ -3477,4 +3476,5 @@
         if (pBDLE->State.cbBelowFIFOW + cbRead > hdaStreamGetFIFOW(pThis, pStream))
         {
+            Assert(pBDLE->State.u32BufOff + cbRead <= pBDLE->u32BufSize);
             pBDLE->State.u32BufOff    += cbRead;
             pBDLE->State.cbBelowFIFOW  = 0;
@@ -3483,4 +3483,5 @@
         else
         {
+            Assert(pBDLE->State.u32BufOff + cbRead <= pBDLE->u32BufSize);
             pBDLE->State.u32BufOff    += cbRead;
             pBDLE->State.cbBelowFIFOW += cbRead;
@@ -3628,5 +3629,6 @@
         else
         {
-            pBDLE->State.u32BufOff += cbWritten;
+            Assert(pBDLE->State.u32BufOff + cbWritten <= pBDLE->u32BufSize);
+            pBDLE->State.u32BufOff    += cbWritten;
             pBDLE->State.cbBelowFIFOW += cbWritten;
             Assert(pBDLE->State.cbBelowFIFOW <= hdaStreamGetFIFOW(pThis, pStream));
Index: /trunk/src/VBox/Devices/Audio/DevSB16.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevSB16.cpp	(revision 61385)
+++ /trunk/src/VBox/Devices/Audio/DevSB16.cpp	(revision 61386)
@@ -434,6 +434,6 @@
     if (hold)
     {
+#ifndef VBOX_WITH_AUDIO_CALLBACKS
         pThis->cStreamsActive++;
-#ifndef VBOX_WITH_AUDIO_CALLBACKS
         sb16TimerMaybeStart(pThis);
 #endif
@@ -1039,5 +1039,5 @@
             else
                 TMTimerSet(pThis->pTimerIRQ, TMTimerGet(pThis->pTimerIRQ) + ticks);
-            LogFlowFunc(("mix silence %d %d % %RU64\n", samples, bytes, ticks));
+            LogFlowFunc(("mix silence: %d samples, %d bytes, %RU64 ticks\n", samples, bytes, ticks));
             break;
         }
@@ -1108,7 +1108,13 @@
     uint8_t lvol = sb16MixRegToVol(pThis, 0x30);
     uint8_t rvol = sb16MixRegToVol(pThis, 0x31);
-    PDMAUDIOVOLUME vol = { false, lvol, rvol };
-
-//    AudioMixerSetMasterVolume(pThis->pMixer, &vol);
+
+    PDMAUDIOVOLUME Vol = { false /* fMute */, lvol, rvol };
+
+    PSB16DRIVER pDrv;
+    RTListForEach(&pThis->lstDrv, pDrv, SB16DRIVER, Node)
+    {
+        int rc2 = pDrv->pConnector->pfnStreamSetVolume(pDrv->pConnector, pDrv->Out.pStream, &Vol);
+        AssertRC(rc2);
+    }
 }
 
@@ -1118,11 +1124,19 @@
     uint8_t lvol = sb16MixRegToVol(pThis, 0x32);
     uint8_t rvol = sb16MixRegToVol(pThis, 0x33);
-    PDMAUDIOVOLUME vol = { false, lvol, rvol };
-
-  //  AudioMixerSinkSetVolume(pThis->pSinkOutput, &vol);
+
+    PDMAUDIOVOLUME Vol = { false /* fMute */, lvol, rvol };
+
+    PSB16DRIVER pDrv;
+    RTListForEach(&pThis->lstDrv, pDrv, SB16DRIVER, Node)
+    {
+        int rc2 = pDrv->pConnector->pfnStreamSetVolume(pDrv->pConnector, pDrv->Out.pStream, &Vol);
+        AssertRC(rc2);
+    }
 }
 
 static void sb16ResetLegacy(PSB16STATE pThis)
 {
+    LogFlowFuncEnter();
+
     sb16CloseOut(pThis);
 
@@ -1168,4 +1182,5 @@
     dsp_out_data(pThis, 0xaa);
     sb16SpeakerControl(pThis, 0);
+
     sb16Control(pThis, 0);
     sb16ResetLegacy(pThis);
@@ -1781,10 +1796,4 @@
             continue;
 
-        PDMAUDIOSTRMSTS strmSts = pDrv->pConnector->pfnStreamGetStatus(pDrv->pConnector, pStream);
-        fIsPlaying |= (   (strmSts & PDMAUDIOSTRMSTS_FLAG_ENABLED)
-                       || (strmSts & PDMAUDIOSTRMSTS_FLAG_PENDING_DISABLE));
-
-        LogFlowFunc(("%s: strmSts=0x%x -> fIsPlaying=%RTbool\n", pStream->szName, strmSts, fIsPlaying));
-
         int rc2 = pDrv->pConnector->pfnStreamIterate(pDrv->pConnector, pStream);
         if (RT_SUCCESS(rc2))
@@ -1801,4 +1810,10 @@
             }
         }
+
+        PDMAUDIOSTRMSTS strmSts = pDrv->pConnector->pfnStreamGetStatus(pDrv->pConnector, pStream);
+        fIsPlaying |= (   (strmSts & PDMAUDIOSTRMSTS_FLAG_ENABLED)
+                       || (strmSts & PDMAUDIOSTRMSTS_FLAG_PENDING_DISABLE));
+
+        LogFlowFunc(("%s: strmSts=0x%x -> fIsPlaying=%RTbool\n", pStream->szName, strmSts, fIsPlaying));
     }
 
@@ -1814,4 +1829,6 @@
         TMTimerSet(pThis->pTimerIO, cTicksNow + cTicks);
     }
+
+    LogFlowFuncLeave();
 }
 
@@ -2035,7 +2052,7 @@
     AssertPtrReturn(pCfg,  VERR_INVALID_POINTER);
 
+    LogFlowFuncEnter();
+
     AssertReturn(pCfg->enmDir == PDMAUDIODIR_OUT, VERR_INVALID_PARAMETER);
-
-    int rc = VINF_SUCCESS;
 
     /* Set a default audio format for the host. */
@@ -2052,4 +2069,6 @@
     uint8_t uLUN = 0;
 
+    int rc = VINF_SUCCESS;
+
     PSB16DRIVER pDrv;
     RTListForEach(&pThis->lstDrv, pDrv, SB16DRIVER, Node)
@@ -2062,17 +2081,23 @@
         }
 
+        int rc2;
+
         if (pDrv->Out.pStream)
         {
             pDrv->pConnector->pfnStreamRelease(pDrv->pConnector, pDrv->Out.pStream);
 
-            int rc3 = pDrv->pConnector->pfnStreamDestroy(pDrv->pConnector, pDrv->Out.pStream);
-            AssertRC(rc3);
-
-            pDrv->Out.pStream = NULL;
+            rc2 = pDrv->pConnector->pfnStreamDestroy(pDrv->pConnector, pDrv->Out.pStream);
+            if (RT_SUCCESS(rc2))
+                pDrv->Out.pStream = NULL;
         }
-
-        int rc2 = pDrv->pConnector->pfnStreamCreate(pDrv->pConnector, &CfgHost, pCfg, &pDrv->Out.pStream);
+        else
+            rc2 = VINF_SUCCESS;
+
         if (RT_SUCCESS(rc2))
-            pDrv->pConnector->pfnStreamAddRef(pDrv->pConnector, pDrv->Out.pStream);
+        {
+            rc2 = pDrv->pConnector->pfnStreamCreate(pDrv->pConnector, &CfgHost, pCfg, &pDrv->Out.pStream);
+            if (RT_SUCCESS(rc2))
+                pDrv->pConnector->pfnStreamAddRef(pDrv->pConnector, pDrv->Out.pStream);
+        }
 
         LogFlowFunc(("LUN#%RU8: Created output \"%s\", rc=%Rrc\n", pDrv->uLUN, pCfg->szName, rc2));
@@ -2081,4 +2106,5 @@
     }
 
+    LogFlowFuncLeaveRC(rc);
     return rc;
 }
@@ -2097,8 +2123,11 @@
             pDrv->pConnector->pfnStreamRelease(pDrv->pConnector, pDrv->Out.pStream);
 
-            pDrv->pConnector->pfnStreamDestroy(pDrv->pConnector, pDrv->Out.pStream);
-            pDrv->Out.pStream = NULL;
+            int rc2 = pDrv->pConnector->pfnStreamDestroy(pDrv->pConnector, pDrv->Out.pStream);
+            if (RT_SUCCESS(rc2))
+                pDrv->Out.pStream = NULL;
         }
     }
+
+    LogFlowFuncLeave();
 }
 
Index: /trunk/src/VBox/Devices/Audio/DrvAudio.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DrvAudio.cpp	(revision 61385)
+++ /trunk/src/VBox/Devices/Audio/DrvAudio.cpp	(revision 61386)
@@ -66,8 +66,9 @@
 
 static DECLCALLBACK(int) drvAudioStreamDestroy(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream);
+static int drvAudioStreamControlInternalBackend(PDRVAUDIO pThis, PPDMAUDIOSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd);
 static int drvAudioStreamControlInternal(PDRVAUDIO pThis, PPDMAUDIOSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd);
-static int drvAudioStreamControlInternalBackend(PDRVAUDIO pThis, PPDMAUDIOSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd);
 static int drvAudioStreamDestroyInternalBackend(PDRVAUDIO pThis, PPDMAUDIOSTREAM pHstStream);
 static int drvAudioStreamDestroyInternal(PDRVAUDIO pThis, PPDMAUDIOSTREAM pStream);
+static int drvAudioStreamIterateInternal(PDRVAUDIO pThis, PPDMAUDIOSTREAM pStream);
 
 #ifndef VBOX_AUDIO_TESTCASE
@@ -154,4 +155,11 @@
                                ? pStream
                                : pStream->pPair;
+    if (pStreamHst)
+    {
+        Assert(pStreamHst->enmCtx == PDMAUDIOSTREAMCTX_HOST);
+    }
+    else
+        LogFlowFunc(("%s: Warning: Does not have a host stream (anymore)\n", pStream->szName));
+
     return pStreamHst;
 }
@@ -263,33 +271,25 @@
         return rc;
 
-    LogFlowFunc(("%s\n", pStream->szName));
+    LogFlowFunc(("%s: enmStreamCmd=%ld\n", pStream->szName, enmStreamCmd));
+
+    rc = drvAudioStreamControlInternal(pThis, pStream, enmStreamCmd);
+
+    int rc2 = RTCritSectLeave(&pThis->CritSect);
+    if (RT_SUCCESS(rc))
+        rc = rc2;
+
+    return rc;
+}
+
+static int drvAudioStreamControlInternal(PDRVAUDIO pThis, PPDMAUDIOSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd)
+{
+    AssertPtrReturn(pThis,   VERR_INVALID_POINTER);
+    AssertPtrReturn(pStream, VERR_INVALID_POINTER);
+
+    LogFlowFunc(("%s: enmStreamCmd=%ld\n", pStream->szName, enmStreamCmd));
 
     PPDMAUDIOSTREAM pHstStream = drvAudioGetHostStream(pStream);
-    PPDMAUDIOSTREAM pGstStream = pHstStream->pPair;
-
-    /* Note: Call the host (backend) first to see if there is any pending disable
-     *       actions in progress. */
-    rc = drvAudioStreamControlInternalBackend(pThis, pHstStream, enmStreamCmd);
-    if (   RT_SUCCESS(rc)
-        || rc == VERR_AUDIO_STREAM_PENDING_DISABLE)
-    {
-        int rc3 = drvAudioStreamControlInternal(pThis, pStream, enmStreamCmd);
-        if (RT_SUCCESS(rc))
-            rc = rc3;
-    }
-
-    int rc2 = RTCritSectLeave(&pThis->CritSect);
-    if (RT_SUCCESS(rc))
-        rc = rc2;
-
-    return rc;
-}
-
-static int drvAudioStreamControlInternal(PDRVAUDIO pThis, PPDMAUDIOSTREAM pGstStream, PDMAUDIOSTREAMCMD enmStreamCmd)
-{
-    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
-
-    if (!pGstStream)
-        return VINF_SUCCESS;
+    PPDMAUDIOSTREAM pGstStream = pHstStream ? pHstStream->pPair : pStream;
+    AssertPtr(pGstStream);
 
     int rc = VINF_SUCCESS;
@@ -299,23 +299,63 @@
         case PDMAUDIOSTREAMCMD_ENABLE:
         {
-            pGstStream->fStatus |= PDMAUDIOSTRMSTS_FLAG_ENABLED;
+            if (!(pGstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_ENABLED))
+            {
+                if (pHstStream)
+                {
+                    /* Is a pending disable outstanding? Then disable first. */
+                    if (pHstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_PENDING_DISABLE)
+                        rc = drvAudioStreamControlInternalBackend(pThis, pHstStream, PDMAUDIOSTREAMCMD_DISABLE);
+
+                    if (RT_SUCCESS(rc))
+                        rc = drvAudioStreamControlInternalBackend(pThis, pHstStream, PDMAUDIOSTREAMCMD_ENABLE);
+                }
+
+                pGstStream->fStatus |= PDMAUDIOSTRMSTS_FLAG_ENABLED;
+            }
             break;
         }
 
         case PDMAUDIOSTREAMCMD_DISABLE:
-        {
-            pGstStream->fStatus &= ~PDMAUDIOSTRMSTS_FLAG_ENABLED;
+        case PDMAUDIOSTREAMCMD_PAUSE:
+        {
+            if (pGstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_ENABLED)
+            {
+                /* Is the guest side stream still active?
+                 * Mark the host stream as pending disable and bail out. */
+                if (pHstStream)
+                {
+                    LogFlowFunc(("%s: Pending disable/pause\n", pHstStream->szName));
+                    pHstStream->fStatus |= PDMAUDIOSTRMSTS_FLAG_PENDING_DISABLE;
+                }
+
+                if (enmStreamCmd == PDMAUDIOSTREAMCMD_DISABLE)
+                {
+                    pGstStream->fStatus &= ~PDMAUDIOSTRMSTS_FLAG_ENABLED;
+                }
+                else if (enmStreamCmd == PDMAUDIOSTREAMCMD_PAUSE)
+                    pGstStream->fStatus |= PDMAUDIOSTRMSTS_FLAG_PAUSED;
+                else
+                    AssertFailedBreakStmt(rc = VERR_NOT_IMPLEMENTED);
+            }
+
+            if (   pHstStream
+                && !(pHstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_PENDING_DISABLE))
+            {
+                rc = drvAudioStreamControlInternalBackend(pThis, pHstStream, enmStreamCmd);
+                if (RT_SUCCESS(rc))
+                    pHstStream->fStatus &= ~PDMAUDIOSTRMSTS_FLAG_PENDING_DISABLE;
+            }
             break;
         }
 
-        case PDMAUDIOSTREAMCMD_PAUSE:
-        {
-            pGstStream->fStatus |= PDMAUDIOSTRMSTS_FLAG_PAUSED;
-            break;
-        }
-
         case PDMAUDIOSTREAMCMD_RESUME:
         {
-            pGstStream->fStatus &= ~PDMAUDIOSTRMSTS_FLAG_PAUSED;
+            if (pGstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_PAUSED)
+            {
+                if (pHstStream)
+                    rc = drvAudioStreamControlInternalBackend(pThis, pHstStream, PDMAUDIOSTREAMCMD_RESUME);
+
+                pGstStream->fStatus &= ~PDMAUDIOSTRMSTS_FLAG_PAUSED;
+            }
             break;
         }
@@ -327,24 +367,24 @@
     }
 
-    LogFlowFunc(("%s: enmStreamCmd=%ld, rc=%Rrc\n", pGstStream->szName, enmStreamCmd, rc));
+    if (RT_FAILURE(rc))
+        LogFunc(("%s: Failed with %Rrc\n", pStream->szName, rc));
+
     return rc;
 }
 
-static int drvAudioStreamControlInternalBackend(PDRVAUDIO pThis, PPDMAUDIOSTREAM pHstStream, PDMAUDIOSTREAMCMD enmStreamCmd)
-{
-    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
-
-    if (!pHstStream)
-        return VINF_SUCCESS;
-
-    AssertMsg(pHstStream->enmCtx == PDMAUDIOSTREAMCTX_HOST,
-              ("Stream '%s' is not a host stream and therefore has no backend\n", pHstStream->szName));
-
-    LogFlowFunc(("%s: enmStreamCmd=%ld\n", pHstStream->szName, enmStreamCmd));
+static int drvAudioStreamControlInternalBackend(PDRVAUDIO pThis, PPDMAUDIOSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd)
+{
+    AssertPtrReturn(pThis,   VERR_INVALID_POINTER);
+    AssertPtrReturn(pStream, VERR_INVALID_POINTER);
+
+    LogFlowFunc(("%s: enmStreamCmd=%ld\n", pStream->szName, enmStreamCmd));
+
+    PPDMAUDIOSTREAM pHstStream = drvAudioGetHostStream(pStream);
+    AssertPtr(pHstStream);
+
+    AssertPtr(pThis->pHostDrvAudio);
 
     int rc = VINF_SUCCESS;
 
-    PPDMAUDIOSTREAM pGstStream = pHstStream->pPair; /* Can be NULL. */
-
     switch (enmStreamCmd)
     {
@@ -353,6 +393,5 @@
             if (!(pHstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_ENABLED))
             {
-                if (pThis->pHostDrvAudio)
-                    rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pHstStream, PDMAUDIOSTREAMCMD_ENABLE);
+                rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pHstStream, PDMAUDIOSTREAMCMD_ENABLE);
                 if (RT_SUCCESS(rc))
                     pHstStream->fStatus |= PDMAUDIOSTRMSTS_FLAG_ENABLED;
@@ -363,22 +402,7 @@
         case PDMAUDIOSTREAMCMD_DISABLE:
         {
-            /* Is the guest side stream still active?
-             * Mark the host stream as pending disable and bail out. */
-            if (   pGstStream
-                && (pGstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_ENABLED))
-            {
-                LogFlowFunc(("%s: Pending disable\n", pHstStream->szName));
-                pHstStream->fStatus |= PDMAUDIOSTRMSTS_FLAG_PENDING_DISABLE;
-                rc = VERR_AUDIO_STREAM_PENDING_DISABLE;
-                break;
-            }
-
-            /* Clear pending disable bit. */
-            pHstStream->fStatus &= ~PDMAUDIOSTRMSTS_FLAG_PENDING_DISABLE;
-
             if (pHstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_ENABLED)
             {
-                if (pThis->pHostDrvAudio)
-                    rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pHstStream, PDMAUDIOSTREAMCMD_DISABLE);
+                rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pHstStream, PDMAUDIOSTREAMCMD_DISABLE);
                 if (RT_SUCCESS(rc))
                 {
@@ -392,19 +416,7 @@
         case PDMAUDIOSTREAMCMD_PAUSE:
         {
-            /* Is the guest side stream still active?
-             * Mark the host stream as pending disable and bail out. */
-            if (   pGstStream
-                && (pGstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_ENABLED))
-            {
-                LogFlowFunc(("%s: Pending pause\n", pHstStream->szName));
-                pHstStream->fStatus |= PDMAUDIOSTRMSTS_FLAG_PENDING_DISABLE;
-                rc = VERR_AUDIO_STREAM_PENDING_DISABLE;
-                break;
-            }
-
             if (!(pHstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_PAUSED))
             {
-                if (pThis->pHostDrvAudio)
-                    rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pHstStream, PDMAUDIOSTREAMCMD_PAUSE);
+                rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pHstStream, PDMAUDIOSTREAMCMD_PAUSE);
                 if (RT_SUCCESS(rc))
                     pHstStream->fStatus |= PDMAUDIOSTRMSTS_FLAG_PAUSED;
@@ -417,6 +429,5 @@
             if (pHstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_PAUSED)
             {
-                if (pThis->pHostDrvAudio)
-                    rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pHstStream, PDMAUDIOSTREAMCMD_RESUME);
+                rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pHstStream, PDMAUDIOSTREAMCMD_RESUME);
                 if (RT_SUCCESS(rc))
                     pHstStream->fStatus &= ~PDMAUDIOSTRMSTS_FLAG_PAUSED;
@@ -432,5 +443,5 @@
 
     if (RT_FAILURE(rc))
-        LogFunc(("%s: Failed with %Rrc\n", pHstStream->szName, rc));
+        LogFunc(("%s: Failed with %Rrc\n", pStream->szName, rc));
 
     return rc;
@@ -671,6 +682,5 @@
    NOREF(pInterface);
 
-   Assert(pStream->cRefs);
-   if (pStream->cRefs)
+   if (pStream->cRefs > 1) /* 1 reference always is kept by this audio driver. */
        pStream->cRefs--;
 
@@ -682,19 +692,40 @@
 {
     AssertPtrReturn(pInterface, VERR_INVALID_POINTER);
+    AssertPtrReturn(pStream,    VERR_INVALID_POINTER);
     /* pcData is optional. */
+
+    PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface);
+
+    int rc = RTCritSectEnter(&pThis->CritSect);
+    if (RT_FAILURE(rc))
+        return rc;
+
+    LogFlowFunc(("%s\n", pStream->szName));
+
+    rc = drvAudioStreamIterateInternal(pThis, pStream);
+
+    int rc2 = RTCritSectLeave(&pThis->CritSect);
+    if (RT_SUCCESS(rc))
+        rc = rc2;
+
+    if (RT_FAILURE(rc))
+        LogFlowFuncLeaveRC(rc);
+
+    return rc;
+}
+
+static int drvAudioStreamIterateInternal(PDRVAUDIO pThis, PPDMAUDIOSTREAM pStream)
+{
+    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
 
     if (!pStream)
         return VINF_SUCCESS;
 
-    PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface);
-
-    int rc = RTCritSectEnter(&pThis->CritSect);
-    if (RT_FAILURE(rc))
-        return rc;
-
-    LogFlowFunc(("[%s]\n", pStream->szName));
+    LogFlowFunc(("%s\n", pStream->szName));
 
     PPDMAUDIOSTREAM pHstStream = drvAudioGetHostStream(pStream);
     PPDMAUDIOSTREAM pGstStream = pHstStream->pPair;
+
+    int rc = VINF_SUCCESS;
 
     do
@@ -721,22 +752,9 @@
             uint32_t cSamplesToMix = AudioMixBufUsed(&pGstStream->MixBuf);
 
-            /* Has this stream marked as disabled but there still were guest streams relying
-             * on it? CheckpHstStreamif this stream now can be closed and do so, if possible. */
-            if (   (pHstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_PENDING_DISABLE)
-                && !cSamplesToMix)
-            {
-                rc = drvAudioStreamControlInternal(pThis, pGstStream, PDMAUDIOSTREAMCMD_DISABLE);
-                if (RT_SUCCESS(rc))
-                    rc = drvAudioStreamControlInternalBackend(pThis, pHstStream, PDMAUDIOSTREAMCMD_DISABLE);
-
-                if (RT_FAILURE(rc))
-                    LogFunc(("%s: Backend vetoed against closing output stream, rc=%Rrc\n", pHstStream->szName, rc));
-
-                break;
-            }
-
-            uint32_t cSamplesPlayed = 0;
-            if (hstStrmSts & PDMAUDIOSTRMSTS_FLAG_DATA_WRITABLE)
-            {
+            if (cSamplesToMix)
+            {
+                uint32_t cSamplesPlayed = 0;
+                if (hstStrmSts & PDMAUDIOSTRMSTS_FLAG_DATA_WRITABLE)
+                {
             /*    int rc2 = pThis->pHostDrvAudio->pfnStreamPlay(pThis->pHostDrvAudio, pHstStream, &cSamplesPlayed);
                 if (RT_SUCCESS(rc))
@@ -744,10 +762,10 @@
             }*/
 
-                if (cSamplesToMix)
                     rc = AudioMixBufMixToParent(&pGstStream->MixBuf, cSamplesToMix, &cSamplesMixed);
-            }
-
-            LogFlowFunc(("%s: %RU32/%RU32 samples mixed, %RU32 played\n",
-                         pHstStream->szName, cSamplesMixed, cSamplesToMix, cSamplesPlayed));
+
+                    LogFlowFunc(("%s: %RU32/%RU32 samples mixed, rc=%Rrc\n",
+                                 pHstStream->szName, cSamplesMixed, cSamplesToMix, rc));
+                }
+            }
         }
 
@@ -756,11 +774,4 @@
 
     } while (0);
-
-    int rc2 = RTCritSectLeave(&pThis->CritSect);
-    if (RT_SUCCESS(rc))
-        rc = rc2;
-
-    if (RT_FAILURE(rc))
-        LogFlowFuncLeaveRC(rc);
 
     return rc;
@@ -973,18 +984,41 @@
         AssertPtr(pGstStream);
 
-        PDMAUDIOSTRMSTS strmSts = pThis->pHostDrvAudio->pfnStreamGetStatus(pThis->pHostDrvAudio, pHstStream);
-
-        if (strmSts & PDMAUDIOSTRMSTS_FLAG_DATA_WRITABLE)
-        {
-            rc = pThis->pHostDrvAudio->pfnStreamPlay(pThis->pHostDrvAudio, pHstStream, &cSamplesPlayed);
-            if (RT_FAILURE(rc))
-            {
-                int rc3 = drvAudioStreamControlInternalBackend(pThis, pStream, PDMAUDIOSTREAMCMD_DISABLE);
-                AssertRC(rc3);
-            }
-        }
-
-        LogFlowFunc(("[%s] strmSts=0x%x, cSamplesPlayed=%RU32, rc=%Rrc\n", pStream->szName, strmSts, cSamplesPlayed, rc));
-
+        uint32_t cSamplesLive = AudioMixBufUsed(&pHstStream->MixBuf);
+        if (cSamplesLive)
+        {
+            PDMAUDIOSTRMSTS strmSts = pThis->pHostDrvAudio->pfnStreamGetStatus(pThis->pHostDrvAudio, pHstStream);
+            if (strmSts & PDMAUDIOSTRMSTS_FLAG_DATA_WRITABLE)
+            {
+                rc = pThis->pHostDrvAudio->pfnStreamPlay(pThis->pHostDrvAudio, pHstStream, &cSamplesPlayed);
+                if (RT_FAILURE(rc))
+                    drvAudioStreamControlInternalBackend(pThis, pHstStream, PDMAUDIOSTREAMCMD_DISABLE);
+            }
+
+            LogFlowFunc(("[%s] strmSts=0x%x, cSamplesPlayed=%RU32, rc=%Rrc\n", pStream->szName, strmSts, cSamplesPlayed, rc));
+
+            if (RT_SUCCESS(rc))
+            {
+                rc = drvAudioStreamIterateInternal(pThis, pStream);
+                if (RT_SUCCESS(rc))
+                    cSamplesLive = AudioMixBufUsed(&pHstStream->MixBuf);
+            }
+        }
+
+        if (!cSamplesLive)
+        {
+            /* Has the host stream marked as disabled but there still were guest streams relying
+             * on it? Check if the stream now can be closed and do so, if possible. */
+            if (pHstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_PENDING_DISABLE)
+            {
+                LogFunc(("%s: Closing pending stream\n", pHstStream->szName));
+                rc = drvAudioStreamControlInternalBackend(pThis, pHstStream, PDMAUDIOSTREAMCMD_DISABLE);
+                if (RT_SUCCESS(rc))
+                {
+                    pHstStream->fStatus &= ~PDMAUDIOSTRMSTS_FLAG_PENDING_DISABLE;
+                }
+                else
+                    LogFunc(("%s: Backend vetoed against closing output stream, rc=%Rrc\n", pHstStream->szName, rc));
+            }
+        }
     #if 0
             if (pStream->pPair)
@@ -1332,7 +1366,7 @@
         return;
 
-    PPDMAUDIOSTREAM pStream;
-    RTListForEach(&pThis->lstStreams, pStream, PDMAUDIOSTREAM, Node)
-        drvAudioStreamControlInternal(pThis, pStream, enmCmd);
+    PPDMAUDIOSTREAM pHstStream;
+    RTListForEach(&pThis->lstHstStreams, pHstStream, PDMAUDIOSTREAM, Node)
+        drvAudioStreamControlInternalBackend(pThis, pHstStream, enmCmd);
 }
 
@@ -1345,5 +1379,6 @@
     LogFlowFunc(("pThis=%p, pDrvIns=%p\n", pThis, pDrvIns));
 
-    RTListInit(&pThis->lstStreams);
+    RTListInit(&pThis->lstHstStreams);
+    RTListInit(&pThis->lstGstStreams);
 #ifdef VBOX_WITH_AUDIO_CALLBACKS
     RTListInit(&pThis->lstCBIn);
@@ -1647,10 +1682,16 @@
         AssertPtrBreakStmt(pHstStrm, rc = VERR_NO_MEMORY);
 
-        RTListAppend(&pThis->lstStreams, &pHstStrm->Node);
+        pHstStrm->enmCtx = PDMAUDIOSTREAMCTX_HOST;
+        pHstStrm->enmDir = pCfgHost->enmDir;
+
+        RTListAppend(&pThis->lstHstStreams, &pHstStrm->Node);
 
         pGstStrm = (PPDMAUDIOSTREAM)RTMemAllocZ(sizeof(PDMAUDIOSTREAM));
         AssertPtrBreakStmt(pGstStrm, rc = VERR_NO_MEMORY);
 
-        RTListAppend(&pThis->lstStreams, &pGstStrm->Node);
+        pGstStrm->enmCtx = PDMAUDIOSTREAMCTX_GUEST;
+        pGstStrm->enmDir = pCfgGuest->enmDir;
+
+        RTListAppend(&pThis->lstGstStreams, &pGstStrm->Node);
 
         /*
@@ -1670,6 +1711,4 @@
         }
 
-        pHstStrm->enmCtx   = PDMAUDIOSTREAMCTX_HOST;
-        pHstStrm->enmDir   = pCfgHost->enmDir;
         pHstStrm->fStatus |= PDMAUDIOSTRMSTS_FLAG_INITIALIZED;
         pHstStrm->pPair    = pGstStrm;
@@ -1706,6 +1745,4 @@
         }
 
-        pGstStrm->enmCtx   = PDMAUDIOSTREAMCTX_GUEST;
-        pGstStrm->enmDir   = pCfgGuest->enmDir;
         pGstStrm->fStatus |= PDMAUDIOSTRMSTS_FLAG_INITIALIZED;
         pGstStrm->pPair    = pHstStrm;
@@ -1719,21 +1756,4 @@
     if (RT_FAILURE(rc))
     {
-        if (   pHstStrm
-            && pHstStrm->enmCtx == PDMAUDIOSTREAMCTX_HOST)
-        {
-            if (pHstStrm->fStatus & PDMAUDIOSTRMSTS_FLAG_INITIALIZED)
-            {
-                rc = drvAudioStreamControlInternalBackend(pThis, pHstStrm, PDMAUDIOSTREAMCMD_DISABLE);
-                if (RT_SUCCESS(rc))
-                {
-                    rc = pThis->pHostDrvAudio->pfnStreamDestroy(pThis->pHostDrvAudio, pHstStrm);
-                    if (RT_SUCCESS(rc))
-                        pHstStrm->fStatus &= ~PDMAUDIOSTRMSTS_FLAG_INITIALIZED;
-                }
-            }
-
-            AssertMsgRC(rc, ("Host stream '%s' failed to uninit in backend: %Rrc\n",  pHstStrm->szName, rc));
-        }
-
         drvAudioStreamDestroyInternal(pThis, pGstStrm);
         pGstStrm = NULL;
@@ -1759,4 +1779,5 @@
         }
 
+        /* Always return the guest-side part to the device emulation. */
         *ppStream = pGstStrm;
     }
@@ -1815,8 +1836,5 @@
 {
     AssertPtrReturn(pInterface, false);
-    /* pStream is optional. */
-
-    if (!pStream)
-        return PDMAUDIOSTRMSTS_FLAG_NONE;
+    AssertPtrReturn(pStream,    VERR_INVALID_POINTER);
 
     PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface);
@@ -1834,8 +1852,26 @@
     return strmSts;
 }
+
+static DECLCALLBACK(int) drvAudioStreamSetVolume(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream, PPDMAUDIOVOLUME pVol)
+{
+    AssertPtrReturn(pInterface, VERR_INVALID_POINTER);
+    AssertPtrReturn(pStream,    VERR_INVALID_POINTER);
+    AssertPtrReturn(pVol,       VERR_INVALID_POINTER);
+
+    PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface);
+
+    LogFlowFunc(("%s: volL=%RU32, volR=%RU32, fMute=%RTbool\n", pStream->szName, pVol->uLeft, pVol->uRight, pVol->fMuted));
+
+    AudioMixBufSetVolume(&pStream->MixBuf, pVol);
+
+    return VINF_SUCCESS;
+}
 #endif
 
 static DECLCALLBACK(int) drvAudioStreamDestroy(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream)
 {
+    AssertPtrReturn(pInterface, VERR_INVALID_POINTER);
+    AssertPtrReturn(pStream,    VERR_INVALID_POINTER);
+
     PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface);
 
@@ -1851,7 +1887,40 @@
     if (RT_SUCCESS(rc))
     {
-        rc = drvAudioStreamDestroyInternal(pThis, pStream);
-        if (RT_SUCCESS(rc))
-            pStream = NULL;
+        PPDMAUDIOSTREAM pHstStream = drvAudioGetHostStream(pStream);
+        PPDMAUDIOSTREAM pGstStream = pHstStream ? pHstStream->pPair : pStream;
+
+        LogFlowFunc(("\tHost : %s\n", pHstStream ? pHstStream->szName : "<None>"));
+        LogFlowFunc(("\tGuest: %s\n", pGstStream ? pGstStream->szName : "<None>"));
+
+        /* Should prevent double frees. */
+        Assert(pHstStream != pGstStream);
+
+        if (pHstStream)
+        {
+            pHstStream->pPair = NULL;
+            RTListNodeRemove(&pHstStream->Node);
+        }
+
+        if (pGstStream)
+        {
+            pGstStream->pPair = NULL;
+            RTListNodeRemove(&pGstStream->Node);
+        }
+
+        if (pHstStream)
+        {
+            rc = drvAudioStreamDestroyInternal(pThis, pHstStream);
+            AssertRC(rc);
+
+            pHstStream = NULL;
+        }
+
+        if (pGstStream)
+        {
+            rc = drvAudioStreamDestroyInternal(pThis, pGstStream);
+            AssertRC(rc);
+
+            pGstStream = NULL;
+        }
     }
 
@@ -1872,7 +1941,5 @@
         rc = rc2;
 
-    if (RT_FAILURE(rc))
-        LogFlowFunc(("Failed with %Rrc\n", rc));
-
+    LogFlowFuncLeaveRC(rc);
     return rc;
 }
@@ -1880,10 +1947,7 @@
 static int drvAudioStreamDestroyInternalBackend(PDRVAUDIO pThis, PPDMAUDIOSTREAM pHstStream)
 {
-    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
-
-    if (!pHstStream)
-        return VINF_SUCCESS;
-
-    AssertPtr(pThis->pHostDrvAudio);
+    AssertPtrReturn(pThis,      VERR_INVALID_POINTER);
+    AssertPtrReturn(pHstStream, VERR_INVALID_POINTER);
+
     AssertMsg(pHstStream->enmCtx == PDMAUDIOSTREAMCTX_HOST,
               ("Stream '%s' is not a host stream and therefore has no backend\n", pHstStream->szName));
@@ -1895,14 +1959,9 @@
     if (pHstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_INITIALIZED)
     {
-        rc = drvAudioStreamControlInternalBackend(pThis, pHstStream, PDMAUDIOSTREAMCMD_DISABLE);
+        if (pThis->pHostDrvAudio)
+            rc = pThis->pHostDrvAudio->pfnStreamDestroy(pThis->pHostDrvAudio, pHstStream);
         if (RT_SUCCESS(rc))
-        {
-            rc = pThis->pHostDrvAudio->pfnStreamDestroy(pThis->pHostDrvAudio, pHstStream);
-            if (RT_SUCCESS(rc))
-                pHstStream->fStatus &= ~PDMAUDIOSTRMSTS_FLAG_INITIALIZED;
-        }
-    }
-    else
-        rc = VINF_SUCCESS;
+            pHstStream->fStatus &= ~PDMAUDIOSTRMSTS_FLAG_INITIALIZED;
+    }
 
     LogFlowFunc(("%s: Returning %Rrc\n", pHstStream->szName, rc));
@@ -1912,61 +1971,43 @@
 static int drvAudioStreamDestroyInternal(PDRVAUDIO pThis, PPDMAUDIOSTREAM pStream)
 {
-    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
-    /* pStream is optional. */
-
-    if (!pStream)
-        return VINF_SUCCESS;
+    AssertPtrReturn(pThis,   VERR_INVALID_POINTER);
+    AssertPtrReturn(pStream, VERR_INVALID_POINTER);
 
     LogFlowFunc(("%s: cRefs=%RU32\n", pStream->szName, pStream->cRefs));
 
-    /* Try to find out which stream is which -- both streams could be destroyed (NULL)
-     * already, so do some additional checking here. */
-    PPDMAUDIOSTREAM pHstStream = drvAudioGetHostStream(pStream);
-    PPDMAUDIOSTREAM pGstStream = pHstStream ? pHstStream->pPair : pStream;
-
-    if (   (   pHstStream
-            && pHstStream->cRefs > 1)
-        || (   pGstStream
-            && pGstStream->cRefs > 1)
-       )
-    {
+    if (pStream->cRefs > 1)
         return VERR_WRONG_ORDER;
-    }
 
     int rc = VINF_SUCCESS;
 
-    if (pGstStream)
-    {
-        AssertMsg(pGstStream->enmCtx == PDMAUDIOSTREAMCTX_GUEST,
-                  ("Stream '%s' is not a guest stream\n", pGstStream->szName));
-
-        rc = drvAudioStreamControlInternal(pThis, pGstStream, PDMAUDIOSTREAMCMD_DISABLE);
-    }
-
-    if (RT_SUCCESS(rc))
-        rc = drvAudioStreamControlInternalBackend(pThis, pHstStream, PDMAUDIOSTREAMCMD_DISABLE);
-
-    if (RT_SUCCESS(rc))
-    {
-        /* Unlink from pair. */
-        if (pStream->pPair)
-        {
-            pStream->pPair->pPair = NULL;
-            pStream->pPair = NULL;
-        }
-
+    if (pStream->enmCtx == PDMAUDIOSTREAMCTX_GUEST)
+    {
+        if (pStream->fStatus & PDMAUDIOSTRMSTS_FLAG_INITIALIZED)
+        {
+            rc = drvAudioStreamControlInternal(pThis, pStream, PDMAUDIOSTREAMCMD_DISABLE);
+            if (RT_SUCCESS(rc))
+                pStream->fStatus &= ~PDMAUDIOSTRMSTS_FLAG_INITIALIZED;
+        }
+    }
+    else if (pStream->enmCtx == PDMAUDIOSTREAMCTX_HOST)
+    {
+        rc = drvAudioStreamDestroyInternalBackend(pThis, pStream);
+    }
+    else
+        AssertFailedReturn(VERR_NOT_IMPLEMENTED);
+
+    if (RT_SUCCESS(rc))
+    {
         /* Destroy mixing buffer. */
         AudioMixBufDestroy(&pStream->MixBuf);
 
-        /* Remove from list. */
-        RTListNodeRemove(&pStream->Node);
-
-        RTMemFree(pStream);
-        pStream = NULL;
-    }
-
-    if (RT_FAILURE(rc))
-        LogFunc(("Failed with %Rrc\n", rc));
-
+        if (pStream)
+        {
+            RTMemFree(pStream);
+            pStream = NULL;
+        }
+    }
+
+    LogFlowFunc(("Returning %Rrc\n", rc));
     return rc;
 }
@@ -2001,7 +2042,10 @@
     LogFlowFuncEnter();
 
-    PPDMAUDIOSTREAM pStream, pStreamNext;
-    RTListForEachSafe(&pThis->lstStreams, pStream, pStreamNext, PDMAUDIOSTREAM, Node)
-        drvAudioStreamDestroyInternal(pThis, pStream);
+    /* Just destroy the host stream on the backend side.
+     * The rest will either be destructed by the device emulation or
+     * in drvAudioDestruct(). */
+    PPDMAUDIOSTREAM pStream;
+    RTListForEach(&pThis->lstHstStreams, pStream, PDMAUDIOSTREAM, Node)
+        drvAudioStreamDestroyInternalBackend(pThis, pStream);
 
     /*
@@ -2047,4 +2091,5 @@
     pThis->IAudioConnector.pfnStreamIterate     = drvAudioStreamIterate;
     pThis->IAudioConnector.pfnStreamGetStatus   = drvAudioStreamGetStatus;
+    pThis->IAudioConnector.pfnStreamSetVolume   = drvAudioStreamSetVolume;
     pThis->IAudioConnector.pfnStreamPlay        = drvAudioStreamPlay;
 #ifdef VBOX_WITH_AUDIO_CALLBACKS
@@ -2105,10 +2150,8 @@
      *       do this in drvAudioPowerOff() instead.
      */
-    PPDMAUDIOSTREAM pStream, pStreamNext;
-    RTListForEachSafe(&pThis->lstStreams, pStream, pStreamNext, PDMAUDIOSTREAM, Node)
-        drvAudioStreamDestroyInternal(pThis, pStream);
 
     /* Sanity. */
-    Assert(RTListIsEmpty(&pThis->lstStreams));
+    Assert(RTListIsEmpty(&pThis->lstHstStreams));
+    Assert(RTListIsEmpty(&pThis->lstGstStreams));
 
 #ifdef VBOX_WITH_AUDIO_CALLBACKS
Index: /trunk/src/VBox/Devices/Audio/DrvAudio.h
===================================================================
--- /trunk/src/VBox/Devices/Audio/DrvAudio.h	(revision 61385)
+++ /trunk/src/VBox/Devices/Audio/DrvAudio.h	(revision 61386)
@@ -90,6 +90,8 @@
     /** Pointer to audio driver below us. */
     PPDMIHOSTAUDIO          pHostDrvAudio;
-    /** List of input/output audio streams. */
-    RTLISTANCHOR            lstStreams;
+    /** List of host input/output audio streams. */
+    RTLISTANCHOR            lstHstStreams;
+    /** List of guest input/output audio streams. */
+    RTLISTANCHOR            lstGstStreams;
     /** Max. number of free input streams.
      *  UINT32_MAX for unlimited streams. */
Index: /trunk/src/VBox/Devices/Audio/DrvHostPulseAudio.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DrvHostPulseAudio.cpp	(revision 61385)
+++ /trunk/src/VBox/Devices/Audio/DrvHostPulseAudio.cpp	(revision 61386)
@@ -169,4 +169,7 @@
 static void paSignalWaiter(PDRVHOSTPULSEAUDIO pThis)
 {
+    if (!pThis)
+        return;
+
     pThis->fLoopWait = true;
     pa_threaded_mainloop_signal(pThis->pMainLoop, 0);
@@ -1143,7 +1146,7 @@
         pa_stream_unref(pStrm->pPAStream);
 
+        pStrm->pPAStream = NULL;
+
         pa_threaded_mainloop_unlock(pThis->pMainLoop);
-
-        pStrm->pPAStream = NULL;
     }
 
@@ -1175,7 +1178,7 @@
         pa_stream_unref(pStrm->pPAStream);
 
+        pStrm->pPAStream = NULL;
+
         pa_threaded_mainloop_unlock(pThis->pMainLoop);
-
-        pStrm->pPAStream = NULL;
     }
 
@@ -1236,5 +1239,5 @@
             {
                 rc = paWaitFor(pThis, pa_stream_trigger(pStrm->pPAStream, paStreamCbSuccess, pStrm));
-                if (RT_LIKELY(RT_SUCCESS(rc)))
+                if (RT_SUCCESS(rc))
                     pStrm->pDrainOp = pa_stream_drain(pStrm->pPAStream, paStreamCbDrain, pStrm);
             }
@@ -1355,6 +1358,8 @@
     if (pCfg->enmDir == PDMAUDIODIR_IN)
         rc = paCreateStreamIn(pInterface,  pStream, pCfg, pcSamples);
+    else if (pStream->enmDir == PDMAUDIODIR_OUT)
+        rc = paCreateStreamOut(pInterface, pStream, pCfg, pcSamples);
     else
-        rc = paCreateStreamOut(pInterface, pStream, pCfg, pcSamples);
+        AssertFailedReturn(VERR_NOT_IMPLEMENTED);
 
     LogFlowFunc(("%s: rc=%Rrc\n", pStream->szName, rc));
@@ -1366,11 +1371,16 @@
     AssertPtrReturn(pInterface, VERR_INVALID_POINTER);
     AssertPtrReturn(pStream,    VERR_INVALID_POINTER);
+
+    LogFlowFunc(("%s\n", pStream->szName));
 
     int rc;
     if (pStream->enmDir == PDMAUDIODIR_IN)
         rc = paDestroyStreamIn(pInterface,  pStream);
+    else if (pStream->enmDir == PDMAUDIODIR_OUT)
+        rc = paDestroyStreamOut(pInterface, pStream);
     else
-        rc = paDestroyStreamOut(pInterface, pStream);
-
+        AssertFailedReturn(VERR_NOT_IMPLEMENTED);
+
+    LogFlowFunc(("%s: rc=%Rrc\n", pStream->szName, rc));
     return rc;
 }
@@ -1387,7 +1397,10 @@
     if (pStream->enmDir == PDMAUDIODIR_IN)
         rc = paControlStreamIn(pInterface,  pStream, enmStreamCmd);
+    else if (pStream->enmDir == PDMAUDIODIR_OUT)
+        rc = paControlStreamOut(pInterface, pStream, enmStreamCmd);
     else
-        rc = paControlStreamOut(pInterface, pStream, enmStreamCmd);
-
+        AssertFailedReturn(VERR_NOT_IMPLEMENTED);
+
+    LogFlowFunc(("%s: rc=%Rrc\n", pStream->szName, rc));
     return rc;
 }
