Changeset 91051 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Sep 1, 2021 9:08:56 AM (3 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioTest.cpp
r91036 r91051 921 921 922 922 /** 923 * Returns the total number of registered tests. 924 * 925 * @returns Total number of registered tests. 926 * @param pSet Test set to return value for. 927 */ 928 uint32_t AudioTestSetGetTestsTotal(PAUDIOTESTSET pSet) 929 { 930 return pSet->cTests; 931 } 932 933 /** 934 * Returns the total number of (still) running tests. 935 * 936 * @returns Total number of (still) running tests. 937 * @param pSet Test set to return value for. 938 */ 939 uint32_t AudioTestSetGetTestsRunning(PAUDIOTESTSET pSet) 940 { 941 return pSet->cTestsRunning; 942 } 943 944 /** 945 * Returns the total number of test failures occurred. 946 * 947 * @returns Total number of test failures occurred. 948 * @param pSet Test set to return value for. 949 */ 950 uint32_t AudioTestSetGetTotalFailures(PAUDIOTESTSET pSet) 951 { 952 return pSet->cTotalFailures; 953 } 954 955 /** 923 956 * Creates a new audio test set. 924 957 * … … 1216 1249 } 1217 1250 1218 RTFileClose(pSet->f.hFile); 1219 pSet->f.hFile = NIL_RTFILE; 1251 rc = RTFileClose(pSet->f.hFile); 1252 if (RT_SUCCESS(rc)) 1253 pSet->f.hFile = NIL_RTFILE; 1220 1254 } 1221 1255 else if (pSet->enmMode == AUDIOTESTSETMODE_VERIFY) … … 1226 1260 rc = VINF_SUCCESS; 1227 1261 } 1228 else /* Not supported, just skip. */1229 rc = VINF_SUCCESS;1262 else 1263 AssertFailedStmt(rc = VERR_NOT_SUPPORTED); 1230 1264 1231 1265 return rc; … … 1577 1611 AssertReturn(!audioTestManifestIsOpen(pSet), VERR_WRONG_ORDER); 1578 1612 1579 AssertMsgReturn(pSet->cTests, ("No tests run yet"), VERR_ WRONG_ORDER);1580 AssertMsgReturn(pSet->cTestsRunning == 0 , ("Some tests are still running"), VERR_ WRONG_ORDER);1613 AssertMsgReturn(pSet->cTests, ("No tests run yet"), VERR_INVALID_STATE); 1614 AssertMsgReturn(pSet->cTestsRunning == 0 , ("Some tests are still running"), VERR_INVALID_STATE); 1581 1615 1582 1616 /** @todo Check and deny if \a pszOutDir is part of the set's path. */ -
trunk/src/VBox/Devices/Audio/AudioTest.h
r89994 r91051 288 288 int AudioTestSetWipe(PAUDIOTESTSET pSet); 289 289 const char *AudioTestSetGetTag(PAUDIOTESTSET pSet); 290 uint32_t AudioTestSetGetTestsTotal(PAUDIOTESTSET pSet); 291 uint32_t AudioTestSetGetTestsRunning(PAUDIOTESTSET pSet); 292 uint32_t AudioTestSetGetTotalFailures(PAUDIOTESTSET pSet); 290 293 bool AudioTestSetIsPacked(const char *pszPath); 291 294 bool AudioTestSetIsRunning(PAUDIOTESTSET pSet); -
trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp
r91050 r91051 121 121 /** Pointer to host audio interface. */ 122 122 PDMIHOSTAUDIO IHostAudio; 123 /** Total number of bytes played since driver construction. */ 124 uint64_t cbPlayedTotal; 125 /** Total number of bytes recorded since driver construction. */ 126 uint64_t cbRecordedTotal; 123 127 /** Temporary path to use. */ 124 128 char szPathTemp[RTPATH_MAX]; … … 236 240 LogRel(("ValKit: Warning: %RU32 guest recording tests still outstanding:\n", pThis->cTestsRec)); 237 241 242 if ( pThis->cTestsTotal 243 && ( !pThis->cbPlayedTotal 244 && !pThis->cbRecordedTotal) 245 ) 246 { 247 LogRel(("ValKit: Warning: Did not get any audio data to play or record altough tests were configured -- audio stack misconfiguration / bug?\n")); 248 } 249 238 250 PVALKITTESTDATA pTst, pTstNext; 239 251 RTListForEachSafe(&pThis->lstTestsRec, pTst, pTstNext, VALKITTESTDATA, Node) … … 241 253 size_t const cbOutstanding = pTst->t.TestTone.u.Rec.cbToWrite - pTst->t.TestTone.u.Rec.cbWritten; 242 254 if (cbOutstanding) 243 LogRel(("ValKit: \tRecording test #%RU32 has %RU64 bytes (%RU32ms) outstanding\n", 244 pTst->idxTest, cbOutstanding, PDMAudioPropsBytesToMilli(&pTst->t.TestTone.Parms.Props, (uint32_t)cbOutstanding))); 255 LogRel(("ValKit: \tRecording test #%RU32 has %RU64 bytes (%RU32ms) outstanding (%RU8%% left)\n", 256 pTst->idxTest, cbOutstanding, PDMAudioPropsBytesToMilli(&pTst->t.TestTone.Parms.Props, (uint32_t)cbOutstanding), 257 (pTst->t.TestTone.u.Rec.cbWritten * 100) / RT_MAX(pTst->t.TestTone.u.Rec.cbToWrite, 1))); 245 258 drvHostValKiUnregisterRecTest(pThis, pTst); 246 259 } … … 253 266 size_t const cbOutstanding = pTst->t.TestTone.u.Play.cbToRead - pTst->t.TestTone.u.Play.cbRead; 254 267 if (cbOutstanding) 255 LogRel(("ValKit: \tPlayback test #%RU32 has %RU64 bytes (%RU32ms) outstanding\n", 256 pTst->idxTest, cbOutstanding, PDMAudioPropsBytesToMilli(&pTst->t.TestTone.Parms.Props, (uint32_t)cbOutstanding))); 268 LogRel(("ValKit: \tPlayback test #%RU32 has %RU64 bytes (%RU32ms) outstanding (%RU8%% left)\n", 269 pTst->idxTest, cbOutstanding, PDMAudioPropsBytesToMilli(&pTst->t.TestTone.Parms.Props, (uint32_t)cbOutstanding), 270 (pTst->t.TestTone.u.Play.cbRead * 100) / RT_MAX(pTst->t.TestTone.u.Play.cbToRead, 1))); 257 271 drvHostValKiUnregisterPlayTest(pThis, pTst); 258 272 } … … 319 333 } 320 334 } 335 336 LogRel(("ValKit: Test set has %RU32 tests total, %RU32 (still) running, %RU32 failures total\n", 337 AudioTestSetGetTestsTotal(pSet), AudioTestSetGetTestsRunning(pSet), AudioTestSetGetTotalFailures(pSet))); 321 338 322 339 if (RT_SUCCESS(rc)) … … 797 814 PVALKITTESTDATA pTst = NULL; 798 815 816 pThis->cbPlayedTotal += cbBuf; /* Do a bit of accounting. */ 817 799 818 bool const fIsSilence = PDMAudioPropsIsBufferSilence(&pStream->pStream->Cfg.Props, pvBuf, cbBuf); 800 819 … … 929 948 PVALKITAUDIOSTREAM pStrmValKit = (PVALKITAUDIOSTREAM)pStream; 930 949 PVALKITTESTDATA pTst = NULL; 950 951 pThis->cbRecordedTotal += cbBuf; /* Do a bit of accounting. */ 931 952 932 953 int rc = RTCritSectEnter(&pThis->CritSect); … … 1091 1112 AssertRCReturn(rc, rc); 1092 1113 1114 pThis->cbPlayedTotal = 0; 1115 pThis->cbRecordedTotal = 0; 1116 1093 1117 pThis->fTestSetEnd = false; 1094 1118 … … 1112 1136 const char *pszBindAddr = "127.0.0.1"; /* Only reachable for localhost for now. */ 1113 1137 uint32_t uBindPort = ATS_TCP_DEF_BIND_PORT_VALKIT; 1138 1139 LogRel2(("ValKit: Debug logging enabled\n")); 1114 1140 1115 1141 LogRel(("ValKit: Starting Audio Test Service (ATS) at %s:%RU32...\n",
Note:
See TracChangeset
for help on using the changeset viewer.