Index: trunk/src/VBox/Devices/Audio/DevHda.cpp
===================================================================
--- trunk/src/VBox/Devices/Audio/DevHda.cpp	(revision 88933)
+++ trunk/src/VBox/Devices/Audio/DevHda.cpp	(revision 88934)
@@ -1341,8 +1341,6 @@
         STAM_REL_PROFILE_START_NS(&pStreamR3->State.StatReset, a);
         hdaStreamLock(pStreamShared);
-
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
         hdaR3StreamAsyncIOLock(pStreamR3);
-# endif
+
         /* Deal with reset while running. */
         if (pStreamShared->State.fRunning)
@@ -1355,7 +1353,5 @@
         hdaR3StreamReset(pThis, pThisCC, pStreamShared, pStreamR3, uSD);
 
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
         hdaR3StreamAsyncIOUnlock(pStreamR3);
-# endif
         hdaStreamUnlock(pStreamShared);
         STAM_REL_PROFILE_STOP_NS(&pStreamR3->State.StatReset, a);
@@ -1375,11 +1371,8 @@
 
             int rc2 = VINF_SUCCESS;
-
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
             if (fRun)
                 rc2 = hdaR3StreamAsyncIOCreate(pStreamR3);
 
             hdaR3StreamAsyncIOLock(pStreamR3);
-# endif
             if (fRun)
             {
@@ -1466,8 +1459,6 @@
             }
 
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
+            /* Make sure to leave the lock before (eventually) starting the timer. */
             hdaR3StreamAsyncIOUnlock(pStreamR3);
-# endif
-            /* Make sure to leave the lock before (eventually) starting the timer. */
             hdaStreamUnlock(pStreamShared);
             STAM_REL_PROFILE_STOP_NS((fRun ? &pStreamR3->State.StatStart : &pStreamR3->State.StatStop), r);
@@ -2813,7 +2804,5 @@
         PHDASTREAM const pStreamShared = &pThis->aStreams[idxStream];
         hdaStreamLock(pStreamShared);
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
         hdaR3StreamAsyncIOLock(&pThisCC->aStreams[idxStream]);
-# endif
 
         /* We're doing this unconditionally, hope that's not problematic in any way... */
@@ -2825,7 +2814,5 @@
         hdaR3StreamReset(pThis, pThisCC, pStreamShared, &pThisCC->aStreams[idxStream], (uint8_t)idxStream);
 
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
         hdaR3StreamAsyncIOUnlock(&pThisCC->aStreams[idxStream]);
-# endif
         hdaStreamUnlock(pStreamShared);
     }
@@ -3411,16 +3398,12 @@
         cbCircBuf = (uint32_t)RTCircBufSize(pStreamR3->State.pCircBuf);
 
-#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
         /* We take the AIO lock here and releases it after saving the buffer,
            otherwise the AIO thread could race us reading out the buffer data. */
         if (   !pStreamR3->State.AIO.fStarted
             || RT_SUCCESS(RTCritSectTryEnter(&pStreamR3->State.AIO.CritSect)))
-#endif
         {
             cbCircBufUsed = (uint32_t)RTCircBufUsed(pStreamR3->State.pCircBuf);
-#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
             if (cbCircBufUsed == 0 && pStreamR3->State.AIO.fStarted)
                 RTCritSectLeave(&pStreamR3->State.AIO.CritSect);
-#endif
         }
     }
@@ -3445,8 +3428,6 @@
         RTCircBufReleaseReadBlock(pStreamR3->State.pCircBuf, 0 /* Don't advance read pointer! */);
 
-#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
         if (pStreamR3->State.AIO.fStarted)
             RTCritSectLeave(&pStreamR3->State.AIO.CritSect);
-#endif
     }
 
@@ -3516,13 +3497,10 @@
             PHDASTREAMR3 pStreamR3 = &pThisCC->aStreams[i];
 
-            int rc2;
-#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
             /* Make sure to also create the async I/O thread before actually enabling the stream. */
-            rc2 = hdaR3StreamAsyncIOCreate(pStreamR3);
+            int rc2 = hdaR3StreamAsyncIOCreate(pStreamR3);
             AssertRC(rc2);
 
             /* ... and enabling it. */
             hdaR3StreamAsyncIOEnable(pStreamR3, true /* fEnable */);
-#endif
             /* (Re-)enable the stream. */
             rc2 = hdaR3StreamEnable(pThis, pStreamShared, pStreamR3, true /* fEnable */);
@@ -4938,8 +4916,4 @@
                                 NULL /*pfnLoadPrep*/, hdaR3LoadExec, hdaR3LoadDone);
     AssertRCReturn(rc, rc);
-
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
-    LogRel(("HDA: Asynchronous I/O enabled\n"));
-# endif
 
     /*
Index: trunk/src/VBox/Devices/Audio/DevHdaStream.cpp
===================================================================
--- trunk/src/VBox/Devices/Audio/DevHdaStream.cpp	(revision 88933)
+++ trunk/src/VBox/Devices/Audio/DevHdaStream.cpp	(revision 88934)
@@ -79,5 +79,4 @@
 #endif
 
-#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
     AssertPtr(pStreamR3->pHDAStateR3);
     AssertPtr(pStreamR3->pHDAStateR3->pDevIns);
@@ -85,5 +84,4 @@
                                RT_SRC_POS, "hda_sd#%RU8", pStreamShared->u8SD);
     AssertRCReturn(rc, rc);
-#endif
 
 #ifdef DEBUG
@@ -174,10 +172,7 @@
     int rc2;
 
-#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
     rc2 = hdaR3StreamAsyncIODestroy(pStreamR3);
     AssertRC(rc2);
-#endif
-
-#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
+
     if (PDMCritSectIsInitialized(&pStreamShared->CritSect))
     {
@@ -185,5 +180,4 @@
         AssertRC(rc2);
     }
-#endif
 
     if (pStreamR3->State.pCircBuf)
@@ -1955,5 +1949,5 @@
  *
  * This routine is called by both, the synchronous and the asynchronous
- * (VBOX_WITH_AUDIO_HDA_ASYNC_IO), implementations.
+ * implementations.
  *
  * When running synchronously, the device DMA transfers *and* the mixer sink
@@ -2009,7 +2003,5 @@
     {
         bool fDoRead; /* Whether to push data down the driver stack or not.  */
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
         if (fInTimer)
-# endif
         {
             /*
@@ -2025,5 +2017,4 @@
                 Log(("hdaR3StreamUpdate: Warning! Stream #%u has insufficient space free: %u bytes, need %u.  Will try move data out of the buffer...\n",
                      pStreamShared->u8SD, cbStreamFree, cbPeriod));
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
                 int rc = RTCritSectTryEnter(&pStreamR3->State.AIO.CritSect);
                 if (RT_SUCCESS(rc))
@@ -2034,7 +2025,4 @@
                 else
                     RTThreadYield();
-#else
-                hdaR3StreamPushToMixer(pStreamShared, pStreamR3, pSink, tsNowNs);
-#endif
                 Log(("hdaR3StreamUpdate: Gained %u bytes.\n", hdaR3StreamGetFree(pStreamR3) - cbStreamFree));
 
@@ -2061,16 +2049,12 @@
              * Do the DMA transfer.
              */
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
             rc2 = PDMDevHlpCritSectEnter(pDevIns, &pStreamShared->CritSect, VERR_IGNORED);
             AssertRC(rc2);
-# endif
 
             uint64_t const offWriteBefore = pStreamR3->State.offWrite;
             hdaR3StreamDoDmaOutput(pDevIns, pThis, pStreamShared, pStreamR3, RT_MIN(cbStreamFree, cbPeriod), tsNowNs);
 
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
             rc2 = PDMDevHlpCritSectLeave(pDevIns, &pStreamShared->CritSect);
             AssertRC(rc2);
-# endif
 
             /*
@@ -2113,10 +2097,8 @@
             if (fDoRead)
             {
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
                 /* Notify the async I/O worker thread that there's work to do. */
                 Log5Func(("Notifying AIO thread\n"));
                 rc2 = hdaR3StreamAsyncIONotify(pStreamR3);
                 AssertRC(rc2);
-# endif
                 /* Update last read timestamp for logging/debugging. */
                 pStreamShared->State.tsLastReadNs = tsNowNs;
@@ -2128,9 +2110,5 @@
          * the mixer and in direction of the host audio devices.
          */
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
         else
-# else
-        if (fDoRead)
-# endif
             hdaR3StreamPushToMixer(pStreamShared, pStreamR3, pSink, tsNowNs);
     }
@@ -2146,11 +2124,7 @@
          * from the mixer and into our internal DMA buffer.
          */
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
         if (!fInTimer)
-# endif
             hdaR3StreamPullFromMixer(pStreamShared, pStreamR3, pSink);
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
-        else /* fInTimer */
-# endif
+        else
         {
             /*
@@ -2197,5 +2171,4 @@
                 Log(("hdaR3StreamUpdate: Warning! Stream #%u has insufficient data available: %u bytes, need %u.  Will try move pull more data into the buffer...\n",
                      pStreamShared->u8SD, cbStreamUsed, cbPeriod));
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
                 int rc = RTCritSectTryEnter(&pStreamR3->State.AIO.CritSect);
                 if (RT_SUCCESS(rc))
@@ -2206,7 +2179,4 @@
                 else
                     RTThreadYield();
-#else
-                hdaR3StreamPullFromMixer(pStreamShared, pStreamR3, pSink);
-#endif
                 Log(("hdaR3StreamUpdate: Gained %u bytes.\n", hdaR3StreamGetUsed(pStreamR3) - cbStreamUsed));
                 cbStreamUsed = hdaR3StreamGetUsed(pStreamR3);
@@ -2220,7 +2190,5 @@
                     do
                     {
-#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
                         RTCritSectEnter(&pStreamR3->State.AIO.CritSect);
-#endif
                         cbStreamUsed = hdaR3StreamGetUsed(pStreamR3);
                         if (cbStreamUsed < cbPeriod)
@@ -2241,7 +2209,5 @@
                         }
 
-#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
                         RTCritSectLeave(&pStreamR3->State.AIO.CritSect);
-#endif
                     } while (cbStreamUsed < cbPeriod);
                     if (cbSilence > 0)
@@ -2260,19 +2226,14 @@
             if (cbStreamUsed)
             {
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
                 rc2 = PDMDevHlpCritSectEnter(pDevIns, &pStreamShared->CritSect, VERR_IGNORED);
                 AssertRC(rc2);
-# endif
 
                 hdaR3StreamDoDmaInput(pDevIns, pThis, pStreamShared, pStreamR3,
                                       RT_MIN(cbStreamUsed, cbPeriod), fWriteSilence, tsNowNs);
 
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
                 rc2 = PDMDevHlpCritSectLeave(pDevIns, &pStreamShared->CritSect);
                 AssertRC(rc2);
-# endif
             }
 
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
             /*
              * We should always kick the AIO thread.
@@ -2285,5 +2246,4 @@
             AssertRC(rc2);
             pStreamShared->State.tsLastReadNs = tsNowNs;
-# endif
         }
     }
@@ -2301,8 +2261,6 @@
 {
     AssertPtrReturnVoid(pStreamShared);
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
     int rc2 = PDMCritSectEnter(&pStreamShared->CritSect, VINF_SUCCESS);
     AssertRC(rc2);
-#endif
 }
 
@@ -2316,8 +2274,6 @@
 {
     AssertPtrReturnVoid(pStreamShared);
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
     int rc2 = PDMCritSectLeave(&pStreamShared->CritSect);
     AssertRC(rc2);
-# endif
 }
 
@@ -2531,5 +2487,4 @@
 
 # endif /* HDA_USE_DMA_ACCESS_HANDLER */
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
 
 /**
@@ -2724,4 +2679,3 @@
 }
 
-# endif /* VBOX_WITH_AUDIO_HDA_ASYNC_IO */
 #endif /* IN_RING3 */
Index: trunk/src/VBox/Devices/Audio/DevHdaStream.h
===================================================================
--- trunk/src/VBox/Devices/Audio/DevHdaStream.h	(revision 88933)
+++ trunk/src/VBox/Devices/Audio/DevHdaStream.h	(revision 88934)
@@ -26,5 +26,4 @@
 
 
-#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
 /**
  * HDA stream's state for asynchronous I/O.
@@ -48,5 +47,4 @@
 /** Pointer to a HDA stream's asynchronous I/O state. */
 typedef HDASTREAMSTATEAIO *PHDASTREAMSTATEAIO;
-#endif
 
 /**
@@ -268,5 +266,4 @@
     TMTIMERHANDLE               hTimer;
 
-#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
     /** Pad the structure size to a 64 byte alignment. */
     uint64_t                    au64Padding1[4];
@@ -274,5 +271,4 @@
      * I/O thread and (basically) the guest. */
     PDMCRITSECT                 CritSect;
-#endif
 } HDASTREAM;
 AssertCompileMemberAlignment(HDASTREAM, State.aBdl, 16);
@@ -312,8 +308,6 @@
         RTLISTANCHORR3          lstDMAHandlers;
 #endif
-#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
         /** Asynchronous I/O state members. */
         HDASTREAMSTATEAIO       AIO;
-#endif
         /** Size of the DMA buffer (pCircBuf) in bytes. */
         uint32_t                StatDmaBufSize;
@@ -378,5 +372,4 @@
  * @{
  */
-# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
 int                 hdaR3StreamAsyncIOCreate(PHDASTREAMR3 pStreamR3);
 void                hdaR3StreamAsyncIOLock(PHDASTREAMR3 pStreamR3);
@@ -384,5 +377,4 @@
 void                hdaR3StreamAsyncIOEnable(PHDASTREAMR3 pStreamR3, bool fEnable);
 int                 hdaR3StreamAsyncIONotify(PHDASTREAMR3 pStreamR3);
-# endif /* VBOX_WITH_AUDIO_HDA_ASYNC_IO */
 /** @} */
 
Index: trunk/src/VBox/Devices/Config.kmk
===================================================================
--- trunk/src/VBox/Devices/Config.kmk	(revision 88933)
+++ trunk/src/VBox/Devices/Config.kmk	(revision 88934)
@@ -116,12 +116,6 @@
 endif
 
-#
-# Enables asynchronous audio data handling
-# to speed up the actual DMA data routines and keeping up
-# audio processing out of EMT as much as possible.
-#
-# Disabled for AC'97 for now.
+# AC'97 needs testing:
 #VBOX_AUDIO_DEFS  += VBOX_WITH_AUDIO_AC97_ASYNC_IO
-VBOX_AUDIO_DEFS += VBOX_WITH_AUDIO_HDA_ASYNC_IO
 VBOX_AUDIO_DEFS += VBOX_WITH_AUDIO_SB16_ASYNC_IO
 
