Changeset 89584 in vbox for trunk/src/VBox/ValidationKit/utils
- Timestamp:
- Jun 9, 2021 2:43:34 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145022
- Location:
- trunk/src/VBox/ValidationKit/utils/audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.