VirtualBox

Ignore:
Timestamp:
Jun 21, 2021 6:24:13 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145261
Message:

Audio/ValKit: Fixes for running on the VBoxAudioTest on guests (needs to bind the ATS server address to 0.0.0.0 / ::0). bugref:10008

Location:
trunk/src/VBox/ValidationKit/utils/audio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/audio/vkatCmdSelfTest.cpp

    r89761 r89804  
    259259    RT_ZERO(Ctx);
    260260
    261     /* Go with the platform's default bakcend if nothing else is specified. */
     261    /* Go with the platform's default backend if nothing else is specified. */
    262262    Ctx.Guest.pDrvReg = AudioTestGetDefaultBackend();
    263263
  • trunk/src/VBox/ValidationKit/utils/audio/vkatCommon.cpp

    r89685 r89804  
    618618 *                              If 0, ATS_TCP_HOST_DEFAULT_PORT will be used.
    619619 * @param   pszGuestTcpAddr     Guest ATS TCP/IP address to connect to.
    620  *                              If NULL, localhost (127.0.0.1) will be used.
     620 *                              If NULL, any address (0.0.0.0) will be used.
    621621 * @param   uGuestTcpPort       Guest ATS TCP/IP port to connect to.
    622622 *                              If 0, ATS_TCP_GUEST_DEFAULT_PORT will be used.
     
    650650    }
    651651
    652     if (pDrvReg == NULL)
    653     {
    654         if (pTstEnv->fSelftest)
    655             pDrvReg = &g_DrvHostValidationKitAudio;
    656         else /* Go with the platform's default backend if nothing else is set. */
    657             pDrvReg = AudioTestGetDefaultBackend();
    658     }
     652    /* Go with the platform's default backend if nothing else is set. */
     653    if (!pDrvReg)
     654        pDrvReg = AudioTestGetDefaultBackend();
    659655
    660656    if (!uHostTcpPort)
     
    664660        uGuestTcpPort = ATS_TCP_GUEST_DEFAULT_PORT;
    665661
    666     RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test mode is '%s'\n", pTstEnv->enmMode == AUDIOTESTMODE_HOST ? "host" : "guest");
     662    RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Initializing environment for mode '%s'\n", pTstEnv->enmMode == AUDIOTESTMODE_HOST ? "host" : "guest");
     663    RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Using backend '%s'\n", pDrvReg->szName);
    667664    RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Using tag '%s'\n", pTstEnv->szTag);
    668665    RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Output directory is '%s'\n", pTstEnv->szPathOut);
     
    675672    pTstEnv->cMsSchedulingHint = RTRandU32Ex(10, 80); /* Choose a random scheduling (in ms). */
    676673
    677     /* Only the guest mode needs initializing the driver stack. */
    678     const bool fUseDriverStack = pTstEnv->enmMode == AUDIOTESTMODE_GUEST;
     674    bool fUseDriverStack = false; /* Whether to init + use the audio driver stack or not. */
     675
     676    /* In regular testing mode only the guest mode needs initializing the driver stack. */
     677    if (pTstEnv->enmMode == AUDIOTESTMODE_GUEST)
     678        fUseDriverStack = true;
     679
     680    /* When running in self-test mode, the host mode also needs to initialize the stack in order to
     681     * to run the Valdation Kit audio driver ATS (no "real" VBox involved). */
     682    if (pTstEnv->enmMode == AUDIOTESTMODE_HOST && pTstEnv->fSelftest)
     683        fUseDriverStack = true;
     684
    679685    if (fUseDriverStack)
    680686    {
     
    727733         * That service then will perform playback and recording operations on the guest, triggered from the host.
    728734         *
    729          * When running this in self-test mode, that service also will be run on the host.
     735         * When running this in self-test mode, that service also can be run on the host if nothing else is specified.
     736         * Note that we have to bind to "0.0.0.0" by default so that the host can connect to it.
    730737         */
    731738        RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Starting guest ATS at %s:%RU32...\n",
    732                      (pszGuestTcpAddr && *pszGuestTcpAddr) ? pszGuestTcpAddr : "127.0.0.1",
    733                      uGuestTcpPort ? uGuestTcpPort : ATS_TCP_GUEST_DEFAULT_PORT);
    734         rc = AudioTestSvcInit(&pTstEnv->u.Guest.Srv, pszGuestTcpAddr, uGuestTcpPort, &Callbacks);
     739                     (pszGuestTcpAddr && *pszGuestTcpAddr) ? pszGuestTcpAddr : "0.0.0.0", uGuestTcpPort);
     740        rc = AudioTestSvcInit(&pTstEnv->u.Guest.Srv,
     741                              (pszGuestTcpAddr && *pszGuestTcpAddr) ? pszGuestTcpAddr : "0.0.0.0", uGuestTcpPort, &Callbacks);
    735742        if (RT_SUCCESS(rc))
    736743            rc = AudioTestSvcStart(&pTstEnv->u.Guest.Srv);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette