- Timestamp:
- Dec 29, 2016 11:49:54 AM (8 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r65015 r65027 935 935 936 936 #ifdef VBOX_WITH_STATISTICS 937 STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesMixed, csMixed); 938 STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesLost, csWritten - csMixed); 937 STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesMixedOut, csMixed); 938 Assert(csWritten >= csMixed); 939 STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesLostOut, csWritten - csMixed); 939 940 STAM_COUNTER_ADD(&pThis->Stats.TotalBytesWritten, cbWritten); 940 941 STAM_COUNTER_ADD(&pGstStream->Out.StatBytesTotalWritten, cbWritten); … … 1080 1081 do 1081 1082 { 1082 uint32_t c SamplesMixed = 0;1083 uint32_t csMixed = 0; 1083 1084 1084 1085 rc = pThis->pHostDrvAudio->pfnStreamIterate(pThis->pHostDrvAudio, pHstStream); … … 1089 1090 { 1090 1091 /* Has the host captured any samples which were not mixed to the guest side yet? */ 1091 uint32_t c SamplesCaptured = AudioMixBufUsed(&pHstStream->MixBuf);1092 if (c SamplesCaptured)1092 uint32_t csCaptured = AudioMixBufUsed(&pHstStream->MixBuf); 1093 if (csCaptured) 1093 1094 { 1094 1095 /* When capturing samples, the guest is the parent while the host is the child. 1095 1096 * So try mixing not yet mixed host-side samples to the guest-side buffer. */ 1096 rc = AudioMixBufMixToParent(&pHstStream->MixBuf, c SamplesCaptured, &cSamplesMixed);1097 rc = AudioMixBufMixToParent(&pHstStream->MixBuf, csCaptured, &csMixed); 1097 1098 if (RT_FAILURE(rc)) 1098 1099 { … … 1106 1107 } 1107 1108 1108 Log3Func(("[%s] %RU32/%RU32 input samples mixed, rc=%Rrc\n", pHstStream->szName, cSamplesMixed, cSamplesCaptured, rc)); 1109 #ifdef VBOX_WITH_STATISTICS 1110 STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesMixedIn, csMixed); 1111 Assert(csCaptured >= csMixed); 1112 STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesLostIn, csCaptured - csMixed); 1113 #endif 1114 Log3Func(("[%s] %RU32/%RU32 input samples mixed, rc=%Rrc\n", pHstStream->szName, csMixed, csCaptured, rc)); 1109 1115 } 1110 1116 else … … 1249 1255 { 1250 1256 #ifdef VBOX_WITH_STATISTICS 1251 STAM_COUNTER_ADD(&pThis->Stats.TotalSamples Played, csPlayed);1257 STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesOut, csPlayed); 1252 1258 STAM_PROFILE_ADV_STOP(&pThis->Stats.DelayOut, out); 1253 1259 STAM_COUNTER_ADD(&pHstStream->Out.StatSamplesPlayed, csPlayed); … … 1315 1321 pStream->szName, pStream->enmDir)); 1316 1322 1317 uint32_t c SamplesCaptured = 0;1323 uint32_t csCaptured = 0; 1318 1324 1319 1325 do … … 1336 1342 PDMAUDIOSTRMSTS stsBackend = pThis->pHostDrvAudio->pfnStreamGetStatus(pThis->pHostDrvAudio, pHstStream); 1337 1343 1338 uint32_t c SamplesLive = AudioMixBufLive(&pGstStream->MixBuf);1339 if (!c SamplesLive)1344 uint32_t csLive = AudioMixBufLive(&pGstStream->MixBuf); 1345 if (!csLive) 1340 1346 { 1341 1347 if ( (stsBackend & PDMAUDIOSTRMSTS_FLAG_ENABLED) … … 1343 1349 { 1344 1350 rc = pThis->pHostDrvAudio->pfnStreamCapture(pThis->pHostDrvAudio, pHstStream, NULL /* pvBuf */, 0 /* cbBuf */, 1345 &c SamplesCaptured);1351 &csCaptured); 1346 1352 if (RT_FAILURE(rc)) 1347 1353 { … … 1352 1358 { 1353 1359 #ifdef VBOX_WITH_STATISTICS 1354 STAM_COUNTER_ADD(&pThis->Stats.TotalSamples Captured, cSamplesCaptured);1355 STAM_COUNTER_ADD(&pHstStream->In.StatSamplesCaptured, c SamplesCaptured);1356 #endif 1357 Log3Func(("[%s] %RU32 samples captured\n", pHstStream->szName, c SamplesCaptured));1360 STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesIn, csCaptured); 1361 STAM_COUNTER_ADD(&pHstStream->In.StatSamplesCaptured, csCaptured); 1362 #endif 1363 Log3Func(("[%s] %RU32 samples captured\n", pHstStream->szName, csCaptured)); 1358 1364 } 1359 1365 } … … 1368 1374 } 1369 1375 else 1370 Log3Func(("[%s] Skipping (still has %RU32 live samples)\n", pHstStream->szName, c SamplesLive));1376 Log3Func(("[%s] Skipping (still has %RU32 live samples)\n", pHstStream->szName, csLive)); 1371 1377 1372 1378 } while (0); … … 1375 1381 { 1376 1382 if (pcSamplesCaptured) 1377 *pcSamplesCaptured = c SamplesCaptured;1383 *pcSamplesCaptured = csCaptured; 1378 1384 } 1379 1385 else … … 2662 2668 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesWritten, "TotalSamplesWritten", 2663 2669 STAMUNIT_COUNT, "Total samples written by device emulation "); 2664 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesMixed, "TotalSamplesMixed", 2665 STAMUNIT_COUNT, "Total samples mixed."); 2666 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesLost, "TotalSamplesLost", 2667 STAMUNIT_COUNT, "Total samples lost."); 2668 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesPlayed, "TotalSamplesPlayed", 2670 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesMixedIn, "TotalSamplesMixedIn", 2671 STAMUNIT_COUNT, "Total input samples mixed."); 2672 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesMixedOut, "TotalSamplesMixedOut", 2673 STAMUNIT_COUNT, "Total output samples mixed."); 2674 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesLostIn, "TotalSamplesLostIn", 2675 STAMUNIT_COUNT, "Total input samples lost."); 2676 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesLostOut, "TotalSamplesLostOut", 2677 STAMUNIT_COUNT, "Total output samples lost."); 2678 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesOut, "TotalSamplesPlayed", 2669 2679 STAMUNIT_COUNT, "Total samples played by backend."); 2670 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamples Captured, "TotalSamplesCaptured",2680 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesIn, "TotalSamplesCaptured", 2671 2681 STAMUNIT_COUNT, "Total samples captured by backend."); 2672 2682 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalBytesRead, "TotalBytesRead", … … 2766 2776 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesRead); 2767 2777 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesWritten); 2768 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesMixed); 2769 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesLost); 2770 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesPlayed); 2771 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesCaptured); 2778 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesMixedIn); 2779 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesMixedOut); 2780 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesLostIn); 2781 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesLostOut); 2782 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesOut); 2783 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesIn); 2772 2784 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalBytesRead); 2773 2785 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalBytesWritten); -
trunk/src/VBox/Devices/Audio/DrvAudio.h
r65012 r65027 84 84 STAMCOUNTER TotalSamplesRead; 85 85 STAMCOUNTER TotalSamplesWritten; 86 STAMCOUNTER TotalSamplesMixed; 87 STAMCOUNTER TotalSamplesLost; 88 STAMCOUNTER TotalSamplesPlayed; 89 STAMCOUNTER TotalSamplesCaptured; 86 STAMCOUNTER TotalSamplesMixedIn; 87 STAMCOUNTER TotalSamplesMixedOut; 88 STAMCOUNTER TotalSamplesLostIn; 89 STAMCOUNTER TotalSamplesLostOut; 90 STAMCOUNTER TotalSamplesOut; 91 STAMCOUNTER TotalSamplesIn; 90 92 STAMCOUNTER TotalBytesRead; 91 93 STAMCOUNTER TotalBytesWritten;
Note:
See TracChangeset
for help on using the changeset viewer.