Changeset 73230 in vbox
- Timestamp:
- Jul 19, 2018 9:53:50 AM (7 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r72110 r73230 961 961 } 962 962 963 if (pThis-> Dbg.fEnabled)963 if (pThis->Out.Cfg.Dbg.fEnabled) 964 964 DrvAudioHlpFileWrite(pHstStream->Out.Dbg.pFileStreamWrite, pvBuf, cbBuf, 0 /* fFlags */); 965 965 … … 1326 1326 && cbPlayed) 1327 1327 { 1328 if (pThis-> Dbg.fEnabled)1328 if (pThis->Out.Cfg.Dbg.fEnabled) 1329 1329 DrvAudioHlpFileWrite(pHstStream->Out.Dbg.pFilePlayNonInterleaved, auBuf, cbPlayed, 0 /* fFlags */); 1330 1330 … … 1634 1634 else if (cbCaptured) 1635 1635 { 1636 if (pThis-> Dbg.fEnabled)1636 if (pThis->In.Cfg.Dbg.fEnabled) 1637 1637 DrvAudioHlpFileWrite(pHstStream->In.Dbg.pFileCaptureNonInterleaved, auBuf, cbCaptured, 0 /* fFlags */); 1638 1638 … … 2210 2210 2211 2211 /* 2212 * Configure driver from CFGM stuff.2212 * Configure driver from CFGM. 2213 2213 */ 2214 2214 #ifdef DEBUG … … 2227 2227 CFGMR3QueryBoolDef(pThis->pCFGMNode, "OutputEnabled", &pThis->Out.fEnabled, false); 2228 2228 2229 CFGMR3QueryBoolDef(pThis->pCFGMNode, "DebugEnabled", &pThis->Dbg.fEnabled, false); 2230 rc2 = CFGMR3QueryString(pThis->pCFGMNode, "DebugPathOut", pThis->Dbg.szPathOut, sizeof(pThis->Dbg.szPathOut)); 2229 /* Input configuration. */ 2230 /** @todo Separate debugging stuff if needed. Later. */ 2231 CFGMR3QueryBoolDef(pThis->pCFGMNode, "DebugEnabled", &pThis->In.Cfg.Dbg.fEnabled, false); 2232 rc2 = CFGMR3QueryString(pThis->pCFGMNode, "DebugPathOut", pThis->In.Cfg.Dbg.szPathOut, sizeof(pThis->In.Cfg.Dbg.szPathOut)); 2231 2233 if ( RT_FAILURE(rc2) 2232 || !strlen(pThis->Dbg.szPathOut)) 2233 { 2234 RTStrPrintf(pThis->Dbg.szPathOut, sizeof(pThis->Dbg.szPathOut), VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH); 2235 } 2236 2237 if (pThis->Dbg.fEnabled) 2238 LogRel(("Audio: Debugging enabled (audio data written to '%s')\n", pThis->Dbg.szPathOut)); 2234 || !strlen(pThis->In.Cfg.Dbg.szPathOut)) 2235 { 2236 RTStrPrintf(pThis->In.Cfg.Dbg.szPathOut, sizeof(pThis->In.Cfg.Dbg.szPathOut), VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH); 2237 } 2238 2239 if (pThis->In.Cfg.Dbg.fEnabled) 2240 LogRel(("Audio: Debugging input enabled (audio data written to '%s')\n", pThis->In.Cfg.Dbg.szPathOut)); 2241 2242 /* Output configuration. */ 2243 CFGMR3QueryBoolDef(pThis->pCFGMNode, "DebugEnabled", &pThis->Out.Cfg.Dbg.fEnabled, false); 2244 rc2 = CFGMR3QueryString(pThis->pCFGMNode, "DebugPathOut", pThis->Out.Cfg.Dbg.szPathOut, sizeof(pThis->Out.Cfg.Dbg.szPathOut)); 2245 if ( RT_FAILURE(rc2) 2246 || !strlen(pThis->Out.Cfg.Dbg.szPathOut)) 2247 { 2248 RTStrPrintf(pThis->Out.Cfg.Dbg.szPathOut, sizeof(pThis->Out.Cfg.Dbg.szPathOut), VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH); 2249 } 2250 2251 if (pThis->Out.Cfg.Dbg.fEnabled) 2252 LogRel(("Audio: Debugging output enabled (audio data written to '%s')\n", pThis->Out.Cfg.Dbg.szPathOut)); 2239 2253 2240 2254 LogRel2(("Audio: Initial status for driver '%s': Input is %s, output is %s\n", … … 2327 2341 if (cReadTotal) 2328 2342 { 2329 if (pThis-> Dbg.fEnabled)2343 if (pThis->In.Cfg.Dbg.fEnabled) 2330 2344 DrvAudioHlpFileWrite(pHstStream->In.Dbg.pFileStreamRead, 2331 2345 pvBuf, AUDIOMIXBUF_F2B(&pGstStream->MixBuf, cReadTotal), 0 /* fFlags */); … … 2558 2572 if (pCfgHost->enmDir == PDMAUDIODIR_IN) 2559 2573 { 2560 if (pThis-> Dbg.fEnabled)2574 if (pThis->In.Cfg.Dbg.fEnabled) 2561 2575 { 2562 2576 char szFile[RTPATH_MAX + 1]; 2563 2577 2564 int rc2 = DrvAudioHlpGetFileName(szFile, RT_ELEMENTS(szFile), pThis-> Dbg.szPathOut, "CaptureNonInterleaved",2578 int rc2 = DrvAudioHlpGetFileName(szFile, RT_ELEMENTS(szFile), pThis->In.Cfg.Dbg.szPathOut, "CaptureNonInterleaved", 2565 2579 pThis->pDrvIns->iInstance, PDMAUDIOFILETYPE_WAV, PDMAUDIOFILENAME_FLAG_NONE); 2566 2580 if (RT_SUCCESS(rc2)) … … 2575 2589 if (RT_SUCCESS(rc2)) 2576 2590 { 2577 rc2 = DrvAudioHlpGetFileName(szFile, RT_ELEMENTS(szFile), pThis-> Dbg.szPathOut, "StreamRead",2591 rc2 = DrvAudioHlpGetFileName(szFile, RT_ELEMENTS(szFile), pThis->In.Cfg.Dbg.szPathOut, "StreamRead", 2578 2592 pThis->pDrvIns->iInstance, PDMAUDIOFILETYPE_WAV, PDMAUDIOFILENAME_FLAG_NONE); 2579 2593 if (RT_SUCCESS(rc2)) … … 2593 2607 else /* Out */ 2594 2608 { 2595 if (pThis-> Dbg.fEnabled)2609 if (pThis->Out.Cfg.Dbg.fEnabled) 2596 2610 { 2597 2611 char szFile[RTPATH_MAX + 1]; 2598 2612 2599 int rc2 = DrvAudioHlpGetFileName(szFile, RT_ELEMENTS(szFile), pThis-> Dbg.szPathOut, "PlayNonInterleaved",2613 int rc2 = DrvAudioHlpGetFileName(szFile, RT_ELEMENTS(szFile), pThis->Out.Cfg.Dbg.szPathOut, "PlayNonInterleaved", 2600 2614 pThis->pDrvIns->iInstance, PDMAUDIOFILETYPE_WAV, PDMAUDIOFILENAME_FLAG_NONE); 2601 2615 if (RT_SUCCESS(rc2)) … … 2610 2624 if (RT_SUCCESS(rc2)) 2611 2625 { 2612 rc2 = DrvAudioHlpGetFileName(szFile, RT_ELEMENTS(szFile), pThis-> Dbg.szPathOut, "StreamWrite",2626 rc2 = DrvAudioHlpGetFileName(szFile, RT_ELEMENTS(szFile), pThis->Out.Cfg.Dbg.szPathOut, "StreamWrite", 2613 2627 pThis->pDrvIns->iInstance, PDMAUDIOFILETYPE_WAV, PDMAUDIOFILENAME_FLAG_NONE); 2614 2628 if (RT_SUCCESS(rc2)) … … 2961 2975 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pHstStream->In.StatFramesCaptured); 2962 2976 #endif 2963 if (pThis-> Dbg.fEnabled)2977 if (pThis->In.Cfg.Dbg.fEnabled) 2964 2978 { 2965 2979 DrvAudioHlpFileDestroy(pHstStream->In.Dbg.pFileCaptureNonInterleaved); … … 2972 2986 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pHstStream->Out.StatFramesPlayed); 2973 2987 #endif 2974 if (pThis-> Dbg.fEnabled)2988 if (pThis->Out.Cfg.Dbg.fEnabled) 2975 2989 { 2976 2990 DrvAudioHlpFileDestroy(pHstStream->Out.Dbg.pFilePlayNonInterleaved); -
trunk/src/VBox/Devices/Audio/DrvAudio.h
r73220 r73230 73 73 } DRVAUDIOSTATS, *PDRVAUDIOSTATS; 74 74 #endif 75 76 /** 77 * Audio driver configuration data, tweakable via CFGM. 78 */ 79 typedef struct DRVAUDIOCFG 80 { 81 /** Configures the period size (in audio frames). 82 * This value reflects the number of audio frames in between each hardware interrupt on the 83 * backend (host) side. */ 84 uint32_t cfPeriod; 85 /** Configures the (ring) buffer size (in audio frames). Often is a multiple of cfPeriod. */ 86 uint32_t cfBufferSize; 87 /** Configures the pre-buffering size (in audio frames). 88 * Frames needed in buffer before the stream becomes active (pre buffering). 89 * The bigger this value is, the more latency for the stream will occur. */ 90 uint32_t cfPreBuf; 91 /** The driver's debugging configuration. */ 92 struct 93 { 94 /** Whether audio debugging is enabled or not. */ 95 bool fEnabled; 96 /** Where to store the debugging files. 97 * Defaults to VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH if not set. */ 98 char szPathOut[RTPATH_MAX + 1]; 99 } Dbg; 100 } DRVAUDIOCFG, *PDRVAUDIOCFG; 75 101 76 102 /** … … 120 146 RTLISTANCHOR lstCB; 121 147 #endif 148 /** The driver's input confguration (tweakable via CFGM). */ 149 DRVAUDIOCFG Cfg; 122 150 } In; 123 151 struct … … 132 160 RTLISTANCHOR lstCB; 133 161 #endif 162 /** The driver's output confguration (tweakable via CFGM). */ 163 DRVAUDIOCFG Cfg; 134 164 } Out; 135 struct136 {137 /** Whether audio debugging is enabled or not. */138 bool fEnabled;139 /** Where to store the debugging files.140 * Defaults to VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH if not set. */141 char szPathOut[RTPATH_MAX + 1];142 } Dbg;143 165 } DRVAUDIO, *PDRVAUDIO; 144 166
Note:
See TracChangeset
for help on using the changeset viewer.