Index: /trunk/src/VBox/Devices/Audio/AudioMixBuffer.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/AudioMixBuffer.cpp	(revision 55064)
+++ /trunk/src/VBox/Devices/Audio/AudioMixBuffer.cpp	(revision 55065)
@@ -48,5 +48,5 @@
 #include "AudioMixBuffer.h"
 
-#if 1
+#if 0
 # define AUDMIXBUF_LOG(x) LogFlowFunc(x)
 #else
@@ -301,5 +301,6 @@
         _aType *pSrc = (_aType *)pvSrc; \
         uint32_t cSamples = (uint32_t)RT_MIN(pOpts->cSamples, cbSrc / sizeof(_aType)); \
-        AUDMIXBUF_MACRO_LOG(("cSamples=%RU32, sizeof(%zu)\n", pOpts->cSamples, sizeof(_aType))); \
+        AUDMIXBUF_MACRO_LOG(("cSamples=%RU32, sizeof(%zu), lVol=%RU32, rVol=%RU32\n", \
+                             pOpts->cSamples, sizeof(_aType), pOpts->Volume.uLeft, pOpts->Volume.uRight)); \
         for (uint32_t i = 0; i < cSamples; i++) \
         { \
@@ -363,15 +364,15 @@
     }
 
-/* audioMixBufConvToS8: 8 bit, signed. */
+/* audioMixBufConvXXXS8: 8 bit, signed. */
 AUDMIXBUF_CONVERT(S8 /* Name */,  int8_t,   INT8_MIN  /* Min */, INT8_MAX   /* Max */, true  /* fSigned */, 8  /* cShift */)
-/* audioMixBufConvToU8: 8 bit, unsigned. */
+/* audioMixBufConvXXXU8: 8 bit, unsigned. */
 AUDMIXBUF_CONVERT(U8 /* Name */,  uint8_t,  0         /* Min */, UINT8_MAX  /* Max */, false /* fSigned */, 8  /* cShift */)
-/* audioMixBufConvToS16: 16 bit, signed. */
+/* audioMixBufConvXXXS16: 16 bit, signed. */
 AUDMIXBUF_CONVERT(S16 /* Name */, int16_t,  INT16_MIN /* Min */, INT16_MAX  /* Max */, true  /* fSigned */, 16 /* cShift */)
-/* audioMixBufConvToU16: 16 bit, unsigned. */
+/* audioMixBufConvXXXU16: 16 bit, unsigned. */
 AUDMIXBUF_CONVERT(U16 /* Name */, uint16_t, 0         /* Min */, UINT16_MAX /* Max */, false /* fSigned */, 16 /* cShift */)
-/* audioMixBufConvToS32: 32 bit, signed. */
+/* audioMixBufConvXXXS32: 32 bit, signed. */
 AUDMIXBUF_CONVERT(S32 /* Name */, int32_t,  INT32_MIN /* Min */, INT32_MAX  /* Max */, true  /* fSigned */, 32 /* cShift */)
-/* audioMixBufConvToU32: 32 bit, unsigned. */
+/* audioMixBufConvXXXU32: 32 bit, unsigned. */
 AUDMIXBUF_CONVERT(U32 /* Name */, uint32_t, 0         /* Min */, UINT32_MAX /* Max */, false /* fSigned */, 32 /* cShift */)
 
@@ -636,6 +637,6 @@
     /* Set initial volume to max. */
     pMixBuf->Volume.fMuted = false;
-    pMixBuf->Volume.uLeft  = UINT32_MAX;
-    pMixBuf->Volume.uRight = UINT32_MAX;
+    pMixBuf->Volume.uLeft  = 0x7F;
+    pMixBuf->Volume.uRight = 0x7F;
 
     /* Prevent division by zero.
@@ -1120,7 +1121,11 @@
     AssertPtrReturnVoid(pVol);
 
-    AUDMIXBUF_LOG(("%s: lVol=%RU32, rVol=%RU32\n", pMixBuf->pszName, pVol->uLeft, pVol->uRight));
-
-    pMixBuf->Volume = *pVol;
+    LogFlowFunc(("%s: lVol=%RU32, rVol=%RU32\n", pMixBuf->pszName, pVol->uLeft, pVol->uRight));
+
+    pMixBuf->Volume.fMuted = pVol->fMuted;
+    pMixBuf->Volume.uLeft  = uint64_t(0x100000000 * pVol->uLeft ) / 255;
+    pMixBuf->Volume.uRight = uint64_t(0x100000000 * pVol->uRight) / 255;
+
+    LogFlowFunc(("\t-> lVol=%RU32, rVol=%RU32\n", pMixBuf->Volume.uLeft, pMixBuf->Volume.uRight));
 }
 
@@ -1346,8 +1351,11 @@
     uint32_t cWrittenTotal = 0;
 
+    AUDMIXBUF_CONVOPTS convOpts;
+    convOpts.Volume = pMixBuf->Volume;
+
     /* Anything to do at all? */
     if (cLenDst1)
     {
-        AUDMIXBUF_CONVOPTS convOpts = { cLenDst1, pMixBuf->Volume };
+        convOpts.cSamples = cLenDst1;
         cWrittenTotal = pConv(pSamplesDst1, pvBuf, cbBuf, &convOpts);
     }
@@ -1359,5 +1367,5 @@
         AssertPtr(pSamplesDst2);
 
-        AUDMIXBUF_CONVOPTS convOpts = { cLenDst2, pMixBuf->Volume };
+        convOpts.cSamples = cLenDst2;
         cWrittenTotal += pConv(pSamplesDst2, (uint8_t *)pvBuf + AUDIOMIXBUF_S2B(pMixBuf, cLenDst1), cbBuf, &convOpts);
     }
Index: /trunk/src/VBox/Devices/Audio/AudioMixer.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/AudioMixer.cpp	(revision 55064)
+++ /trunk/src/VBox/Devices/Audio/AudioMixer.cpp	(revision 55065)
@@ -37,4 +37,8 @@
 #include <VBox/log.h>
 
+
+int audioMixerUpdateSinkVolume(PAUDMIXSINK pSink, const PPDMAUDIOVOLUME pVolMaster, const PPDMAUDIOVOLUME pVolSink);
+
+
 int audioMixerAddSink(PAUDIOMIXER pMixer, const char *pszName, AUDMIXSINKDIR enmDir, PAUDMIXSINK *ppSink)
 {
@@ -61,6 +65,6 @@
             /* Set initial volume to max. */
             pSink->Volume.fMuted = false;
-            pSink->Volume.uLeft  = UINT32_MAX;
-            pSink->Volume.uRight = UINT32_MAX;
+            pSink->Volume.uLeft  = 0x7F;
+            pSink->Volume.uRight = 0x7F;
 
             RTListAppend(&pMixer->lstSinks, &pSink->Node);
@@ -106,6 +110,6 @@
         pSink->cStreams++;
 
-        LogFlowFunc(("pSink=%p, pStream=%p, cStreams=%RU8\n",
-                     pSink, pMixStream, pSink->cStreams));
+        LogFlowFunc(("%s: pStream=%p, cStreams=%RU8\n",
+                     pSink->pszName, pMixStream, pSink->cStreams));
 
         if (ppStream)
@@ -144,6 +148,6 @@
         pSink->cStreams++;
 
-        LogFlowFunc(("pSink=%p, pStream=%p, cStreams=%RU8\n",
-                     pSink, pMixStream, pSink->cStreams));
+        LogFlowFunc(("%s: pStream=%p, cStreams=%RU8\n",
+                     pSink->pszName, pMixStream, pSink->cStreams));
 
         if (ppStream)
@@ -205,5 +209,5 @@
     if (pMixer)
     {
-        LogFlowFunc(("Destroying %p ...\n", pMixer));
+        LogFlowFunc(("Destroying %s ...\n", pMixer->pszName));
 
         PAUDMIXSINK pSink = RTListGetFirst(&pMixer->lstSinks, AUDMIXSINK, Node);
@@ -260,4 +264,19 @@
 
     return cStreams;
+}
+
+void audioMixerInvalidate(PAUDIOMIXER pMixer)
+{
+    AssertPtrReturnVoid(pMixer);
+
+    LogFlowFunc(("%s: Invalidating ...\n", pMixer->pszName));
+
+    /* Propagate new master volume to all connected sinks. */
+    PAUDMIXSINK pSink;
+    RTListForEach(&pMixer->lstSinks, pSink, AUDMIXSINK, Node)
+    {
+        int rc2 = audioMixerUpdateSinkVolume(pSink, &pMixer->VolMaster, &pSink->Volume);
+        AssertRC(rc2);
+    }
 }
 
@@ -356,6 +375,6 @@
     pMixer->cSinks--;
 
-    LogFlowFunc(("pMixer=%p, pSink=%p, cSinks=%RU8\n",
-                 pMixer, pSink, pMixer->cSinks));
+    LogFlowFunc(("%s: pSink=%s, cSinks=%RU8\n",
+                 pMixer->pszName, pSink->pszName, pMixer->cSinks));
 
     audioMixerDestroySink(pSink);
@@ -372,6 +391,9 @@
     pSink->cStreams--;
 
-    LogFlowFunc(("pSink=%p, pStream=%p, cStreams=%RU8\n",
-                 pSink, pStream, pSink->cStreams));
+    const char *pszStream = pSink->enmDir == AUDMIXSINKDIR_INPUT
+                          ? pStream->pIn->MixBuf.pszName : pStream->pOut->MixBuf.pszName;
+
+    LogFlowFunc(("%s: pStream=%s, cStreams=%RU8\n",
+                 pSink->pszName, pszStream, pSink->cStreams));
 
     audioMixerDestroyStream(pStream);
@@ -389,10 +411,8 @@
 }
 
-static PDMAUDIOVOLUME audioMixerTranslateVolume(const PPDMAUDIOVOLUME pVolMaster, PPDMAUDIOVOLUME pVol)
-{
-    PDMAUDIOVOLUME volMaster = *pVolMaster;
-
-    uint32_t u32VolumeLeft  = (uint32_t)pVol->uLeft;
-    uint32_t u32VolumeRight = (uint32_t)pVol->uRight;
+static inline PDMAUDIOVOLUME audioMixerVolCalc(PPDMAUDIOVOLUME pVol)
+{
+    uint32_t u32VolumeLeft  = pVol->uLeft;
+    uint32_t u32VolumeRight = pVol->uRight;
     /* 0x00..0xff => 0x01..0x100 */
     if (u32VolumeLeft)
@@ -401,49 +421,47 @@
         u32VolumeRight++;
 
-    volMaster.uLeft  = u32VolumeLeft  * 0x800000; /* Maximum is 0x80000000 */
-    volMaster.uRight = u32VolumeRight * 0x800000; /* Maximum is 0x80000000 */
-
     PDMAUDIOVOLUME volOut;
-    volOut.fMuted = volMaster.fMuted || pVol->fMuted;
-    volOut.uLeft  = ASMMultU64ByU32DivByU32(volMaster.uLeft,  pVol->uLeft,  0x80000000U); /* Maximum is 0x80000000U */
-    volOut.uRight = ASMMultU64ByU32DivByU32(volMaster.uRight, pVol->uRight, 0x80000000U); /* Maximum is 0x80000000U */
-
-    LogFlowFunc(("pMaster=%p, lVol=%RU32, rVol=%RU32\n",
-                 pVolMaster, pVolMaster->uLeft, pVolMaster->uRight));
-    LogFlowFunc(("pVol=%p, lVol=%RU32, rVol=%RU32 => lVol=%RU32, rVol=%RU32\n",
-                 pVol, pVol->uLeft, pVol->uRight, volOut.uLeft, volOut.uRight));
+    volOut.fMuted = pVol->fMuted;
+    volOut.uLeft  = u32VolumeLeft  * 0x80000000; /* Maximum is 0x80000000 */
+    volOut.uRight = u32VolumeRight * 0x80000000; /* Maximum is 0x80000000 */
 
     return volOut;
 }
 
-int audioMixerSetMasterVolume(PAUDIOMIXER pMixer, PPDMAUDIOVOLUME pVol)
-{
-    AssertPtrReturn(pMixer, VERR_INVALID_POINTER);
-    AssertPtrReturn(pVol, VERR_INVALID_POINTER);
-
-    pMixer->VolMaster = audioMixerTranslateVolume(&pMixer->VolMaster,  pVol);
-#if 0
-        .uLeft  = pVol->uLeft  * 0x800000; /* maximum is 0x80000000 */
-    pMixer->VolMaster.uRight = pVol->uRight * 0x800000; /* maximum is 0x80000000 */
-#endif
-    LogFlowFunc(("%s: lVol=%RU32, rVol=%RU32 => lVol=%RU32, rVol=%RU32\n",
-                  pVol->uLeft, pVol->uRight, pMixer->VolMaster.uLeft, pMixer->VolMaster.uRight));
-
-    return VINF_SUCCESS;
-}
-
-int audioMixerSetSinkVolume(PAUDMIXSINK pSink, PPDMAUDIOVOLUME pVol)
-{
-    AssertPtrReturn(pSink, VERR_INVALID_POINTER);
-    AssertPtrReturn(pVol, VERR_INVALID_POINTER);
-
-    LogFlowFunc(("%s: lVol=%RU32, rVol=%RU32\n", pSink->pszName, pVol->uLeft, pVol->uRight));
-
-    pSink->Volume.uLeft  = pVol->uLeft  * 0x808080; /* Maximum is INT_MAX = 0x7fffffff */
-    pSink->Volume.uRight = pVol->uRight * 0x808080; /* Maximum is INT_MAX = 0x7fffffff */
-
-    /** @todo Apply the mixer's master volume to it. */
+static inline PDMAUDIOVOLUME audioMixerVolMix(const PPDMAUDIOVOLUME pVolMaster, PPDMAUDIOVOLUME pVol)
+{
+    PDMAUDIOVOLUME volOut;
+    volOut.fMuted = pVolMaster->fMuted || pVol->fMuted;
+    volOut.uLeft  = ASMMultU64ByU32DivByU32(pVolMaster->uLeft,  pVol->uLeft,  0x80000000U); /* Maximum is 0x80000000U */
+    volOut.uRight = ASMMultU64ByU32DivByU32(pVolMaster->uRight, pVol->uRight, 0x80000000U); /* Maximum is 0x80000000U */
+
+    LogFlowFunc(("pMaster=%p, fMuted=%RTbool, lVol=%RU32, rVol=%RU32\n",
+                 pVolMaster, pVolMaster->fMuted, pVolMaster->uLeft, pVolMaster->uRight));
+    LogFlowFunc(("pVol=%p, fMuted=%RTbool, lVol=%RU32, rVol=%RU32 => fMuted=%RTbool, lVol=%RU32, rVol=%RU32\n",
+                 pVol, pVol->fMuted, pVol->uLeft, pVol->uRight, volOut.fMuted, volOut.uLeft, volOut.uRight));
+
+    return volOut;
+}
+
+int audioMixerUpdateSinkVolume(PAUDMIXSINK pSink, const PPDMAUDIOVOLUME pVolMaster, const PPDMAUDIOVOLUME pVolSink)
+{
+    AssertPtrReturn(pSink,      VERR_INVALID_POINTER);
+    AssertPtrReturn(pVolMaster, VERR_INVALID_POINTER);
+    AssertPtrReturn(pVolSink,   VERR_INVALID_POINTER);
+
+    LogFlowFunc(("Master fMuted=%RTbool, lVol=%RU32, rVol=%RU32\n",
+                  pVolMaster->fMuted, pVolMaster->uLeft, pVolMaster->uRight));
+    LogFlowFunc(("%s: fMuted=%RTbool, lVol=%RU32, rVol=%RU32\n",
+                  pSink->pszName, pSink->Volume.fMuted, pSink->Volume.uLeft, pSink->Volume.uRight));
 
     /** @todo Very crude implementation for now -- needs more work! */
+
+    PDMAUDIOVOLUME volSink;
+    volSink.fMuted  = pVolMaster->fMuted || pVolSink->fMuted;
+    volSink.uLeft   = (pVolSink->uLeft  * pVolMaster->uLeft)  / UINT8_MAX;
+    volSink.uRight  = (pVolSink->uRight * pVolMaster->uRight) / UINT8_MAX;
+
+    LogFlowFunc(("\t-> fMuted=%RTbool, lVol=%RU32, rVol=%RU32\n",
+                  volSink.fMuted, volSink.uLeft, volSink.uRight));
 
     bool fOut = pSink->enmDir == AUDMIXSINKDIR_OUTPUT;
@@ -454,7 +472,7 @@
     {
         if (fOut)
-            audioMixBufSetVolume(&pStream->pOut->MixBuf, &pSink->Volume);
+            audioMixBufSetVolume(&pStream->pOut->MixBuf, &volSink);
         else
-            audioMixBufSetVolume(&pStream->pIn->MixBuf,  &pSink->Volume);
+            audioMixBufSetVolume(&pStream->pIn->MixBuf,  &volSink);
     }
 
@@ -462,2 +480,28 @@
 }
 
+int audioMixerSetMasterVolume(PAUDIOMIXER pMixer, PPDMAUDIOVOLUME pVol)
+{
+    AssertPtrReturn(pMixer, VERR_INVALID_POINTER);
+    AssertPtrReturn(pVol,   VERR_INVALID_POINTER);
+
+    pMixer->VolMaster = *pVol; //= audioMixerVolCalc(pVol);
+
+    LogFlowFunc(("%s: lVol=%RU32, rVol=%RU32 => fMuted=%RTbool, lVol=%RU32, rVol=%RU32\n",
+                 pMixer->pszName, pVol->uLeft, pVol->uRight,
+                 pMixer->VolMaster.fMuted, pMixer->VolMaster.uLeft, pMixer->VolMaster.uRight));
+
+    audioMixerInvalidate(pMixer);
+    return VINF_SUCCESS;
+}
+
+int audioMixerSetSinkVolume(PAUDMIXSINK pSink, PPDMAUDIOVOLUME pVol)
+{
+    AssertPtrReturn(pSink, VERR_INVALID_POINTER);
+    AssertPtrReturn(pVol,  VERR_INVALID_POINTER);
+
+    LogFlowFunc(("%s: fMuted=%RTbool, lVol=%RU32, rVol=%RU32\n", pSink->pszName, pVol->fMuted, pVol->uLeft, pVol->uRight));
+
+    AssertPtr(pSink->pParent);
+    return audioMixerUpdateSinkVolume(pSink, &pSink->pParent->VolMaster, pVol);
+}
+
Index: /trunk/src/VBox/Devices/Audio/AudioMixer.h
===================================================================
--- /trunk/src/VBox/Devices/Audio/AudioMixer.h	(revision 55064)
+++ /trunk/src/VBox/Devices/Audio/AudioMixer.h	(revision 55065)
@@ -99,4 +99,5 @@
 void audioMixerDestroy(PAUDIOMIXER pMixer);
 uint32_t audioMixerGetStreamCount(PAUDIOMIXER pMixer);
+void audioMixerInvalidate(PAUDIOMIXER pMixer);
 int audioMixerProcessSinkIn(PAUDMIXSINK pSink, AUDMIXOP enmOp, void *pvBuf, size_t cbBuf, uint32_t *pcbProcessed);
 int audioMixerProcessSinkOut(PAUDMIXSINK pSink, AUDMIXOP enmOp, const void *pvBuf, size_t cbBuf, uint32_t *pcbProcessed);
Index: /trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevIchAc97.cpp	(revision 55064)
+++ /trunk/src/VBox/Devices/Audio/DevIchAc97.cpp	(revision 55065)
@@ -717,4 +717,6 @@
         rc = VINF_SUCCESS;
     }
+
+    audioMixerInvalidate(pThis->pMixer);
 #else
     if (freq)
@@ -847,5 +849,5 @@
     lvol = 255 * lvol / VOL_MASK;
 
-    LogFunc(("mt=%ld, val=%RU32\n", mt, val));
+    LogFunc(("mt=%ld, val=%RU32, mute=%RTbool\n", mt, val, RT_BOOL(mute)));
 
 #ifdef SOFT_VOLUME
@@ -981,4 +983,31 @@
         audioMixerDestroy(pThis->pMixer);
         pThis->pMixer = NULL;
+    }
+
+    int rc2 = audioMixerCreate("AC'97 Mixer", 0 /* uFlags */, &pThis->pMixer);
+    if (RT_SUCCESS(rc2))
+    {
+        /* Set a default audio format for our mixer. */
+        PDMAUDIOSTREAMCFG streamCfg;
+        streamCfg.uHz           = 41000;
+        streamCfg.cChannels     = 2;
+        streamCfg.enmFormat     = AUD_FMT_S16;
+        streamCfg.enmEndianness = PDMAUDIOHOSTENDIANESS;
+
+        rc2 = audioMixerSetDeviceFormat(pThis->pMixer, &streamCfg);
+        AssertRC(rc2);
+
+        /* Add all required audio sinks. */
+        rc2 = audioMixerAddSink(pThis->pMixer, "[Playback] PCM Output",
+                               AUDMIXSINKDIR_OUTPUT, &pThis->pSinkOutput);
+        AssertRC(rc2);
+
+        rc2 = audioMixerAddSink(pThis->pMixer, "[Recording] Line In",
+                                AUDMIXSINKDIR_INPUT, &pThis->pSinkLineIn);
+        AssertRC(rc2);
+
+        rc2 = audioMixerAddSink(pThis->pMixer, "[Recording] Microphone In",
+                                AUDMIXSINKDIR_INPUT, &pThis->pSinkMicIn);
+        AssertRC(rc2);
     }
 #endif /* VBOX_WITH_PDM_AUDIO_DRIVER */
@@ -1029,33 +1058,4 @@
 #endif
 
-#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
-    int rc2 = audioMixerCreate("AC'97 Mixer", 0 /* uFlags */, &pThis->pMixer);
-    if (RT_SUCCESS(rc2))
-    {
-        /* Set a default audio format for our mixer. */
-        PDMAUDIOSTREAMCFG streamCfg;
-        streamCfg.uHz           = 41000;
-        streamCfg.cChannels     = 2;
-        streamCfg.enmFormat     = AUD_FMT_S16;
-        streamCfg.enmEndianness = PDMAUDIOHOSTENDIANESS;
-
-        rc2 = audioMixerSetDeviceFormat(pThis->pMixer, &streamCfg);
-        AssertRC(rc2);
-
-        /* Add all required audio sinks. */
-        rc2 = audioMixerAddSink(pThis->pMixer, "[Playback] PCM Output",
-                               AUDMIXSINKDIR_OUTPUT, &pThis->pSinkOutput);
-        AssertRC(rc2);
-
-        rc2 = audioMixerAddSink(pThis->pMixer, "[Recording] Line In",
-                                AUDMIXSINKDIR_INPUT, &pThis->pSinkLineIn);
-        AssertRC(rc2);
-
-        rc2 = audioMixerAddSink(pThis->pMixer, "[Recording] Microphone In",
-                                AUDMIXSINKDIR_INPUT, &pThis->pSinkMicIn);
-        AssertRC(rc2);
-    }
-#endif
-
     /* Reset all streams. */
     uint8_t active[LAST_INDEX] = { 0 };
@@ -1328,20 +1328,24 @@
         if (RT_SUCCESS(rc))
         {
+#ifdef DEBUG_TIMER
             LogFlowFunc(("\tLUN#%RU8: [1] cbIn=%RU32, cbOut=%RU32\n", pDrv->uLUN, cbIn, cbOut));
-
+#endif
             if (cSamplesLive)
             {
                 uint32_t cSamplesPlayed;
                 int rc2 = pDrv->pConnector->pfnPlayOut(pDrv->pConnector, &cSamplesPlayed);
+#ifdef DEBUG_TIMER
                 if (RT_SUCCESS(rc2))
                     LogFlowFunc(("LUN#%RU8: cSamplesLive=%RU32, cSamplesPlayed=%RU32\n",
                                  pDrv->uLUN, cSamplesLive, cSamplesPlayed));
-
+#endif
                 if (cSamplesPlayed)
                 {
                     rc = pDrv->pConnector->pfnQueryStatus(pDrv->pConnector,
                                                           &cbIn, &cbOut, &cSamplesLive);
+#ifdef DEBUG_TIMER
                     if (RT_SUCCESS(rc))
                         LogFlowFunc(("\tLUN#%RU8: [2] cbIn=%RU32, cbOut=%RU32\n", pDrv->uLUN, cbIn, cbOut));
+#endif
                 }
             }
@@ -1352,5 +1356,7 @@
     }
 
+#ifdef DEBUG_TIMER
     LogFlowFunc(("cbInMax=%RU32, cbOutMin=%RU32\n", cbInMax, cbOutMin));
+#endif
 
     if (cbOutMin == UINT32_MAX)
Index: /trunk/src/VBox/Devices/Audio/DevIchHda.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevIchHda.cpp	(revision 55064)
+++ /trunk/src/VBox/Devices/Audio/DevIchHda.cpp	(revision 55065)
@@ -564,4 +564,6 @@
     /** PCM output stream. */
     R3PTRTYPE(PPDMAUDIOGSTSTRMOUT)     pStrmOut;
+    /** Mixer handle for line output stream. */
+    R3PTRTYPE(PAUDMIXSTREAM)           phStrmOut;
 } HDAOUTPUTSTREAM, *PHDAOUTPUTSTREAM;
 
@@ -2457,5 +2459,5 @@
     }
 
-    int rc;
+    int rc = VINF_SUCCESS;
     char *pszDesc;
 
@@ -2490,16 +2492,26 @@
 {
     int rc = VINF_SUCCESS;
+    char *pszDesc;
 
     PHDADRIVER pDrv;
     RTListForEach(&pThis->lstDrv, pDrv, HDADRIVER, Node)
     {
-        int rc2 = pDrv->pConnector->pfnOpenOut(pDrv->pConnector, pszName, pCfg, &pDrv->Out.pStrmOut);
-        if (RT_FAILURE(rc2))
-        {
-            LogFunc(("LUN#%RU8: Opening stream \"%s\" failed, rc=%Rrc\n", pDrv->uLUN, pszName, rc2));
-            if (RT_SUCCESS(rc))
-                rc = rc2;
-            /* Keep going. */
+        if (RTStrAPrintf(&pszDesc, "[LUN#%RU8] %s", pDrv->uLUN, pszName) <= 0)
+        {
+            rc = VERR_NO_MEMORY;
+            break;
         }
+
+        rc = pDrv->pConnector->pfnOpenOut(pDrv->pConnector, pszDesc, pCfg, &pDrv->Out.pStrmOut);
+        LogFlowFunc(("LUN#%RU8: Opened output \"%s\", with rc=%Rrc\n", pDrv->uLUN, pszDesc, rc));
+        if (rc == VINF_SUCCESS) /* Note: Could return VWRN_ALREADY_EXISTS. */
+        {
+            audioMixerRemoveStream(pThis->pSinkOutput, pDrv->Out.phStrmOut);
+            rc = audioMixerAddStreamOut(pThis->pSinkOutput,
+                                        pDrv->pConnector, pDrv->Out.pStrmOut,
+                                        0 /* uFlags */, &pDrv->Out.phStrmOut);
+        }
+
+        RTStrFree(pszDesc);
     }
 
@@ -2535,6 +2547,4 @@
 
     PHDADRIVER pDrv;
-
-    LogFlowFuncEnter();
 
     uint32_t cbIn, cbOut, cSamplesLive;
@@ -2545,6 +2555,7 @@
         if (RT_SUCCESS(rc))
         {
+#ifdef DEBUG_TIMER
             LogFlowFunc(("\tLUN#%RU8: [1] cbIn=%RU32, cbOut=%RU32\n", pDrv->uLUN, cbIn, cbOut));
-
+#endif
             if (cSamplesLive)
             {
@@ -2557,6 +2568,8 @@
                 rc = pDrv->pConnector->pfnQueryStatus(pDrv->pConnector,
                                                       &cbIn, &cbOut, &cSamplesLive);
+#ifdef DEBUG_TIMER
                 if (RT_SUCCESS(rc))
                     LogFlowFunc(("\tLUN#%RU8: [2] cbIn=%RU32, cbOut=%RU32\n", pDrv->uLUN, cbIn, cbOut));
+#endif
             }
 
@@ -2566,5 +2579,7 @@
     }
 
+#ifdef DEBUG_TIMER
     LogFlowFunc(("cbInMax=%RU32, cbOutMin=%RU32\n", cbInMax, cbOutMin));
+#endif
 
     if (cbOutMin == UINT32_MAX)
@@ -2587,6 +2602,4 @@
 
     TMTimerSet(pThis->pTimer, TMTimerGet(pThis->pTimer) + pThis->uTicks);
-
-    LogFlowFuncLeave();
 
     STAM_PROFILE_STOP(&pThis->StatTimer, a);
Index: /trunk/src/VBox/Devices/Audio/DevIchHdaCodec.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevIchHdaCodec.cpp	(revision 55064)
+++ /trunk/src/VBox/Devices/Audio/DevIchHdaCodec.cpp	(revision 55065)
@@ -1348,4 +1348,11 @@
         if (fIsRight)
             hdaCodecSetRegisterU8(&AMPLIFIER_REGISTER(*pAmplifier, AMPLIFIER_IN, AMPLIFIER_RIGHT, u8Index), cmd, 0);
+
+        /** @todo Fix ID of u8AdcVolsLineIn! */
+#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
+        hdaCodecToAudVolume(pThis, pAmplifier, PDMAUDIOMIXERCTL_LINE_IN);
+#else
+        hdaCodecToAudVolume(pAmplifier, AUD_MIXER_LINE_IN);
+#endif
     }
     if (fIsOut)
@@ -1355,6 +1362,6 @@
         if (fIsRight)
             hdaCodecSetRegisterU8(&AMPLIFIER_REGISTER(*pAmplifier, AMPLIFIER_OUT, AMPLIFIER_RIGHT, u8Index), cmd, 0);
-    }
-    if (CODEC_NID(cmd) == pThis->u8DacLineOut)
+
+        /** @todo Fix ID of u8DacLineOut! */
 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER
         hdaCodecToAudVolume(pThis, pAmplifier, PDMAUDIOMIXERCTL_VOLUME);
@@ -1362,11 +1369,5 @@
         hdaCodecToAudVolume(pAmplifier, AUD_MIXER_VOLUME);
 #endif
-
-    if (CODEC_NID(cmd) == pThis->u8AdcVolsLineIn) /* Microphone */
-#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
-        hdaCodecToAudVolume(pThis, pAmplifier, PDMAUDIOMIXERCTL_LINE_IN);
-#else
-        hdaCodecToAudVolume(pAmplifier, AUD_MIXER_LINE_IN);
-#endif
+    }
 
     return VINF_SUCCESS;
