Changeset 71733 in vbox
- Timestamp:
- Apr 7, 2018 2:35:47 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 121835
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/HDAStream.h
r70964 r71733 24 24 #include "HDAStreamPeriod.h" 25 25 26 /*********************************************************************************************************************************27 * Prototypes *28 *********************************************************************************************************************************/29 26 30 27 typedef struct HDAMIXERSINK *PHDAMIXERSINK; -
trunk/src/VBox/Devices/Audio/HDAStreamPeriod.cpp
r71711 r71733 3 3 * HDAStreamPeriod.cpp - Stream period functions for HD Audio. 4 4 * 5 * Utility functions for handling HDA audio stream periods. 6 * Stream periodhandling is needed in order to keep track of a stream's timing5 * Utility functions for handling HDA audio stream periods. Stream period 6 * handling is needed in order to keep track of a stream's timing 7 7 * and processed audio data. 8 8 * 9 * As the HDA device only has one bit clock (WALCLK) but audio streams can be processed10 * at certain points in time, these functions can be used to estimate and schedule the11 * wall clock (WALCLK) for all streams accordingly.9 * As the HDA device only has one bit clock (WALCLK) but audio streams can be 10 * processed at certain points in time, these functions can be used to estimate 11 * and schedule the wall clock (WALCLK) for all streams accordingly. 12 12 */ 13 13 … … 39 39 #include "HDAStreamPeriod.h" 40 40 41 #ifdef IN_RING3 41 42 #ifdef IN_RING3 /* entire file currently */ 43 42 44 /** 43 45 * Creates a stream period. … … 51 53 52 54 int rc = RTCritSectInit(&pPeriod->CritSect); 53 if (RT_SUCCESS(rc)) 54 { 55 pPeriod->fStatus = HDASTREAMPERIOD_FLAG_VALID; 56 } 55 AssertRCReturnStmt(rc, pPeriod->fStatus = 0, rc); 56 pPeriod->fStatus = HDASTREAMPERIOD_FLAG_VALID; 57 57 58 58 return VINF_SUCCESS; … … 143 143 pPeriod->framesTransferred = 0; 144 144 pPeriod->cIntPending = 0; 145 # ifdef DEBUG145 # ifdef LOG_ENABLED 146 146 pPeriod->Dbg.tsStartNs = 0; 147 # endif147 # endif 148 148 } 149 149 … … 164 164 pPeriod->framesTransferred = 0; 165 165 pPeriod->cIntPending = 0; 166 # ifdef DEBUG166 # ifdef LOG_ENABLED 167 167 pPeriod->Dbg.tsStartNs = RTTimeNanoTS(); 168 #endif 169 170 Log3Func(("[SD%RU8] Starting @ %RU64 (%RU64 long)\n", 171 pPeriod->u8SD, pPeriod->u64StartWalClk, pPeriod->u64DurationWalClk)); 172 168 # endif 169 170 Log3Func(("[SD%RU8] Starting @ %RU64 (%RU64 long)\n", pPeriod->u8SD, pPeriod->u64StartWalClk, pPeriod->u64DurationWalClk)); 173 171 return VINF_SUCCESS; 174 172 } … … 257 255 { 258 256 /* Prevent division by zero. */ 259 const uint32_t uHz = (pPeriod->u32Hz ? pPeriod->u32Hz : 1);257 const uint32_t uHz = pPeriod->u32Hz ? pPeriod->u32Hz : 1; 260 258 261 259 /* 24 MHz wall clock (WALCLK): 42ns resolution. */ … … 272 270 uint64_t hdaStreamPeriodGetAbsElapsedWalClk(PHDASTREAMPERIOD pPeriod) 273 271 { 274 return 275 276 272 return pPeriod->u64StartWalClk 273 + pPeriod->u64ElapsedWalClk 274 + pPeriod->i64DelayWalClk; 277 275 } 278 276 -
trunk/src/VBox/Devices/Audio/HDAStreamPeriod.h
r69723 r71733 23 23 # include <iprt/time.h> 24 24 #endif 25 #include <VBox/log.h> /* LOG_ENABLED */ 25 26 26 27 struct HDASTREAM; 27 28 typedef HDASTREAM *PHDASTREAM; 28 29 29 #ifdef DEBUG30 #ifdef LOG_ENABLED 30 31 /** 31 32 * Structure for debug information of an HDA stream's period. … … 76 77 uint8_t cIntPending; 77 78 uint8_t Padding3[7]; 78 #ifdef DEBUG79 #ifdef LOG_ENABLED 79 80 /** Debugging information. */ 80 81 HDASTREAMPERIODDBGINFO Dbg;
Note:
See TracChangeset
for help on using the changeset viewer.