Index: trunk/src/VBox/Devices/Audio/DevHda.cpp
===================================================================
--- trunk/src/VBox/Devices/Audio/DevHda.cpp	(revision 89405)
+++ trunk/src/VBox/Devices/Audio/DevHda.cpp	(revision 89406)
@@ -57,5 +57,4 @@
 #include "DevHdaCodec.h"
 #include "DevHdaStream.h"
-#include "DevHdaStreamMap.h"
 
 #include "AudioHlp.h"
@@ -4139,9 +4138,8 @@
 
 /** Worker for hdaR3DbgInfoBDL. */
-static void hdaR3DbgPrintBDL(PPDMDEVINS pDevIns, PHDASTATE pThis, PHDASTATER3 pThisCC, PCDBGFINFOHLP pHlp, int idxStream)
+static void hdaR3DbgPrintBDL(PPDMDEVINS pDevIns, PHDASTATE pThis, PCDBGFINFOHLP pHlp, int idxStream)
 {
     const PHDASTREAM   pStream     = &pThis->aStreams[idxStream];
-    const PHDASTREAMR3 pStreamR3   = &pThisCC->aStreams[idxStream];
-    PCPDMAUDIOPCMPROPS pGuestProps = &pStreamR3->State.Mapping.GuestProps;
+    PCPDMAUDIOPCMPROPS pGuestProps = &pStream->State.Cfg.Props; /** @todo We don't make a distinction any more. The mixer hides that now. */
 
     uint64_t const u64BaseDMA = RT_MAKE_U64(HDA_STREAM_REG(pThis, BDPL, idxStream),
@@ -4190,5 +4188,5 @@
     }
     pHlp->pfnPrintf(pHlp, "  Total: %#RX64 bytes (%RU64), %u ms\n", cbTotal, cbTotal,
-                    PDMAudioPropsBytesToMilli(&pStreamR3->State.Mapping.GuestProps, (uint32_t)cbTotal));
+                    PDMAudioPropsBytesToMilli(pGuestProps, (uint32_t)cbTotal));
     if (cbTotal != u32CBL)
         pHlp->pfnPrintf(pHlp, "  Warning: %#RX64 bytes does not match CBL (%#RX64)!\n", cbTotal, u32CBL);
@@ -4243,12 +4241,11 @@
 {
     PHDASTATE   pThis     = PDMDEVINS_2_DATA(pDevIns, PHDASTATE);
-    PHDASTATER3 pThisCC   = PDMDEVINS_2_DATA_CC(pDevIns, PHDASTATER3);
     int         idxStream = hdaR3DbgLookupStrmIdx(pHlp, pszArgs);
     if (idxStream != -1)
-        hdaR3DbgPrintBDL(pDevIns, pThis, pThisCC, pHlp, idxStream);
+        hdaR3DbgPrintBDL(pDevIns, pThis, pHlp, idxStream);
     else
     {
         for (idxStream = 0; idxStream < HDA_MAX_STREAMS; ++idxStream)
-            hdaR3DbgPrintBDL(pDevIns, pThis, pThisCC, pHlp, idxStream);
+            hdaR3DbgPrintBDL(pDevIns, pThis, pHlp, idxStream);
         idxStream = -1;
     }
@@ -5119,7 +5116,5 @@
                                "The stream frequency.",                     "Stream%u/Cfg/Hz", idxStream);
         PDMDevHlpSTAMRegisterF(pDevIns, &pThis->aStreams[idxStream].State.Cfg.Props.cbFrame, STAMTYPE_U8, STAMVISIBILITY_USED, STAMUNIT_BYTES,
-                               "The number of channels.",                   "Stream%u/Cfg/FrameSize-Host", idxStream);
-        PDMDevHlpSTAMRegisterF(pDevIns, &pThisCC->aStreams[idxStream].State.Mapping.GuestProps.cbFrame, STAMTYPE_U8, STAMVISIBILITY_USED, STAMUNIT_BYTES,
-                               "The number of channels.",                   "Stream%u/Cfg/FrameSize-Guest", idxStream);
+                               "The number of channels.",                   "Stream%u/Cfg/FrameSize", idxStream);
 #if 0 /** @todo this would require some callback or expansion. */
         PDMDevHlpSTAMRegisterF(pDevIns, &pThis->aStreams[idxStream].State.Cfg.Props.cChannelsX, STAMTYPE_U8, STAMVISIBILITY_USED, STAMUNIT_BYTES,
Index: trunk/src/VBox/Devices/Audio/DevHda.h
===================================================================
--- trunk/src/VBox/Devices/Audio/DevHda.h	(revision 89405)
+++ trunk/src/VBox/Devices/Audio/DevHda.h	(revision 89406)
@@ -30,5 +30,4 @@
 #include "DevHdaCodec.h"
 #include "DevHdaStream.h"
-#include "DevHdaStreamMap.h"
 
 #ifdef DEBUG_andy
Index: trunk/src/VBox/Devices/Audio/DevHdaCommon.cpp
===================================================================
--- trunk/src/VBox/Devices/Audio/DevHdaCommon.cpp	(revision 89405)
+++ trunk/src/VBox/Devices/Audio/DevHdaCommon.cpp	(revision 89406)
@@ -326,5 +326,8 @@
 
     if (RT_SUCCESS(rc))
+    {
         PDMAudioPropsInit(pProps, cbSample, true /*fSigned*/, (u16SDFMT & 0xf) + 1 /*cChannels*/, u32Hz * u32HzMult / u32HzDiv);
+        /** @todo is there anything we need to / can do about channel assignments? */
+    }
 
 # undef EXTRACT_VALUE
Index: trunk/src/VBox/Devices/Audio/DevHdaStream.cpp
===================================================================
--- trunk/src/VBox/Devices/Audio/DevHdaStream.cpp	(revision 89405)
+++ trunk/src/VBox/Devices/Audio/DevHdaStream.cpp	(revision 89406)
@@ -168,6 +168,4 @@
     LogFlowFunc(("[SD%RU8] Destroying ...\n", pStreamShared->u8SD));
     int rc2;
-
-    hdaR3StreamMapDestroy(&pStreamR3->State.Mapping);
 
     if (pStreamR3->State.pAioRegSink)
@@ -487,7 +485,12 @@
     }
 
-    PDMAUDIOPCMPROPS HostProps;
-    int rc = hdaR3SDFMTToPCMProps(u16FMT, &HostProps);
-    if (RT_FAILURE(rc))
+    /*
+     * Convert the config to PDM PCM properties and configure the stream.
+     */
+    PPDMAUDIOSTREAMCFG pCfg = &pStreamShared->State.Cfg;
+    int rc = hdaR3SDFMTToPCMProps(u16FMT, &pCfg->Props);
+    if (RT_SUCCESS(rc))
+        pCfg->enmDir = hdaGetDirFromSD(uSD);
+    else
     {
         LogRelMax(32, ("HDA: Warning: Format 0x%x for stream #%RU8 not supported\n", HDA_STREAM_REG(pThis, FMT, uSD), uSD));
@@ -495,27 +498,8 @@
     }
 
-    /*
-     * Initialize the stream mapping in any case, regardless if
-     * we support surround audio or not. This is needed to handle
-     * the supported channels within a single audio stream, e.g. mono/stereo.
-     *
-     * In other words, the stream mapping *always* knows the real
-     * number of channels in a single audio stream.
-     */
-    /** @todo r=bird: this is not done at the wrong time.  We don't have the host
-     * output side set up yet, so we cannot really do proper mapping setup.
-     * However, we really need this further down when we configure the internal DMA
-     * buffer size.  For now we just assume it's all stereo on the host side.
-     * This is not compatible with microphone support. */
-# ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
-#  error "Implement me!"
-# endif
-    rc = hdaR3StreamMapInit(&pStreamR3->State.Mapping, 2 /*cHostChannels*/, &HostProps);
-    AssertRCReturn(rc, rc);
-
-    ASSERT_GUEST_LOGREL_MSG_RETURN(   pStreamR3->State.Mapping.cbGuestFrame > 0
-                                   && u32CBL % pStreamR3->State.Mapping.cbGuestFrame == 0,
+    ASSERT_GUEST_LOGREL_MSG_RETURN(   PDMAudioPropsFrameSize(&pCfg->Props) > 0
+                                   && u32CBL % PDMAudioPropsFrameSize(&pCfg->Props) == 0,
                                    ("CBL for stream #%RU8 does not align to frame size (u32CBL=%u cbFrameSize=%u)\n",
-                                    uSD, u32CBL, pStreamR3->State.Mapping.cbGuestFrame),
+                                    uSD, u32CBL, PDMAudioPropsFrameSize(&pCfg->Props)),
                                    VERR_INVALID_PARAMETER);
 
@@ -534,10 +518,4 @@
     pStreamShared->u8FIFOW    = u8FIFOW;
     pStreamShared->u16FMT     = u16FMT;
-
-    PPDMAUDIOSTREAMCFG pCfg = &pStreamShared->State.Cfg;
-    pCfg->Props = HostProps;
-
-    /* Set the stream's direction. */
-    pCfg->enmDir = hdaGetDirFromSD(uSD);
 
     /* The the stream's name, based on the direction. */
@@ -563,8 +541,6 @@
     }
 
-    LogRel2(("HDA: Stream #%RU8 DMA @ 0x%x (%RU32 bytes = %RU64ms total)\n",
-             uSD, pStreamShared->u64BDLBase, pStreamShared->u32CBL,
-             PDMAudioPropsBytesToMilli(&pStreamR3->State.Mapping.GuestProps, pStreamShared->u32CBL)));
-
+    LogRel2(("HDA: Stream #%RU8 DMA @ 0x%x (%RU32 bytes = %RU64ms total)\n", uSD, pStreamShared->u64BDLBase,
+             pStreamShared->u32CBL, PDMAudioPropsBytesToMilli(&pCfg->Props, pStreamShared->u32CBL)));
 
     /*
@@ -612,8 +588,9 @@
      * Create a DMA timer schedule.
      */
-     rc = hdaR3StreamCreateSchedule(pStreamShared, cTransferFragments, cBufferIrqs, (uint32_t)cbTotal,
-                                   PDMAudioPropsMilliToBytes(&pStreamR3->State.Mapping.GuestProps, 100 /** @todo make configurable */),
+    /** @todo clean up this, pGuestProps and pHostProps are the same now. */
+    rc = hdaR3StreamCreateSchedule(pStreamShared, cTransferFragments, cBufferIrqs, (uint32_t)cbTotal,
+                                   PDMAudioPropsMilliToBytes(&pCfg->Props, 100 /** @todo make configurable */),
                                    PDMDevHlpTimerGetFreq(pDevIns, pStreamShared->hTimer),
-                                   &HostProps, &pStreamR3->State.Mapping.GuestProps);
+                                   &pCfg->Props, &pCfg->Props);
     if (RT_FAILURE(rc))
         return rc;
@@ -1384,7 +1361,6 @@
         RTGCPHYS GCPhys  = hdaR3StreamDmaBufGet(pStreamShared, &cbChunk);
 
-        /* Need to diverge if the frame format differs or if we're writing silence.  */
-        if (   !pStreamR3->State.Mapping.fMappingNeeded
-            && !fWriteSilence)
+        /* If we're writing silence.  */
+        if (!fWriteSilence)
         {
             if (cbChunk <= cbLeft)
@@ -1430,6 +1406,6 @@
         }
         /*
-         * Either we've got some initial silence to write, or we need to do
-         * channel mapping.  Both produces guest output into the bounce buffer,
+         * We've got some initial silence to write, or we need to do
+         * channel mapping.  We produce guest output into the bounce buffer,
          * which is then copied into guest memory.  The bounce buffer may keep
          * partial frames there for the next BDLE, if an BDLE isn't frame aligned.
@@ -1440,6 +1416,9 @@
         else
         {
+/** @todo clean up host/guest props distinction, they're the same now w/o the
+ *        mapping done by the mixer rather than us.  */
+            PCPDMAUDIOPCMPROPS pGuestProps = &pStreamShared->State.Cfg.Props;
             Assert(PDMAudioPropsIsSizeAligned(&pStreamShared->State.Cfg.Props, cbLeft));
-            uint32_t const cbLeftGuest = PDMAudioPropsFramesToBytes(&pStreamR3->State.Mapping.GuestProps,
+            uint32_t const cbLeftGuest = PDMAudioPropsFramesToBytes(pGuestProps,
                                                                     PDMAudioPropsBytesToFrames(&pStreamShared->State.Cfg.Props,
                                                                                                cbLeft));
@@ -1456,51 +1435,11 @@
             {
                 /* Figure out how much we need to convert into the bounce buffer: */
-                uint32_t cbGuest = PDMAudioPropsRoundUpBytesToFrame(&pStreamR3->State.Mapping.GuestProps, cbChunk - cbBounce);
-                uint32_t cFrames = PDMAudioPropsBytesToFrames(&pStreamR3->State.Mapping.GuestProps,
-                                                              RT_MIN(cbGuest, sizeof(abBounce) - cbBounce));
-                size_t   cbBufSrc;
-                if (!fWriteSilence)
-                {
-                    /** @todo we could loop here to optimize buffer wrap around. Not important now though. */
-                    void /*const*/ *pvBufSrc;
-                    RTCircBufAcquireReadBlock(pCircBuf, PDMAudioPropsFramesToBytes(&pStreamShared->State.Cfg.Props, cFrames),
-                                              &pvBufSrc, &cbBufSrc);
-
-                    uint32_t const cFramesToConvert = PDMAudioPropsBytesToFrames(&pStreamShared->State.Cfg.Props,
-                                                                                 (uint32_t)cbBufSrc);
-                    Assert(PDMAudioPropsFramesToBytes(&pStreamShared->State.Cfg.Props, cFramesToConvert) == cbBufSrc);
-                    Assert(cFramesToConvert > 0);
-                    Assert(cFramesToConvert <= cFrames);
-
-                    pStreamR3->State.Mapping.pfnHostToGuest(&abBounce[cbBounce], pvBufSrc, cFramesToConvert,
-                                                            &pStreamR3->State.Mapping);
-                    Log5Func((" loop1: cbBounce=%#05x cFramesToConvert=%#05x cbBufSrc=%#x%s\n",
-                              cbBounce, cFramesToConvert, cbBufSrc, ASMMemIsZero(pvBufSrc, cbBufSrc) ? " all zero" : ""));
-#ifdef HDA_DEBUG_SILENCE
-                    fix me if relevant;
-#endif
-                    if (RT_LIKELY(!pStreamR3->Dbg.Runtime.fEnabled))
-                    { /* likely */ }
-                    else
-                        AudioHlpFileWrite(pStreamR3->Dbg.Runtime.pFileDMARaw, pvBufSrc, cbBufSrc, 0 /* fFlags */);
-
-#ifdef VBOX_WITH_DTRACE
-                    VBOXDD_HDA_STREAM_DMA_IN((uint32_t)uSD, (uint32_t)cbBufSrc, pStreamR3->State.offRead);
-#endif
-
-                    pStreamR3->State.offRead += cbBufSrc;
-                    RTCircBufReleaseReadBlock(pCircBuf, cbBufSrc);
-
-                    cFrames = cFramesToConvert;
-                    cbGuest = cbBounce + PDMAudioPropsFramesToBytes(&pStreamR3->State.Mapping.GuestProps, cFrames);
-                }
-                else
-                {
-                    cbBufSrc = PDMAudioPropsFramesToBytes(&pStreamShared->State.Cfg.Props, cFrames);
-                    cbGuest  = PDMAudioPropsFramesToBytes(&pStreamR3->State.Mapping.GuestProps, cFrames);
-                    PDMAudioPropsClearBuffer(&pStreamR3->State.Mapping.GuestProps,
-                                             &abBounce[cbBounce], cbGuest, cFrames);
-                    cbGuest += cbBounce;
-                }
+                uint32_t cbGuest = PDMAudioPropsRoundUpBytesToFrame(pGuestProps, cbChunk - cbBounce);
+                uint32_t cFrames = PDMAudioPropsBytesToFrames(pGuestProps, RT_MIN(cbGuest, sizeof(abBounce) - cbBounce));
+
+                size_t cbBufSrc = PDMAudioPropsFramesToBytes(&pStreamShared->State.Cfg.Props, cFrames);
+                cbGuest  = PDMAudioPropsFramesToBytes(pGuestProps, cFrames);
+                PDMAudioPropsClearBuffer(pGuestProps, &abBounce[cbBounce], cbGuest, cFrames);
+                cbGuest += cbBounce;
 
                 /* Write it to the guest buffer. */
@@ -1614,6 +1553,8 @@
      *
      */
+#if 0
     uint8_t    abBounce[4096 + 128];    /* Most guest does at most 4KB BDLE. So, 4KB + space for a partial frame to reduce loops. */
     uint32_t   cbBounce = 0;            /* in case of incomplete frames between buffer segments */
+#endif
     PRTCIRCBUF pCircBuf = pStreamR3->State.pCircBuf;
     uint32_t   cbLeft   = cbToProduce;
@@ -1631,7 +1572,8 @@
         RTGCPHYS GCPhys  = hdaR3StreamDmaBufGet(pStreamShared, &cbChunk);
 
-        /* Need to diverge if the frame format differs.  */
-        if (   !pStreamR3->State.Mapping.fMappingNeeded
-            /** @todo && pStreamShared->State.fFrameAlignedBuffers */)
+        /* Need to diverge if the BDLEs contain misaligned entries.  */
+#if 0
+        if (/** @todo pStreamShared->State.fFrameAlignedBuffers */)
+#endif
         {
             if (cbChunk <= cbLeft)
@@ -1676,4 +1618,5 @@
             }
         }
+#if 0
         /*
          * Need to map the frame content, so we need to read the guest data
@@ -1686,6 +1629,9 @@
         else
         {
+/** @todo clean up host/guest props distinction, they're the same now w/o the
+ *        mapping done by the mixer rather than us.  */
+            PCPDMAUDIOPCMPROPS pGuestProps = &pStreamShared->State.Cfg.Props;
             Assert(PDMAudioPropsIsSizeAligned(&pStreamShared->State.Cfg.Props, cbLeft));
-            uint32_t const cbLeftGuest = PDMAudioPropsFramesToBytes(&pStreamR3->State.Mapping.GuestProps,
+            uint32_t const cbLeftGuest = PDMAudioPropsFramesToBytes(pGuestProps,
                                                                     PDMAudioPropsBytesToFrames(&pStreamShared->State.Cfg.Props,
                                                                                                cbLeft));
@@ -1708,6 +1654,6 @@
 
                 /* Convert the size to whole frames and a remainder. */
-                uint32_t cFrames = PDMAudioPropsBytesToFrames(&pStreamR3->State.Mapping.GuestProps, cbBounce);
-                uint32_t const cbRemainder = cbBounce - PDMAudioPropsFramesToBytes(&pStreamR3->State.Mapping.GuestProps, cFrames);
+                uint32_t cFrames = PDMAudioPropsBytesToFrames(pGuestProps, cbBounce);
+                uint32_t const cbRemainder = cbBounce - PDMAudioPropsFramesToBytes(pGuestProps, cFrames);
                 Log5Func((" loop1: GCPhys=%RGp cbToRead=%#x cbBounce=%#x cFrames=%#x\n", GCPhys, cbToRead, cbBounce, cFrames));
 
@@ -1748,5 +1694,5 @@
                     cbLeft    -= (uint32_t)cbBufDst;
                     cFrames   -= cFramesToConvert;
-                    offBounce += PDMAudioPropsFramesToBytes(&pStreamR3->State.Mapping.GuestProps, cFramesToConvert);
+                    offBounce += PDMAudioPropsFramesToBytes(pGuestProps, cFramesToConvert);
                 }
 
@@ -1761,4 +1707,5 @@
             Log5Func(("loop0: GCPhys=%RGp cbBounce=%#x cbLeft=%#x\n", GCPhys, cbBounce, cbLeft));
         }
+#endif
 
         STAM_PROFILE_STOP(&pThis->StatOut, a);
@@ -1771,5 +1718,7 @@
 
     Assert(cbLeft == 0); /* There shall be no break statements in the above loop, so cbLeft is always zero here! */
+#if 0
     AssertMsg(cbBounce == 0, ("%#x\n", cbBounce));
+#endif
 
     /*
@@ -2131,5 +2080,5 @@
                     STAM_REL_COUNTER_ADD(&pStreamR3->State.StatDmaFlowErrorBytes, cbSilence);
                     LogRel2(("HDA: Warning: Stream #%RU8 underrun, added %u bytes of silence (%u us)\n", pStreamShared->u8SD,
-                             cbSilence, PDMAudioPropsBytesToMicro(&pStreamR3->State.Mapping.GuestProps, cbSilence)));
+                             cbSilence, PDMAudioPropsBytesToMicro(&pStreamShared->State.Cfg.Props, cbSilence)));
                 }
             }
Index: trunk/src/VBox/Devices/Audio/DevHdaStream.h
===================================================================
--- trunk/src/VBox/Devices/Audio/DevHdaStream.h	(revision 89405)
+++ trunk/src/VBox/Devices/Audio/DevHdaStream.h	(revision 89406)
@@ -23,5 +23,4 @@
 
 #include "DevHdaCommon.h"
-#include "DevHdaStreamMap.h"
 
 
@@ -274,6 +273,4 @@
     struct
     {
-        /** This stream's data mapping. */
-        HDASTREAMMAP            Mapping;
         /** Circular buffer (FIFO) for holding DMA'ed data. */
         R3PTRTYPE(PRTCIRCBUF)   pCircBuf;
@@ -311,5 +308,5 @@
     /** Debug bits. */
     HDASTREAMDEBUG              Dbg;
-    uint64_t                    au64Alignment[6];
+    uint64_t                    au64Alignment[2+4];
 } HDASTREAMR3;
 AssertCompileSizeAlignment(HDASTREAMR3, 64);
Index: trunk/src/VBox/Devices/Audio/DevHdaStreamMap.cpp
===================================================================
--- trunk/src/VBox/Devices/Audio/DevHdaStreamMap.cpp	(revision 89405)
+++ 	(revision )
@@ -1,403 +1,0 @@
-/* $Id$ */
-/** @file
- * Intel HD Audio Controller Emulation - Stream mapping (e.g. 5.1 -> stereo).
- */
-
-/*
- * Copyright (C) 2017-2020 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-
-/*********************************************************************************************************************************
-*   Header Files                                                                                                                 *
-*********************************************************************************************************************************/
-#define LOG_GROUP LOG_GROUP_DEV_HDA
-#include <VBox/log.h>
-
-#include <VBox/vmm/pdmdev.h>
-#include <VBox/vmm/pdmaudioifs.h>
-#include <VBox/vmm/pdmaudioinline.h>
-
-#include <iprt/mem.h>
-#include <iprt/string.h>
-
-#include "AudioHlp.h"
-
-#include "DevHdaStreamChannel.h"
-#include "DevHdaStreamMap.h"
-
-
-
-/** Convert host stereo to mono guest, signed 16-bit edition. */
-static DECLCALLBACK(void)
-hdaR3StreamMap_H2G_GenericS16_Stereo2Mono(void *pvDst, void const *pvSrc, uint32_t cFrames, HDASTREAMMAP const *pMap)
-{
-    /** @todo this doesn't merge the two, it just picks the first one. */
-    uint16_t       *pu16Dst    = (uint16_t *)pvDst;
-    uint16_t const *pu16Src    = (uint16_t const *)pvSrc;
-    size_t const    cbDstFrame = pMap->cbGuestFrame;
-
-    if (cbDstFrame != sizeof(*pu16Dst))
-        RT_BZERO(pvDst, cbDstFrame * cFrames);
-
-    while (cFrames-- > 0)
-    {
-        *pu16Dst = *pu16Src;
-        pu16Src += 2;
-        pu16Dst  = (uint16_t *)((uintptr_t)pu16Dst + cbDstFrame);
-    }
-}
-
-
-/** Convert mono guest channel to host stereo, signed 16-bit edition. */
-static DECLCALLBACK(void)
-hdaR3StreamMap_G2H_GenericS16_Mono2Stereo(void *pvDst, void const *pvSrc, uint32_t cFrames, HDASTREAMMAP const *pMap)
-{
-    uint32_t       *pu32Dst    = (uint32_t *)pvDst;
-    uint16_t const *pu16Src    = (uint16_t const *)pvSrc;
-    size_t const    cbSrcFrame = pMap->cbGuestFrame;
-
-    while (cFrames-- > 0)
-    {
-        uint16_t uSample = *pu16Src;
-        *pu32Dst++ = RT_MAKE_U32(uSample, uSample);
-        pu16Src = (uint16_t const *)((uintptr_t)pu16Src + cbSrcFrame);
-    }
-}
-
-
-/** Convert host stereo to mono guest, signed 32-bit edition. */
-static DECLCALLBACK(void)
-hdaR3StreamMap_H2G_GenericS32_Stereo2Mono(void *pvDst, void const *pvSrc, uint32_t cFrames, HDASTREAMMAP const *pMap)
-{
-    /** @todo this doesn't merge the two, it just picks the first one. */
-    uint32_t       *pu32Dst    = (uint32_t *)pvDst;
-    uint32_t const *pu32Src    = (uint32_t const *)pvSrc;
-    size_t const    cbDstFrame = pMap->cbGuestFrame;
-
-    if (cbDstFrame != sizeof(*pu32Dst))
-        RT_BZERO(pvDst, cbDstFrame * cFrames);
-
-    while (cFrames-- > 0)
-    {
-        *pu32Dst = *pu32Src;
-        pu32Src += 2;
-        pu32Dst  = (uint32_t *)((uintptr_t)pu32Dst + cbDstFrame);
-    }
-}
-
-
-/** Convert mono guest channel to host stereo, signed 32-bit edition. */
-static DECLCALLBACK(void)
-hdaR3StreamMap_G2H_GenericS32_Mono2Stereo(void *pvDst, void const *pvSrc, uint32_t cFrames, HDASTREAMMAP const *pMap)
-{
-    uint64_t       *pu64Dst    = (uint64_t *)pvDst;
-    uint32_t const *pu32Src    = (uint32_t const *)pvSrc;
-    size_t const    cbSrcFrame = pMap->cbGuestFrame;
-
-    while (cFrames-- > 0)
-    {
-        uint32_t uSample = *pu32Src;
-        *pu64Dst++ = RT_MAKE_U64(uSample, uSample);
-        pu32Src = (uint32_t const *)((uintptr_t)pu32Src + cbSrcFrame);
-    }
-}
-
-
-/** Convert stereo host to 2 or more guest channels, signed 16-bit edition. */
-static DECLCALLBACK(void)
-hdaR3StreamMap_H2G_GenericS16_Stereo2NonMono(void *pvDst, void const *pvSrc, uint32_t cFrames, HDASTREAMMAP const *pMap)
-{
-    uint32_t       *pu32Dst    = (uint32_t *)pvDst;
-    uint32_t const *pu32Src    = (uint32_t const *)pvSrc; /** @todo could be misaligned */
-    size_t const    cbDstFrame = pMap->cbGuestFrame;
-
-    RT_BZERO(pvDst, cbDstFrame * cFrames);
-
-    while (cFrames-- > 0)
-    {
-        *pu32Dst = *pu32Src++;
-        pu32Dst = (uint32_t *)((uintptr_t)pu32Dst + cbDstFrame);
-    }
-}
-
-
-/** Convert 2 or more guest channels to host stereo, signed 16-bit edition. */
-static DECLCALLBACK(void)
-hdaR3StreamMap_G2H_GenericS16_NonMono2Stereo(void *pvDst, void const *pvSrc, uint32_t cFrames, HDASTREAMMAP const *pMap)
-{
-    uint32_t       *pu32Dst    = (uint32_t *)pvDst;
-    uint32_t const *pu32Src    = (uint32_t const *)pvSrc; /** @todo could be misaligned */
-    size_t const    cbSrcFrame = pMap->cbGuestFrame;
-
-    while (cFrames-- > 0)
-    {
-        *pu32Dst++ = *pu32Src;
-        pu32Src = (uint32_t const *)((uintptr_t)pu32Src + cbSrcFrame);
-    }
-}
-
-
-/** Convert stereo host to 2 or more guest channels, signed 32-bit edition. */
-static DECLCALLBACK(void)
-hdaR3StreamMap_H2G_GenericS32_Stereo2NonMono(void *pvDst, void const *pvSrc, uint32_t cFrames, HDASTREAMMAP const *pMap)
-{
-    uint64_t       *pu64Dst    = (uint64_t *)pvDst;         /** @todo could be misaligned. */
-    uint64_t const *pu64Src    = (uint64_t const *)pvSrc;
-    size_t const    cbDstFrame = pMap->cbGuestFrame;
-
-    RT_BZERO(pvDst, cbDstFrame * cFrames);
-
-    while (cFrames-- > 0)
-    {
-        *pu64Dst = *pu64Src++;
-        pu64Dst = (uint64_t *)((uintptr_t)pu64Dst + cbDstFrame);
-    }
-}
-
-
-/** Convert 2 or more guest channels to host stereo, signed 32-bit edition. */
-static DECLCALLBACK(void)
-hdaR3StreamMap_G2H_GenericS32_NonMono2Stereo(void *pvDst, void const *pvSrc, uint32_t cFrames, HDASTREAMMAP const *pMap)
-{
-    uint64_t       *pu64Dst    = (uint64_t *)pvDst;
-    uint64_t const *pu64Src    = (uint64_t const *)pvSrc; /** @todo could be misaligned */
-    size_t const    cbSrcFrame = pMap->cbGuestFrame;
-
-    while (cFrames-- > 0)
-    {
-        *pu64Dst++ = *pu64Src;
-        pu64Src = (uint64_t const *)((uintptr_t)pu64Src + cbSrcFrame);
-    }
-}
-
-
-/** No conversion needed, just copy the data. */
-static DECLCALLBACK(void)
-hdaR3StreamMap_GenericCopy(void *pvDst, void const *pvSrc, uint32_t cFrames, HDASTREAMMAP const *pMap)
-{
-    memcpy(pvDst, pvSrc, cFrames * pMap->cbGuestFrame);
-}
-
-
-/**
- * Sets up a stream mapping according to the given properties / configuration.
- *
- * @return  VBox status code.
- * @retval  VERR_NOT_SUPPORTED if the channel setup is not supported.
- *
- * @param   pMap            Pointer to mapping to set up.
- * @param   pProps          Input: The stream PCM properties from the guest.
- *                          Output: Properties for the host stream.
- * @param   cHostChannels   The number of host channels to map to.
- */
-static int hdaR3StreamMapSetup(PHDASTREAMMAP pMap, PPDMAUDIOPCMPROPS pProps, uint8_t cHostChannels)
-{
-    int rc;
-
-    /** @todo We ASSUME that all channels in a stream ...
-     *        - have the same format
-     *        - are in a consecutive order with no gaps in between
-     *        - have a simple (raw) data layout
-     *        - work in a non-striped fashion, e.g. interleaved (only on one SDn, not spread over multiple SDns) */
-    uint8_t cChannels = PDMAudioPropsChannels(pProps);
-    if  (   cChannels == 1  /* Mono */
-         || cChannels == 2  /* Stereo */
-         || cChannels == 4  /* Quadrophonic */
-         || cChannels == 6) /* Surround (5.1) */
-    {
-        /*
-         * Copy the guest stream properties and see if we need to change the host properties.
-         */
-        memcpy(&pMap->GuestProps, pProps, sizeof(PDMAUDIOPCMPROPS));
-        if (cChannels != cHostChannels)
-        {
-            if (cChannels == 1)
-                LogRelMax(32, ("HDA: Warning: Guest mono, host stereo.\n"));
-            else if (cHostChannels == 1 && cChannels == 2)
-                LogRelMax(32, ("HDA: Warning: Host mono, guest stereo.\n"));
-            else
-#ifndef VBOX_WITH_AUDIO_HDA_51_SURROUND
-                LogRelMax(32, ("HDA: Warning: Guest configured %u channels, host only supports %u. Ignoring additional channels.\n",
-                               cChannels, cHostChannels));
-#else
-# error reconsider the above logic
-#endif
-            PDMAudioPropsSetChannels(pProps, cHostChannels);
-        }
-
-        /*
-         * Pick conversion functions.
-         */
-        Assert(PDMAudioPropsSampleSize(&pMap->GuestProps) == PDMAudioPropsSampleSize(pProps));
-
-        /* If the channel count matches, we can use the memcpy converters: */
-        if (PDMAudioPropsChannels(pProps) == PDMAudioPropsChannels(&pMap->GuestProps))
-        {
-            pMap->pfnGuestToHost = hdaR3StreamMap_GenericCopy;
-            pMap->pfnHostToGuest = hdaR3StreamMap_GenericCopy;
-            pMap->fMappingNeeded = false;
-        }
-        else
-        {
-            /* For multi-speaker guest configs, we currently just pick the
-               first two channels and map this onto the host stereo ones. */
-            AssertReturn(cHostChannels == 2, VERR_NOT_SUPPORTED);
-            switch (PDMAudioPropsSampleSize(&pMap->GuestProps))
-            {
-                case 2:
-                    if (PDMAudioPropsChannels(&pMap->GuestProps) > 1)
-                    {
-                        pMap->pfnGuestToHost = hdaR3StreamMap_G2H_GenericS16_NonMono2Stereo;
-                        pMap->pfnHostToGuest = hdaR3StreamMap_H2G_GenericS16_Stereo2NonMono;
-                    }
-                    else
-                    {
-                        pMap->pfnGuestToHost = hdaR3StreamMap_G2H_GenericS16_Mono2Stereo;
-                        pMap->pfnHostToGuest = hdaR3StreamMap_H2G_GenericS16_Stereo2Mono;
-                    }
-                    break;
-
-                case 4:
-                    if (PDMAudioPropsChannels(&pMap->GuestProps) > 1)
-                    {
-                        pMap->pfnGuestToHost = hdaR3StreamMap_G2H_GenericS32_NonMono2Stereo;
-                        pMap->pfnHostToGuest = hdaR3StreamMap_H2G_GenericS32_Stereo2NonMono;
-                    }
-                    else
-                    {
-                        pMap->pfnGuestToHost = hdaR3StreamMap_G2H_GenericS32_Mono2Stereo;
-                        pMap->pfnHostToGuest = hdaR3StreamMap_H2G_GenericS32_Stereo2Mono;
-                    }
-                    break;
-
-                default:
-                    AssertMsgFailedReturn(("cbSample=%u\n", PDMAudioPropsChannels(&pMap->GuestProps)), VERR_NOT_SUPPORTED);
-            }
-            pMap->fMappingNeeded = true;
-        }
-
-        /** @todo bird: Not sure if this is really needed any more. */
-
-        /* For now we don't have anything other as mono / stereo channels being covered by the backends.
-         * So just set up one channel covering those and skipping the rest (like configured rear or center/LFE outputs). */
-        pMap->cMappings  = 1;
-        pMap->paMappings = (PPDMAUDIOSTREAMMAP)RTMemAlloc(sizeof(PDMAUDIOSTREAMMAP) * pMap->cMappings);
-        if (pMap->paMappings)
-        {
-            PPDMAUDIOSTREAMMAP pMapLR = &pMap->paMappings[0];
-            pMapLR->aenmIDs[0]  = PDMAUDIOCHANNELID_FRONT_LEFT;
-            pMapLR->aenmIDs[1]  = PDMAUDIOCHANNELID_FRONT_RIGHT;
-            pMapLR->cbFrame     = PDMAudioPropsFrameSize(pProps);
-            pMapLR->cbStep      = PDMAudioPropsSampleSize(pProps) * 2 /* Front left + Front right channels */;
-            pMapLR->offFirst    = 0;
-            pMapLR->offNext     = pMapLR->offFirst;
-
-            rc = hdaR3StreamChannelDataInit(&pMapLR->Data, PDMAUDIOSTREAMCHANNELDATA_FLAGS_NONE);
-            AssertRC(rc);
-        }
-        else
-            rc = VERR_NO_MEMORY;
-    }
-    else
-        rc = VERR_NOT_SUPPORTED; /** @todo r=andy Support more setups. */
-
-    return rc;
-}
-
-
-/**
- * Initializes a stream mapping structure according to the given PCM properties.
- *
- * @returns VBox status code.
- * @param   pMap            Pointer to mapping to initialize.
- * @param   cHostChannels   The number of host channels to map to.
- * @param   pProps          Input: The stream PCM properties from the guest.
- *                          Output: Properties for the host side.
- */
-int hdaR3StreamMapInit(PHDASTREAMMAP pMap, uint8_t cHostChannels, PPDMAUDIOPCMPROPS pProps)
-{
-    AssertPtrReturn(pMap, VERR_INVALID_POINTER);
-    AssertPtrReturn(pProps, VERR_INVALID_POINTER);
-
-    if (!AudioHlpPcmPropsAreValid(pProps))
-        return VERR_INVALID_PARAMETER;
-
-    hdaR3StreamMapReset(pMap);
-
-    pMap->cbGuestFrame = PDMAudioPropsFrameSize(pProps);
-    int rc = hdaR3StreamMapSetup(pMap, pProps, cHostChannels);
-    if (RT_SUCCESS(rc))
-    {
-#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
-        /* Create the circular buffer if not created yet. */
-        if (!pMap->pCircBuf)
-            rc = RTCircBufCreate(&pMap->pCircBuf, _4K); /** @todo Make size configurable? */
-        if (RT_SUCCESS(rc))
-#endif
-        {
-            LogFunc(("cChannels=%RU8, cBytes=%RU8 -> cbGuestFrame=%RU32\n",
-                     PDMAudioPropsChannels(pProps), PDMAudioPropsSampleSize(pProps), pMap->cbGuestFrame));
-
-            Assert(pMap->cbGuestFrame); /* Frame size must not be 0. */
-            return VINF_SUCCESS;
-        }
-    }
-
-    return rc;
-}
-
-
-/**
- * Destroys a given stream mapping.
- *
- * @param   pMap            Pointer to mapping to destroy.
- */
-void hdaR3StreamMapDestroy(PHDASTREAMMAP pMap)
-{
-    hdaR3StreamMapReset(pMap);
-
-#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
-    if (pMap->pCircBuf)
-    {
-        RTCircBufDestroy(pMap->pCircBuf);
-        pMap->pCircBuf = NULL;
-    }
-#endif
-}
-
-
-/**
- * Resets a given stream mapping.
- *
- * @param   pMap            Pointer to mapping to reset.
- */
-void hdaR3StreamMapReset(PHDASTREAMMAP pMap)
-{
-    AssertPtrReturnVoid(pMap);
-
-    if (pMap->paMappings)
-    {
-        for (uint8_t i = 0; i < pMap->cMappings; i++)
-            hdaR3StreamChannelDataDestroy(&pMap->paMappings[i].Data);
-
-        RTMemFree(pMap->paMappings);
-        pMap->paMappings = NULL;
-
-        pMap->cMappings = 0;
-    }
-
-    pMap->fMappingNeeded = false;
-    pMap->pfnGuestToHost = hdaR3StreamMap_GenericCopy;
-    pMap->pfnHostToGuest = hdaR3StreamMap_GenericCopy;
-    RT_ZERO(pMap->GuestProps);
-}
-
Index: trunk/src/VBox/Devices/Audio/DevHdaStreamMap.h
===================================================================
--- trunk/src/VBox/Devices/Audio/DevHdaStreamMap.h	(revision 89405)
+++ 	(revision )
@@ -1,86 +1,0 @@
-/* $Id$ */
-/** @file
- * Intel HD Audio Controller Emulation - Stream mapping (e.g. 5.1 -> stereo).
- */
-
-/*
- * Copyright (C) 2017-2020 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#ifndef VBOX_INCLUDED_SRC_Audio_DevHdaStreamMap_h
-#define VBOX_INCLUDED_SRC_Audio_DevHdaStreamMap_h
-#ifndef RT_WITHOUT_PRAGMA_ONCE
-# pragma once
-#endif
-
-/**
- * Audio stream data mapping.
- */
-typedef struct HDASTREAMMAP
-{
-    /** The guest stream properties that is being mapped from/to.
-     * The host properties are found in HDASTREAMSTATE::Cfg::Props.  */
-    PDMAUDIOPCMPROPS                GuestProps;
-    /** The guest side frame size in bytes. */
-    uint8_t                         cbGuestFrame;
-    /** Set if mapping is needed. */
-    bool                            fMappingNeeded;
-    /** Number of mappings in paMappings. */
-    uint8_t                         cMappings;
-    uint8_t                         aPadding[1+4];
-    /** Array of stream mappings.
-     *  Note: The mappings *must* be layed out in an increasing order, e.g.
-     *        how the data appears in the given data block. */
-    R3PTRTYPE(PPDMAUDIOSTREAMMAP)   paMappings;
-#if HC_ARCH_BITS == 32
-    RTR3PTR                         Padding1;
-#endif
-#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
-    /** Circular buffer holding for holding audio data for this mapping. */
-    R3PTRTYPE(PRTCIRCBUF)           pCircBuf;
-#endif
-    /**
-     * Converts guest data to host data.
-     *
-     * @param   pvDst       The destination (host) buffer.
-     * @param   pvSrc       The source (guest) data.  Does not overlap @a pvDst.
-     * @param   cFrames     Number of frames to convert.
-     * @param   pMapping    Pointer to this structure.
-     */
-    DECLR3CALLBACKMEMBER(void, pfnGuestToHost,(void *pvDst, void const *pvSrc, uint32_t cFrames,
-                                               struct HDASTREAMMAP const *pMapping));
-    /**
-     * Converts host data to guest data.
-     *
-     * @param   pvDst       The destination (guest) buffer.
-     * @param   pvSrc       The source (host) data.  Does not overlap @a pvDst.
-     * @param   cFrames     Number of frames to convert.
-     * @param   pMapping    Pointer to this structure.
-     */
-    DECLR3CALLBACKMEMBER(void, pfnHostToGuest,(void *pvDst, void const *pvSrc, uint32_t cFrames,
-                                               struct HDASTREAMMAP const *pMapping));
-} HDASTREAMMAP;
-AssertCompileSizeAlignment(HDASTREAMMAP, 8);
-/** Pointer to an audio stream data mapping. */
-typedef HDASTREAMMAP *PHDASTREAMMAP;
-
-/** @name Stream mapping functions.
- * @{
- */
-#ifdef IN_RING3
-int  hdaR3StreamMapInit(PHDASTREAMMAP pMapping, uint8_t cHostChannels, PPDMAUDIOPCMPROPS pProps);
-void hdaR3StreamMapDestroy(PHDASTREAMMAP pMapping);
-void hdaR3StreamMapReset(PHDASTREAMMAP pMapping);
-#endif
-/** @} */
-
-#endif /* !VBOX_INCLUDED_SRC_Audio_DevHdaStreamMap_h */
-
Index: trunk/src/VBox/Devices/Makefile.kmk
===================================================================
--- trunk/src/VBox/Devices/Makefile.kmk	(revision 89405)
+++ trunk/src/VBox/Devices/Makefile.kmk	(revision 89406)
@@ -642,5 +642,4 @@
 	Audio/DevHdaStream.cpp \
 	Audio/DevHdaStreamChannel.cpp \
-	Audio/DevHdaStreamMap.cpp \
 	Audio/AudioHlp.cpp \
 	Audio/AudioMixBuffer.cpp \
