Changeset 89584 in vbox
- Timestamp:
- Jun 9, 2021 2:43:34 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145022
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp
r89575 r89584 89 89 /** The list node. */ 90 90 RTLISTNODE Node; 91 /** Index in test sequence (0-based). */ 92 uint32_t idxTest; 91 93 /** Current test set entry to process. */ 92 94 PAUDIOTESTENTRY pEntry; … … 122 124 /** Current test set being handled. */ 123 125 AUDIOTESTSET Set; 126 /** Number of total tests created. */ 127 uint32_t cTestsTotal; 124 128 /** Number of tests in \a lstTestsRec. */ 125 129 uint32_t cTestsRec; … … 258 262 if (RT_SUCCESS(rc)) 259 263 { 260 LogRel(("Audio: Validation Kit: Registered guest recording test (%RU32ms, %RU64 bytes)\n",261 pT estData->t.TestTone.Parms.msDuration, pTestData->t.TestTone.u.Rec.cbToWrite));264 LogRel(("Audio: Validation Kit: Registered guest recording test #%RU32 (%RU32ms, %RU64 bytes)\n", 265 pThis->cTestsTotal, pTestData->t.TestTone.Parms.msDuration, pTestData->t.TestTone.u.Rec.cbToWrite)); 262 266 263 267 RTListAppend(&pThis->lstTestsRec, &pTestData->Node); 268 269 pTestData->idxTest = pThis->cTestsTotal++; 264 270 265 271 pThis->cTestsRec++; … … 291 297 if (RT_SUCCESS(rc)) 292 298 { 293 LogRel(("Audio: Validation Kit: Registered guest playback test (%RU32ms, %RU64 bytes)\n",294 pT estData->t.TestTone.Parms.msDuration, pTestData->t.TestTone.u.Play.cbToRead));299 LogRel(("Audio: Validation Kit: Registered guest playback test #%RU32 (%RU32ms, %RU64 bytes)\n", 300 pThis->cTestsTotal, pTestData->t.TestTone.Parms.msDuration, pTestData->t.TestTone.u.Play.cbToRead)); 295 301 296 302 RTListAppend(&pThis->lstTestsPlay, &pTestData->Node); 303 304 pTestData->idxTest = pThis->cTestsTotal++; 297 305 298 306 pThis->cTestsPlay++; … … 512 520 &Parms, &pTst->pEntry); 513 521 if (RT_SUCCESS(rc)) 514 rc = AudioTestSetObjCreateAndRegister(&pThis->Set, " guest-output.pcm", &pTst->pObj);522 rc = AudioTestSetObjCreateAndRegister(&pThis->Set, "host-tone-rec.pcm", &pTst->pObj); 515 523 516 524 if (RT_SUCCESS(rc)) … … 533 541 { 534 542 pTst->t.TestTone.u.Play.cbRead += cbToRead; 535 536 543 Assert(pTst->t.TestTone.u.Play.cbRead <= pTst->t.TestTone.u.Play.cbToRead); 537 544 … … 613 620 &Parms, &pTst->pEntry); 614 621 if (RT_SUCCESS(rc)) 615 rc = AudioTestSetObjCreateAndRegister(&pThis->Set, "host- input.pcm", &pTst->pObj);622 rc = AudioTestSetObjCreateAndRegister(&pThis->Set, "host-tone-play.pcm", &pTst->pObj); 616 623 617 624 if (RT_SUCCESS(rc)) … … 794 801 795 802 if (pThis->cTestsRec) 796 LogRel(("Audio: Validation Kit: Warning: %RU32 guest recording tests still outstanding\n", pThis->cTestsRec)); 797 if (pThis->cTestsPlay) 798 LogRel(("Audio: Validation Kit: Warning: %RU32 guest playback tests still outstanding\n", pThis->cTestsPlay)); 803 LogRel(("Audio: Validation Kit: Warning: %RU32 guest recording tests still outstanding:\n", pThis->cTestsRec)); 799 804 800 805 PVALKITTESTDATA pTst, pTstNext; 801 806 RTListForEachSafe(&pThis->lstTestsRec, pTst, pTstNext, VALKITTESTDATA, Node) 807 { 808 size_t const cbOutstanding = pTst->t.TestTone.u.Rec.cbToWrite - pTst->t.TestTone.u.Rec.cbWritten; 809 if (cbOutstanding) 810 LogRel(("Audio: Validation Kit: \tRecording test #%RU32 has %RU64 bytes outstanding\n", pTst->idxTest, cbOutstanding)); 802 811 drvHostValKiUnregisterRecTest(pThis, pTst); 812 } 813 814 if (pThis->cTestsPlay) 815 LogRel(("Audio: Validation Kit: Warning: %RU32 guest playback tests still outstanding:\n", pThis->cTestsPlay)); 803 816 804 817 RTListForEachSafe(&pThis->lstTestsPlay, pTst, pTstNext, VALKITTESTDATA, Node) 818 { 819 size_t const cbOutstanding = pTst->t.TestTone.u.Play.cbToRead - pTst->t.TestTone.u.Play.cbRead; 820 if (cbOutstanding) 821 LogRel(("Audio: Validation Kit: \tPlayback test #%RU32 has %RU64 bytes outstanding\n", pTst->idxTest, cbOutstanding)); 805 822 drvHostValKiUnregisterPlayTest(pThis, pTst); 823 } 806 824 807 825 Assert(pThis->cTestsRec == 0); -
trunk/src/VBox/ValidationKit/utils/audio/vkatCommon.cpp
r89575 r89584 264 264 /** @todo Use .WAV here? */ 265 265 PAUDIOTESTOBJ pObj; 266 int rc = AudioTestSetObjCreateAndRegister(&pTstEnv->Set, " tone-play.pcm", &pObj);266 int rc = AudioTestSetObjCreateAndRegister(&pTstEnv->Set, "guest-tone-play.pcm", &pObj); 267 267 AssertRCReturn(rc, rc); 268 268 … … 341 341 /** @todo Use .WAV here? */ 342 342 PAUDIOTESTOBJ pObj; 343 int rc = AudioTestSetObjCreateAndRegister(&pTstEnv->Set, " tone-rec.pcm", &pObj);343 int rc = AudioTestSetObjCreateAndRegister(&pTstEnv->Set, "guest-tone-rec.pcm", &pObj); 344 344 AssertRCReturn(rc, rc); 345 345 … … 396 396 *********************************************************************************************************************************/ 397 397 398 /** @copydoc ATSCALLBACKS::pfnTestSetBegin */ 399 static DECLCALLBACK(int) audioTestSvcTestSetBeginCallback(void const *pvUser, const char *pszTag) 398 /** @copydoc ATSCALLBACKS::pfnTestSetBegin 399 * 400 * @note Runs as part of the guest ATS. 401 */ 402 static DECLCALLBACK(int) audioTestGstAtsTestSetBeginCallback(void const *pvUser, const char *pszTag) 400 403 { 401 404 PATSCALLBACKCTX pCtx = (PATSCALLBACKCTX)pvUser; 402 405 PAUDIOTESTENV pTstEnv = pCtx->pTstEnv; 403 406 404 RTTestPrintf(g_hTest, RTTESTLVL_DEBUG, "Beginning test set '%s' \n", pszTag);407 RTTestPrintf(g_hTest, RTTESTLVL_DEBUG, "Beginning test set '%s' in '%s'\n", pszTag, pTstEnv->szPathTemp); 405 408 406 409 return AudioTestSetCreate(&pTstEnv->Set, pTstEnv->szPathTemp, pszTag); 407 410 } 408 411 409 /** @copydoc ATSCALLBACKS::pfnTestSetEnd */ 410 static DECLCALLBACK(int) audioTestSvcTestSetEndCallback(void const *pvUser, const char *pszTag) 412 /** @copydoc ATSCALLBACKS::pfnTestSetEnd 413 * 414 * @note Runs as part of the guest ATS. 415 */ 416 static DECLCALLBACK(int) audioTestGstAtsTestSetEndCallback(void const *pvUser, const char *pszTag) 411 417 { 412 418 PATSCALLBACKCTX pCtx = (PATSCALLBACKCTX)pvUser; … … 418 424 } 419 425 420 /** @copydoc ATSCALLBACKS::pfnTonePlay */ 421 static DECLCALLBACK(int) audioTestSvcTonePlayCallback(void const *pvUser, PAUDIOTESTTONEPARMS pToneParms) 426 /** @copydoc ATSCALLBACKS::pfnTonePlay 427 * 428 * @note Runs as part of the guest ATS. 429 */ 430 static DECLCALLBACK(int) audioTestGstAtsTonePlayCallback(void const *pvUser, PAUDIOTESTTONEPARMS pToneParms) 422 431 { 423 432 PATSCALLBACKCTX pCtx = (PATSCALLBACKCTX)pvUser; … … 462 471 463 472 /** @copydoc ATSCALLBACKS::pfnToneRecord */ 464 static DECLCALLBACK(int) audioTest SvcToneRecordCallback(void const *pvUser, PAUDIOTESTTONEPARMS pToneParms)473 static DECLCALLBACK(int) audioTestGstAtsToneRecordCallback(void const *pvUser, PAUDIOTESTTONEPARMS pToneParms) 465 474 { 466 475 PATSCALLBACKCTX pCtx = (PATSCALLBACKCTX)pvUser; … … 480 489 481 490 PAUDIOTESTENTRY pTst; 482 rc = AudioTestSetTestBegin(&pTstEnv->Set, "Recording test tone ", &TstParms, &pTst);491 rc = AudioTestSetTestBegin(&pTstEnv->Set, "Recording test tone from host", &TstParms, &pTst); 483 492 if (RT_SUCCESS(rc)) 484 493 { … … 506 515 * Implementation of audio test environment handling * 507 516 *********************************************************************************************************************************/ 517 518 int audioTestEnvConnectToHostAts(PAUDIOTESTENV pTstEnv, 519 const char *pszHostTcpAddr, uint32_t uHostTcpPort) 520 { 521 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Connecting to host ATS at %s:%RU32 ...\n", 522 (pszHostTcpAddr && *pszHostTcpAddr) ? pszHostTcpAddr : ATS_TCP_HOST_DEFAULT_ADDR_STR, 523 uHostTcpPort ? uHostTcpPort : ATS_TCP_HOST_DEFAULT_PORT); 524 525 int rc = AudioTestSvcClientConnect(&pTstEnv->u.Host.AtsClValKit, pszHostTcpAddr, uHostTcpPort); 526 if (RT_FAILURE(rc)) 527 { 528 RTTestFailed(g_hTest, "Connecting to host ATS failed with %Rrc\n", rc); 529 return rc; 530 } 531 532 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Connected to host ATS\n"); 533 return rc; 534 } 535 536 int audioTestEnvConnectToGuestAts(PAUDIOTESTENV pTstEnv, 537 const char *pszGuestTcpAddr, uint32_t uGuestTcpPort) 538 { 539 RTTestPrintf(g_hTest, RTTESTLVL_DEBUG, "Connecting to guest ATS at %s:%RU32 ...\n", 540 (pszGuestTcpAddr && *pszGuestTcpAddr) ? pszGuestTcpAddr : "127.0.0.1", 541 uGuestTcpPort ? uGuestTcpPort : ATS_TCP_GUEST_DEFAULT_PORT); 542 543 int rc = AudioTestSvcClientConnect(&pTstEnv->u.Host.AtsClGuest, pszGuestTcpAddr, uGuestTcpPort); 544 if (RT_FAILURE(rc)) 545 { 546 RTTestFailed(g_hTest, "Connecting to guest ATS failed with %Rrc\n", rc); 547 return rc; 548 } 549 550 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Connected to guest ATS\n"); 551 return rc; 552 } 508 553 509 554 /** … … 550 595 } 551 596 552 if (pDrvReg == NULL) /* Go with the platform's default backend if nothing else is set. */ 553 pDrvReg = g_aBackends[0].pDrvReg; 597 if (pDrvReg == NULL) 598 { 599 if (pTstEnv->fSelftest) 600 pDrvReg = &g_DrvHostValidationKitAudio; 601 else /* Go with the platform's default backend if nothing else is set. */ 602 pDrvReg = g_aBackends[0].pDrvReg; 603 } 554 604 555 605 if (!uHostTcpPort) … … 571 621 572 622 /* Only the guest mode needs initializing the driver stack. */ 573 const bool fUseDriverStack = pTstEnv->enmMode == AUDIOTESTMODE_GUEST 574 /* The self test mode drives the ValKit audio driver locally, 575 * so also use the driver stack here. */ 576 || ( pTstEnv->enmMode == AUDIOTESTMODE_HOST 577 && pTstEnv->fSelftest); 623 const bool fUseDriverStack = pTstEnv->enmMode == AUDIOTESTMODE_GUEST; 578 624 if (fUseDriverStack) 579 625 { … … 612 658 613 659 ATSCALLBACKS Callbacks; 614 Callbacks.pfnTestSetBegin = audioTest SvcTestSetBeginCallback;615 Callbacks.pfnTestSetEnd = audioTest SvcTestSetEndCallback;616 Callbacks.pfnTonePlay = audioTest SvcTonePlayCallback;617 Callbacks.pfnToneRecord = audioTest SvcToneRecordCallback;660 Callbacks.pfnTestSetBegin = audioTestGstAtsTestSetBeginCallback; 661 Callbacks.pfnTestSetEnd = audioTestGstAtsTestSetEndCallback; 662 Callbacks.pfnTonePlay = audioTestGstAtsTonePlayCallback; 663 Callbacks.pfnToneRecord = audioTestGstAtsToneRecordCallback; 618 664 Callbacks.pvUser = &Ctx; 619 665 … … 632 678 633 679 if (RT_FAILURE(rc)) 634 {635 680 RTTestFailed(g_hTest, "Starting ATS failed with %Rrc\n", rc); 636 return rc;637 }638 681 } 639 682 else /* Host mode */ 640 683 { 641 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Connecting to host ATS at %s:%RU32 ...\n", 642 (pszHostTcpAddr && *pszHostTcpAddr) ? pszHostTcpAddr : ATS_TCP_HOST_DEFAULT_ADDR_STR, 643 uHostTcpPort ? uHostTcpPort : ATS_TCP_HOST_DEFAULT_PORT); 644 645 rc = AudioTestSvcClientConnect(&pTstEnv->u.Host.AtsClValKit, pszHostTcpAddr, uHostTcpPort); 646 if (RT_FAILURE(rc)) 647 { 648 RTTestFailed(g_hTest, "Connecting to host ATS failed with %Rrc\n", rc); 649 return rc; 650 } 651 652 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Connected to host ATS\n"); 653 654 RTTestPrintf(g_hTest, RTTESTLVL_DEBUG, "Connecting to guest ATS at %s:%RU32 ...\n", 655 (pszGuestTcpAddr && *pszGuestTcpAddr) ? pszGuestTcpAddr : "127.0.0.1", 656 uGuestTcpPort ? uGuestTcpPort : ATS_TCP_GUEST_DEFAULT_PORT); 657 658 rc = AudioTestSvcClientConnect(&pTstEnv->u.Host.AtsClGuest, pszGuestTcpAddr, uGuestTcpPort); 659 if (RT_FAILURE(rc)) 660 { 661 RTTestFailed(g_hTest, "Connecting to guest ATS failed with %Rrc\n", rc); 662 return rc; 663 } 664 665 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Connected to guest ATS\n"); 684 rc = audioTestEnvConnectToHostAts(pTstEnv, pszHostTcpAddr, uHostTcpPort); 685 if (RT_SUCCESS(rc)) 686 rc = audioTestEnvConnectToGuestAts(pTstEnv, pszGuestTcpAddr, uGuestTcpPort); 666 687 } 667 688 -
trunk/src/VBox/ValidationKit/utils/audio/vkatInternal.h
r89575 r89584 410 410 /** @} */ 411 411 412 /** @name ATS routines 413 * @{ */ 414 int audioTestEnvConnectToHostAts(PAUDIOTESTENV pTstEnv, 415 const char *pszHostTcpAddr, uint32_t uHostTcpPort); 416 /** @} */ 417 412 418 /** @name Test environment handling 413 419 * @{ */
Note:
See TracChangeset
for help on using the changeset viewer.