Changeset 91200 in vbox
- Timestamp:
- Sep 10, 2021 1:45:26 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp
r91198 r91200 140 140 * At the moment only one test set can be around at a time. */ 141 141 AUDIOTESTSET Set; 142 /** Number of total tests created. */142 /** Number of total tests in \a lstTestsRec and \a lstTestsPlay. */ 143 143 uint32_t cTestsTotal; 144 /** Increasing number to identify tests. */ 145 uint32_t idxTest; 144 146 /** Number of tests in \a lstTestsRec. */ 145 147 uint32_t cTestsRec; … … 184 186 * Unregisters a ValKit test, common code. 185 187 * 188 * @param pThis ValKit audio driver instance. 186 189 * @param pTst Test to unregister. 187 190 * The pointer will be invalid afterwards. 188 191 */ 189 static void drvHostValKiUnregisterTest(P VALKITTESTDATA pTst)192 static void drvHostValKiUnregisterTest(PDRVHOSTVALKITAUDIO pThis, PVALKITTESTDATA pTst) 190 193 { 191 194 AssertPtrReturnVoid(pTst); … … 204 207 RTMemFree(pTst); 205 208 pTst = NULL; 209 210 Assert(pThis->cTestsTotal); 211 pThis->cTestsTotal--; 212 if (pThis->cTestsTotal == 0) 213 { 214 if (ASMAtomicReadBool(&pThis->fTestSetEnd)) 215 { 216 int rc2 = RTSemEventSignal(pThis->EventSemEnded); 217 AssertRC(rc2); 218 } 219 } 206 220 } 207 221 … … 215 229 static void drvHostValKiUnregisterRecTest(PDRVHOSTVALKITAUDIO pThis, PVALKITTESTDATA pTst) 216 230 { 217 drvHostValKiUnregisterTest(pTst);218 219 231 Assert(pThis->cTestsRec); 220 232 pThis->cTestsRec--; 233 234 drvHostValKiUnregisterTest(pThis, pTst); 221 235 } 222 236 … … 230 244 static void drvHostValKiUnregisterPlayTest(PDRVHOSTVALKITAUDIO pThis, PVALKITTESTDATA pTst) 231 245 { 232 drvHostValKiUnregisterTest(pTst);233 234 246 Assert(pThis->cTestsPlay); 235 247 pThis->cTestsPlay--; 248 249 drvHostValKiUnregisterTest(pThis, pTst); 236 250 } 237 251 … … 350 364 if (RT_SUCCESS(rc)) 351 365 { 352 const PAUDIOTESTSET pSet = &pThis->Set; 353 354 if (AudioTestSetIsRunning(pSet)) 366 const PAUDIOTESTSET pSet = &pThis->Set; 367 368 LogRel(("ValKit: Test set has %RU32 tests total, %RU32 (still) running, %RU32 failures total so far\n", 369 AudioTestSetGetTestsTotal(pSet), AudioTestSetGetTestsRunning(pSet), AudioTestSetGetTotalFailures(pSet))); 370 LogRel(("ValKit: %RU32 tests still registered total (%RU32 play, %RU32 record)\n", 371 pThis->cTestsTotal, pThis->cTestsPlay, pThis->cTestsRec)); 372 373 if ( AudioTestSetIsRunning(pSet) 374 || pThis->cTestsTotal) 355 375 { 356 376 ASMAtomicWriteBool(&pThis->fTestSetEnd, true); … … 359 379 if (RT_SUCCESS(rc)) 360 380 { 361 LogRel(("ValKit: Waiting for runnig testset '%s' to end ...\n", pszTag));362 rc = RTSemEventWait(pThis->EventSemEnded, RT_MS_ 30SEC);381 LogRel(("ValKit: Waiting for all tests of set '%s' to end ...\n", pszTag)); 382 rc = RTSemEventWait(pThis->EventSemEnded, RT_MS_1MIN); 363 383 if (RT_FAILURE(rc)) 364 LogRel(("ValKit: Waiting for runnig test set '%s'failed with %Rrc\n", pszTag, rc));384 LogRel(("ValKit: Waiting for tests of set '%s' to end failed with %Rrc\n", pszTag, rc)); 365 385 366 386 int rc2 = RTCritSectEnter(&pThis->CritSect); … … 369 389 } 370 390 } 371 372 LogRel(("ValKit: Test set has %RU32 tests total, %RU32 (still) running, %RU32 failures total\n",373 AudioTestSetGetTestsTotal(pSet), AudioTestSetGetTestsRunning(pSet), AudioTestSetGetTotalFailures(pSet)));374 391 375 392 if (RT_SUCCESS(rc)) … … 448 465 { 449 466 LogRel(("ValKit: Registering guest recording test #%RU32 (%RU32ms, %RU64 bytes)\n", 450 pThis-> cTestsTotal, pTestData->t.TestTone.Parms.msDuration, pTestData->t.TestTone.u.Rec.cbToWrite));467 pThis->idxTest, pTestData->t.TestTone.Parms.msDuration, pTestData->t.TestTone.u.Rec.cbToWrite)); 451 468 452 469 RTListAppend(&pThis->lstTestsRec, &pTestData->Node); 453 470 454 471 pTestData->msRegisteredTS = RTTimeMilliTS(); 455 pTestData->idxTest = pThis-> cTestsTotal++;472 pTestData->idxTest = pThis->idxTest++; 456 473 457 474 pThis->cTestsRec++; 475 pThis->cTestsTotal++; 458 476 459 477 int rc2 = RTCritSectLeave(&pThis->CritSect); … … 487 505 { 488 506 LogRel(("ValKit: Registering guest playback test #%RU32 (%RU32ms, %RU64 bytes)\n", 489 pThis-> cTestsTotal, pTestData->t.TestTone.Parms.msDuration, pTestData->t.TestTone.u.Play.cbToRead));507 pThis->idxTest, pTestData->t.TestTone.Parms.msDuration, pTestData->t.TestTone.u.Play.cbToRead)); 490 508 491 509 RTListAppend(&pThis->lstTestsPlay, &pTestData->Node); 492 510 493 511 pTestData->msRegisteredTS = RTTimeMilliTS(); 494 pTestData->idxTest = pThis->cTestsTotal++; 495 512 pTestData->idxTest = pThis->idxTest++; 513 514 pThis->cTestsTotal++; 496 515 pThis->cTestsPlay++; 497 516 … … 1092 1111 } 1093 1112 } 1094 }1095 1096 if (ASMAtomicReadBool(&pThis->fTestSetEnd))1097 {1098 int rc2 = RTSemEventSignal(pThis->EventSemEnded);1099 AssertRC(rc2);1100 1113 } 1101 1114 … … 1177 1190 pThis->cbPlayedNoTest = 0; 1178 1191 1192 pThis->cTestsTotal = 0; 1193 pThis->cTestsPlay = 0; 1194 pThis->cTestsRec = 0; 1179 1195 pThis->fTestSetEnd = false; 1180 1196
Note:
See TracChangeset
for help on using the changeset viewer.

