Index: trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
===================================================================
--- trunk/src/VBox/Devices/Audio/DevIchAc97.cpp	(revision 87989)
+++ trunk/src/VBox/Devices/Audio/DevIchAc97.cpp	(revision 87990)
@@ -2088,5 +2088,5 @@
         return 0;
 
-    const uint64_t usBytes        = DrvAudioHlpBytesToMicro(cbBytes, &pStreamCC->State.Cfg.Props);
+    const uint64_t usBytes        = DrvAudioHlpBytesToMicro(&pStreamCC->State.Cfg.Props, cbBytes);
     const uint64_t cTransferTicks = PDMDevHlpTimerFromMicro(pDevIns, pStream->hTimer, usBytes);
 
Index: trunk/src/VBox/Devices/Audio/DrvAudio.h
===================================================================
--- trunk/src/VBox/Devices/Audio/DrvAudio.h	(revision 87989)
+++ trunk/src/VBox/Devices/Audio/DrvAudio.h	(revision 87990)
@@ -195,30 +195,30 @@
 /** @name Audio calculation helper methods.
  * @{ */
-void DrvAudioHlpClearBuf(const PPDMAUDIOPCMPROPS pPCMProps, void *pvBuf, size_t cbBuf, uint32_t cFrames);
+void DrvAudioHlpClearBuf(PCPDMAUDIOPCMPROPS pPCMProps, void *pvBuf, size_t cbBuf, uint32_t cFrames);
 uint32_t DrvAudioHlpCalcBitrate(uint8_t cBits, uint32_t uHz, uint8_t cChannels);
-uint32_t DrvAudioHlpCalcBitrate(const PPDMAUDIOPCMPROPS pProps);
-uint32_t DrvAudioHlpBytesAlign(uint32_t cbSize, const PPDMAUDIOPCMPROPS pProps);
-bool     DrvAudioHlpBytesIsAligned(uint32_t cbSize, const PPDMAUDIOPCMPROPS pProps);
-uint32_t DrvAudioHlpBytesToFrames(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps);
-uint64_t DrvAudioHlpBytesToMilli(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps);
-uint64_t DrvAudioHlpBytesToMicro(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps);
-uint64_t DrvAudioHlpBytesToNano(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps);
-uint32_t DrvAudioHlpFramesToBytes(uint32_t cFrames, const PPDMAUDIOPCMPROPS pProps);
-uint64_t DrvAudioHlpFramesToMilli(uint32_t cFrames, const PPDMAUDIOPCMPROPS pProps);
-uint64_t DrvAudioHlpFramesToNano(uint32_t cFrames, const PPDMAUDIOPCMPROPS pProps);
-uint32_t DrvAudioHlpMilliToBytes(uint64_t uMs, const PPDMAUDIOPCMPROPS pProps);
-uint32_t DrvAudioHlpNanoToBytes(uint64_t uNs, const PPDMAUDIOPCMPROPS pProps);
-uint32_t DrvAudioHlpMilliToFrames(uint64_t uMs, const PPDMAUDIOPCMPROPS pProps);
-uint32_t DrvAudioHlpNanoToFrames(uint64_t uNs, const PPDMAUDIOPCMPROPS pProps);
+uint32_t DrvAudioHlpCalcBitrate(PCPDMAUDIOPCMPROPS pProps);
+uint32_t DrvAudioHlpBytesAlign(uint32_t cbSize, PCPDMAUDIOPCMPROPS pProps);
+bool     DrvAudioHlpBytesIsAligned(uint32_t cbSize, PCPDMAUDIOPCMPROPS pProps);
+uint32_t DrvAudioHlpBytesToFrames(uint32_t cbBytes, PCPDMAUDIOPCMPROPS pProps);
+uint64_t DrvAudioHlpBytesToMilli(uint32_t cbBytes, PCPDMAUDIOPCMPROPS pProps);
+uint64_t DrvAudioHlpBytesToMicro(PCPDMAUDIOPCMPROPS pProps, uint32_t cb);
+uint64_t DrvAudioHlpBytesToNano(PCPDMAUDIOPCMPROPS pProps, uint32_t cb);
+uint32_t DrvAudioHlpFramesToBytes(uint32_t cFrames, PCPDMAUDIOPCMPROPS pProps);
+uint64_t DrvAudioHlpFramesToMilli(uint32_t cFrames, PCPDMAUDIOPCMPROPS pProps);
+uint64_t DrvAudioHlpFramesToNano(uint32_t cFrames, PCPDMAUDIOPCMPROPS pProps);
+uint32_t DrvAudioHlpMilliToBytes(uint64_t uMs, PCPDMAUDIOPCMPROPS pProps);
+uint32_t DrvAudioHlpNanoToBytes(uint64_t uNs, PCPDMAUDIOPCMPROPS pProps);
+uint32_t DrvAudioHlpMilliToFrames(uint64_t uMs, PCPDMAUDIOPCMPROPS pProps);
+uint32_t DrvAudioHlpNanoToFrames(uint64_t uNs, PCPDMAUDIOPCMPROPS pProps);
 /** @}  */
 
 /** @name Audio PCM properties helper methods.
  * @{ */
-bool DrvAudioHlpPCMPropsAreEqual(const PPDMAUDIOPCMPROPS pPCMProps1, const PPDMAUDIOPCMPROPS pPCMProps2);
-bool DrvAudioHlpPCMPropsAreEqual(const PPDMAUDIOPCMPROPS pPCMProps, const PPDMAUDIOSTREAMCFG pCfg);
-bool DrvAudioHlpPCMPropsAreValid(const PPDMAUDIOPCMPROPS pProps);
-uint32_t DrvAudioHlpPCMPropsBytesPerFrame(const PPDMAUDIOPCMPROPS pProps);
-void DrvAudioHlpPCMPropsPrint(const PPDMAUDIOPCMPROPS pProps);
-int DrvAudioHlpPCMPropsToStreamCfg(const PPDMAUDIOPCMPROPS pPCMProps, PPDMAUDIOSTREAMCFG pCfg);
+bool DrvAudioHlpPCMPropsAreEqual(PCPDMAUDIOPCMPROPS pPCMProps1, PCPDMAUDIOPCMPROPS pPCMProps2);
+bool DrvAudioHlpPCMPropsAreEqual(PCPDMAUDIOPCMPROPS pPCMProps, PCPDMAUDIOSTREAMCFG pCfg);
+bool DrvAudioHlpPCMPropsAreValid(PCPDMAUDIOPCMPROPS pProps);
+uint32_t DrvAudioHlpPCMPropsBytesPerFrame(PCPDMAUDIOPCMPROPS pProps);
+void DrvAudioHlpPCMPropsPrint(PCPDMAUDIOPCMPROPS pProps);
+int DrvAudioHlpPCMPropsToStreamCfg(PCPDMAUDIOPCMPROPS pPCMProps, PPDMAUDIOSTREAMCFG pCfg);
 /** @}  */
 
@@ -226,9 +226,9 @@
  * @{ */
 void DrvAudioHlpStreamCfgInit(PPDMAUDIOSTREAMCFG pCfg);
-bool DrvAudioHlpStreamCfgIsValid(const PPDMAUDIOSTREAMCFG pCfg);
-int DrvAudioHlpStreamCfgCopy(PPDMAUDIOSTREAMCFG pDstCfg, const PPDMAUDIOSTREAMCFG pSrcCfg);
-PPDMAUDIOSTREAMCFG DrvAudioHlpStreamCfgDup(const PPDMAUDIOSTREAMCFG pCfg);
+bool DrvAudioHlpStreamCfgIsValid(PCPDMAUDIOSTREAMCFG pCfg);
+int DrvAudioHlpStreamCfgCopy(PPDMAUDIOSTREAMCFG pDstCfg, PCPDMAUDIOSTREAMCFG pSrcCfg);
+PPDMAUDIOSTREAMCFG DrvAudioHlpStreamCfgDup(PCPDMAUDIOSTREAMCFG pCfg);
 void DrvAudioHlpStreamCfgFree(PPDMAUDIOSTREAMCFG pCfg);
-void DrvAudioHlpStreamCfgPrint(const PPDMAUDIOSTREAMCFG pCfg);
+void DrvAudioHlpStreamCfgPrint(PCPDMAUDIOSTREAMCFG pCfg);
 /** @}  */
 
@@ -287,5 +287,5 @@
 int DrvAudioHlpFileCreate(PDMAUDIOFILETYPE enmType, const char *pszFile, uint32_t fFlags, PPDMAUDIOFILE *ppFile);
 void DrvAudioHlpFileDestroy(PPDMAUDIOFILE pFile);
-int DrvAudioHlpFileOpen(PPDMAUDIOFILE pFile, uint32_t fOpen, const PPDMAUDIOPCMPROPS pProps);
+int DrvAudioHlpFileOpen(PPDMAUDIOFILE pFile, uint32_t fOpen, PCPDMAUDIOPCMPROPS pProps);
 int DrvAudioHlpFileClose(PPDMAUDIOFILE pFile);
 int DrvAudioHlpFileDelete(PPDMAUDIOFILE pFile);
Index: trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp
===================================================================
--- trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp	(revision 87989)
+++ trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp	(revision 87990)
@@ -128,5 +128,5 @@
  * @param   cFrames                 Number of audio frames to clear in the buffer.
  */
-void DrvAudioHlpClearBuf(const PPDMAUDIOPCMPROPS pPCMProps, void *pvBuf, size_t cbBuf, uint32_t cFrames)
+void DrvAudioHlpClearBuf(PCPDMAUDIOPCMPROPS pPCMProps, void *pvBuf, size_t cbBuf, uint32_t cFrames)
 {
     AssertPtrReturnVoid(pPCMProps);
@@ -822,5 +822,5 @@
  * @param   pProps2             Second properties to compare.
  */
-bool DrvAudioHlpPCMPropsAreEqual(const PPDMAUDIOPCMPROPS pProps1, const PPDMAUDIOPCMPROPS pProps2)
+bool DrvAudioHlpPCMPropsAreEqual(PCPDMAUDIOPCMPROPS pProps1, PCPDMAUDIOPCMPROPS pProps2)
 {
     AssertPtrReturn(pProps1, false);
@@ -843,5 +843,5 @@
  * @param   pProps              PCM properties to check.
  */
-bool DrvAudioHlpPCMPropsAreValid(const PPDMAUDIOPCMPROPS pProps)
+bool DrvAudioHlpPCMPropsAreValid(PCPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturn(pProps, false);
@@ -892,5 +892,5 @@
  * @param   pCfg                Stream configuration to compare.
  */
-bool DrvAudioHlpPCMPropsAreEqual(const PPDMAUDIOPCMPROPS pProps, const PPDMAUDIOSTREAMCFG pCfg)
+bool DrvAudioHlpPCMPropsAreEqual(PCPDMAUDIOPCMPROPS pProps, PCPDMAUDIOSTREAMCFG pCfg)
 {
     AssertPtrReturn(pProps, false);
@@ -906,5 +906,5 @@
  * @param  pProps               PCM properties to retrieve bytes per frame for.
  */
-uint32_t DrvAudioHlpPCMPropsBytesPerFrame(const PPDMAUDIOPCMPROPS pProps)
+uint32_t DrvAudioHlpPCMPropsBytesPerFrame(PCPDMAUDIOPCMPROPS pProps)
 {
     return PDMAUDIOPCMPROPS_F2B(pProps, 1 /* Frame */);
@@ -916,5 +916,5 @@
  * @param   pProps              Stream configuration to log.
  */
-void DrvAudioHlpPCMPropsPrint(const PPDMAUDIOPCMPROPS pProps)
+void DrvAudioHlpPCMPropsPrint(PCPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturnVoid(pProps);
@@ -931,5 +931,5 @@
  * @param   pCfg                Stream configuration to store result into.
  */
-int DrvAudioHlpPCMPropsToStreamCfg(const PPDMAUDIOPCMPROPS pProps, PPDMAUDIOSTREAMCFG pCfg)
+int DrvAudioHlpPCMPropsToStreamCfg(PCPDMAUDIOPCMPROPS pProps, PPDMAUDIOSTREAMCFG pCfg)
 {
     AssertPtrReturn(pProps, VERR_INVALID_POINTER);
@@ -962,5 +962,5 @@
  * @param   pCfg                Stream configuration to check.
  */
-bool DrvAudioHlpStreamCfgIsValid(const PPDMAUDIOSTREAMCFG pCfg)
+bool DrvAudioHlpStreamCfgIsValid(PCPDMAUDIOSTREAMCFG pCfg)
 {
     AssertPtrReturn(pCfg, false);
@@ -999,5 +999,5 @@
  * @param   pSrcCfg             Source stream configuration to copy to destination.
  */
-int DrvAudioHlpStreamCfgCopy(PPDMAUDIOSTREAMCFG pDstCfg, const PPDMAUDIOSTREAMCFG pSrcCfg)
+int DrvAudioHlpStreamCfgCopy(PPDMAUDIOSTREAMCFG pDstCfg, PCPDMAUDIOSTREAMCFG pSrcCfg)
 {
     AssertPtrReturn(pDstCfg, VERR_INVALID_POINTER);
@@ -1024,5 +1024,5 @@
  * @param   pCfg                    Audio stream configuration to duplicate.
  */
-PPDMAUDIOSTREAMCFG DrvAudioHlpStreamCfgDup(const PPDMAUDIOSTREAMCFG pCfg)
+PPDMAUDIOSTREAMCFG DrvAudioHlpStreamCfgDup(PCPDMAUDIOSTREAMCFG pCfg)
 {
     AssertPtrReturn(pCfg, NULL);
@@ -1056,5 +1056,5 @@
  * @param   pCfg                Stream configuration to log.
  */
-void DrvAudioHlpStreamCfgPrint(const PPDMAUDIOSTREAMCFG pCfg)
+void DrvAudioHlpStreamCfgPrint(PCPDMAUDIOSTREAMCFG pCfg)
 {
     if (!pCfg)
@@ -1168,5 +1168,5 @@
  * @remark
  */
-uint32_t DrvAudioHlpCalcBitrate(const PPDMAUDIOPCMPROPS pProps)
+uint32_t DrvAudioHlpCalcBitrate(PCPDMAUDIOPCMPROPS pProps)
 {
     return DrvAudioHlpCalcBitrate(pProps->cbSample * 8, pProps->uHz, pProps->cChannels);
@@ -1181,5 +1181,5 @@
  * @param   pProps              PCM properties to align size to.
  */
-uint32_t DrvAudioHlpBytesAlign(uint32_t cbSize, const PPDMAUDIOPCMPROPS pProps)
+uint32_t DrvAudioHlpBytesAlign(uint32_t cbSize, PCPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturn(pProps, 0);
@@ -1198,5 +1198,5 @@
  * @param   pProps              PCM properties to use for checking the alignment.
  */
-bool DrvAudioHlpBytesIsAligned(uint32_t cbSize, const PPDMAUDIOPCMPROPS pProps)
+bool DrvAudioHlpBytesIsAligned(uint32_t cbSize, PCPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturn(pProps, 0);
@@ -1214,5 +1214,5 @@
  * @param   pProps              PCM properties to retrieve size for.
  */
-DECLINLINE(uint64_t) drvAudioHlpBytesPerSec(const PPDMAUDIOPCMPROPS pProps)
+DECLINLINE(uint64_t) drvAudioHlpBytesPerSec(PCPDMAUDIOPCMPROPS pProps)
 {
     return PDMAUDIOPCMPROPS_F2B(pProps, 1 /* Frame */) * pProps->uHz;
@@ -1226,5 +1226,5 @@
  * @param  pProps               PCM properties to calulate frames for.
  */
-uint32_t DrvAudioHlpBytesToFrames(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps)
+uint32_t DrvAudioHlpBytesToFrames(uint32_t cbBytes, PCPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturn(pProps, 0);
@@ -1234,79 +1234,91 @@
 
 /**
- * Returns the time (in ms) for given byte amount and PCM properties.
- *
- * @return  uint64_t            Calculated time (in ms).
- * @param   cbBytes             Amount of bytes to calculate time for.
- * @param   pProps              PCM properties to calculate amount of bytes for.
- *
- * @note    Does rounding up the result.
- */
-uint64_t DrvAudioHlpBytesToMilli(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps)
+ * Converts bytes to milliseconds.
+ *
+ * @return  Number milliseconds @a cb takes to play or record.
+ * @param   pProps      PCM properties to use.
+ * @param   cb          The number of bytes to convert.
+ *
+ * @note    Rounds up the result.
+ */
+uint64_t DrvAudioHlpBytesToMilli(uint32_t cb, PCPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturn(pProps, 0);
 
-    if (!pProps->uHz) /* Prevent division by zero. */
-        return 0;
-
-    const unsigned cbFrame = PDMAUDIOPCMPROPS_F2B(pProps, 1 /* Frame */);
-
-    if (!cbFrame) /* Prevent division by zero. */
-        return 0;
-
-    uint64_t uTimeMs = ((cbBytes + cbFrame - 1) / cbFrame) * RT_MS_1SEC;
-
-    return (uTimeMs + pProps->uHz - 1) / pProps->uHz;
-}
-
-/**
- * Returns the time (in us) for given byte amount and PCM properties.
- *
- * @return  uint64_t            Calculated time (in us).
- * @param   cbBytes             Amount of bytes to calculate time for.
- * @param   pProps              PCM properties to calculate amount of bytes for.
- *
- * @note    Does rounding up the result.
- */
-uint64_t DrvAudioHlpBytesToMicro(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps)
+    /* Check parameters to prevent division by chainsaw: */
+    uint32_t const uHz = pProps->uHz;
+    if (uHz)
+    {
+        const unsigned cbFrame = PDMAUDIOPCMPROPS_F2B(pProps, 1 /* Frame */);
+        if (cbFrame)
+        {
+            /* Round cb up to closest frame size: */
+            cb = (cb + cbFrame - 1) / cbFrame;
+
+            /* Convert to milliseconds. */
+            return (cb * (uint64_t)RT_MS_1SEC + uHz - 1) / uHz;
+        }
+    }
+    return 0;
+}
+
+/**
+ * Converts bytes to microseconds.
+ *
+ * @return  Number microseconds @a cb takes to play or record.
+ * @param   pProps      PCM properties to use.
+ * @param   cb          The number of bytes to convert.
+ *
+ * @note    Rounds up the result.
+ */
+uint64_t DrvAudioHlpBytesToMicro(PCPDMAUDIOPCMPROPS pProps, uint32_t cb)
 {
     AssertPtrReturn(pProps, 0);
 
-    if (!pProps->uHz) /* Prevent division by zero. */
-        return 0;
-
-    const unsigned cbFrame = PDMAUDIOPCMPROPS_F2B(pProps, 1 /* Frame */);
-
-    if (!cbFrame) /* Prevent division by zero. */
-        return 0;
-
-    uint64_t uTimeUs = ((cbBytes + cbFrame - 1) / cbFrame) * RT_US_1SEC;
-
-    return (uTimeUs + pProps->uHz - 1) / pProps->uHz;
-}
-
-/**
- * Returns the time (in ns) for given byte amount and PCM properties.
- *
- * @return  uint64_t            Calculated time (in ns).
- * @param   cbBytes             Amount of bytes to calculate time for.
- * @param   pProps              PCM properties to calculate amount of bytes for.
- *
- * @note    Does rounding up the result.
- */
-uint64_t DrvAudioHlpBytesToNano(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps)
+    /* Check parameters to prevent division by chainsaw: */
+    uint32_t const uHz = pProps->uHz;
+    if (uHz)
+    {
+        const unsigned cbFrame = PDMAUDIOPCMPROPS_F2B(pProps, 1 /* Frame */);
+        if (cbFrame)
+        {
+            /* Round cb up to closest frame size: */
+            cb = (cb + cbFrame - 1) / cbFrame;
+
+            /* Convert to microseconds. */
+            return (cb * (uint64_t)RT_US_1SEC + uHz - 1) / uHz;
+        }
+    }
+    return 0;
+}
+
+/**
+ * Converts bytes to nanoseconds.
+ *
+ * @return  Number nanoseconds @a cb takes to play or record.
+ * @param   pProps      PCM properties to use.
+ * @param   cb          The number of bytes to convert.
+ *
+ * @note    Rounds up the result.
+ */
+uint64_t DrvAudioHlpBytesToNano(PCPDMAUDIOPCMPROPS pProps, uint32_t cb)
 {
     AssertPtrReturn(pProps, 0);
 
-    if (!pProps->uHz) /* Prevent division by zero. */
-        return 0;
-
-    const unsigned cbFrame = PDMAUDIOPCMPROPS_F2B(pProps, 1 /* Frame */);
-
-    if (!cbFrame) /* Prevent division by zero. */
-        return 0;
-
-    uint64_t uTimeNs = ((cbBytes + cbFrame - 1) / cbFrame) * RT_NS_1SEC;
-
-    return (uTimeNs + pProps->uHz - 1) / pProps->uHz;
+    /* Check parameters to prevent division by chainsaw: */
+    uint32_t const uHz = pProps->uHz;
+    if (uHz)
+    {
+        const unsigned cbFrame = PDMAUDIOPCMPROPS_F2B(pProps, 1 /* Frame */);
+        if (cbFrame)
+        {
+            /* Round cb up to closest frame size: */
+            cb = (cb + cbFrame - 1) / cbFrame;
+
+            /* Convert to nanoseconds. */
+            return (cb * (uint64_t)RT_NS_1SEC + uHz - 1) / uHz;
+        }
+    }
+    return 0;
 }
 
@@ -1318,5 +1330,5 @@
  * @param  pProps               PCM properties to calculate bytes for.
  */
-uint32_t DrvAudioHlpFramesToBytes(uint32_t cFrames, const PPDMAUDIOPCMPROPS pProps)
+uint32_t DrvAudioHlpFramesToBytes(uint32_t cFrames, PCPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturn(pProps, 0);
@@ -1335,5 +1347,5 @@
  * @param   pProps              PCM properties to calculate time (in ms) for.
  */
-uint64_t DrvAudioHlpFramesToMilli(uint32_t cFrames, const PPDMAUDIOPCMPROPS pProps)
+uint64_t DrvAudioHlpFramesToMilli(uint32_t cFrames, PCPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturn(pProps, 0);
@@ -1362,5 +1374,5 @@
  * @param   pProps              PCM properties to calculate time (in ns) for.
  */
-uint64_t DrvAudioHlpFramesToNano(uint32_t cFrames, const PPDMAUDIOPCMPROPS pProps)
+uint64_t DrvAudioHlpFramesToNano(uint32_t cFrames, PCPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturn(pProps, 0);
@@ -1384,5 +1396,5 @@
  * @param   pProps              PCM properties to calculate amount of bytes for.
  */
-uint32_t DrvAudioHlpMilliToBytes(uint64_t uMs, const PPDMAUDIOPCMPROPS pProps)
+uint32_t DrvAudioHlpMilliToBytes(uint64_t uMs, PCPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturn(pProps, 0);
@@ -1411,5 +1423,5 @@
  * @param   pProps              PCM properties to calculate amount of bytes for.
  */
-uint32_t DrvAudioHlpNanoToBytes(uint64_t uNs, const PPDMAUDIOPCMPROPS pProps)
+uint32_t DrvAudioHlpNanoToBytes(uint64_t uNs, PCPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturn(pProps, 0);
@@ -1436,5 +1448,5 @@
  * @param   pProps              PCM properties to calculate amount of frames for.
  */
-uint32_t DrvAudioHlpMilliToFrames(uint64_t uMs, const PPDMAUDIOPCMPROPS pProps)
+uint32_t DrvAudioHlpMilliToFrames(uint64_t uMs, PCPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturn(pProps, 0);
@@ -1454,5 +1466,5 @@
  * @param   pProps              PCM properties to calculate amount of frames for.
  */
-uint32_t DrvAudioHlpNanoToFrames(uint64_t uNs, const PPDMAUDIOPCMPROPS pProps)
+uint32_t DrvAudioHlpNanoToFrames(uint64_t uNs, PCPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturn(pProps, 0);
@@ -1704,5 +1716,5 @@
  * @param   pProps              PCM properties to use.
  */
-int DrvAudioHlpFileOpen(PPDMAUDIOFILE pFile, uint32_t fOpen, const PPDMAUDIOPCMPROPS pProps)
+int DrvAudioHlpFileOpen(PPDMAUDIOFILE pFile, uint32_t fOpen, PCPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturn(pFile,   VERR_INVALID_POINTER);
Index: trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp
===================================================================
--- trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp	(revision 87989)
+++ trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp	(revision 87990)
@@ -33,11 +33,42 @@
 
 
-/*********************************************************************************************************************************
-*   Structures and Typedefs                                                                                                      *
-*********************************************************************************************************************************/
+static void tstBasics(RTTEST hTest)
+{
+    RTTestSubF(hTest, "Single buffer");
+
+    static const PDMAUDIOPCMPROPS s_Cfg441StereoS16 = PDMAUDIOPCMPROPS_INITIALIZOR(
+        /* a_cb: */             2,
+        /* a_fSigned: */        true,
+        /* a_cChannels: */      2,
+        /* a_uHz: */            44100,
+        /* a_cShift: */         PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(2 /* cb */, 2 /* cChannels */),
+        /* a_fSwapEndian: */    false
+    );
+
+    RTTESTI_CHECK_MSG(PDMAUDIOPCMPROPS_F2B(&s_Cfg441StereoS16, 1) == 4,
+                      ("got %x, expected 4\n", PDMAUDIOPCMPROPS_F2B(&s_Cfg441StereoS16, 1)));
+
+    uint32_t u32;
+    RTTESTI_CHECK_MSG((u32 = DrvAudioHlpFramesToBytes(44100, &s_Cfg441StereoS16)) == 44100 * 2 * 2,
+                      ("cb=%RU32\n", u32));
+    RTTESTI_CHECK_MSG((u32 = DrvAudioHlpFramesToBytes(2, &s_Cfg441StereoS16)) == 2 * 2 * 2,
+                      ("cb=%RU32\n", u32));
+
+    uint64_t u64;
+    RTTESTI_CHECK_MSG((u64 = DrvAudioHlpBytesToNano(&s_Cfg441StereoS16, 44100 * 2 * 2)) == RT_NS_1SEC,
+                      ("ns=%RU64\n", u64));
+    RTTESTI_CHECK_MSG((u64 = DrvAudioHlpBytesToMicro(&s_Cfg441StereoS16, 44100 * 2 * 2)) == RT_US_1SEC,
+                      ("us=%RU64\n", u64));
+    RTTESTI_CHECK_MSG((u64 = DrvAudioHlpBytesToMilli(44100 * 2 * 2, &s_Cfg441StereoS16)) == RT_MS_1SEC,
+                      ("ms=%RU64\n", u64));
+
+
+
+}
+
 
 static int tstSingle(RTTEST hTest)
 {
-    RTTestSubF(hTest, "Single buffer");
+    RTTestSub(hTest, "Single buffer");
 
     /* 44100Hz, 2 Channels, S16 */
@@ -232,5 +263,5 @@
      * Using AudioMixBufWriteAt for writing to children.
      */
-    RTTestSubF(hTest, "2 Children -> Parent (AudioMixBufWriteAt)");
+    RTTestSub(hTest, "2 Children -> Parent (AudioMixBufWriteAt)");
 
     uint32_t cChildrenSamplesMixedTotal = 0;
@@ -308,5 +339,5 @@
     uint32_t         cBufSize = 256;
 
-    RTTestSubF(hTest, "Sample conversion (U8)");
+    RTTestSub(hTest, "Sample conversion (U8)");
 
     /* 44100Hz, 1 Channel, U8 */
@@ -413,5 +444,5 @@
     uint32_t         cBufSize = 256;
 
-    RTTestSubF(hTest, "Sample conversion (S16)");
+    RTTestSub(hTest, "Sample conversion (S16)");
 
     /* 44100Hz, 1 Channel, S16 */
@@ -509,5 +540,5 @@
     uint32_t         cBufSize = 256;
 
-    RTTestSubF(hTest, "Volume control");
+    RTTestSub(hTest, "Volume control");
 
     /* Same for parent/child. */
@@ -635,13 +666,10 @@
     RTTestBanner(hTest);
 
-    rc = tstSingle(hTest);
-    if (RT_SUCCESS(rc))
-        rc = tstParentChild(hTest);
-    if (RT_SUCCESS(rc))
-        rc = tstConversion8(hTest);
-    if (RT_SUCCESS(rc))
-        rc = tstConversion16(hTest);
-    if (RT_SUCCESS(rc))
-        rc = tstVolume(hTest);
+    tstBasics(hTest);
+    tstSingle(hTest);
+    tstParentChild(hTest);
+    tstConversion8(hTest);
+    tstConversion16(hTest);
+    tstVolume(hTest);
 
     /*
