VirtualBox

Changeset 90769 in vbox


Ignore:
Timestamp:
Aug 20, 2021 6:16:17 PM (3 years ago)
Author:
vboxsync
Message:

Audio/VKAT: More self-test fixes; docs. bugref:10008

File:
1 edited

Legend:

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

    r90766 r90769  
    11/* $Id$ */
    22/** @file
    3  * Validation Kit Audio Test (VKAT) - Self test code.
     3 * Validation Kit Audio Test (VKAT) - Self test.
     4 *
     5 * Self-test which does a complete audio testing framework run without the need
     6 * of a VM or other infrastructure, i.e. all required parts are running locally
     7 * on the same machine.
     8 *
     9 * This self-test does the following:
     10 * - 1. a) Creates an ATS instance to emulate the guest mode ("--mode guest")
     11 *         at port 6042 (ATS_TCP_DEF_BIND_PORT_GUEST).
     12 *      or
     13 *      b) Connect to an already existing guest ATS instance if "--guest-ats-address" is specified.
     14 *      This makes it more flexible in terms of testing / debugging.
     15 * - 2. Uses the Validation Kit audio backend, which in turn creates an ATS instance
     16 *      listening at port 6062 (ATS_TCP_DEF_BIND_PORT_VALKIT).
     17 * - 3. Uses the host test environment which creates an ATS instance
     18 *      listening at port 6052 (ATS_TCP_DEF_BIND_PORT_HOST).
     19 * - 4. Executes a complete test run locally (e.g. without any guest (VM) involved).
    420 */
    521
     
    5672    PSELFTESTCTX pCtx = (PSELFTESTCTX)pvUser;
    5773
    58     PAUDIOTESTENV pTstEnvGst = &pCtx->Guest.TstEnv;
     74    PAUDIOTESTENV pTstEnv = &pCtx->Guest.TstEnv;
    5975
    6076    /* Flag the environment for self test mode. */
    61     pTstEnvGst->fSelftest = true;
     77    pTstEnv->fSelftest = true;
     78
     79    /* Tweak the address the guest ATS is trying to connect to the host if anything else is specified.
     80     * Note: The host also runs on the same host (this self-test is completely self-contained and does not need a VM). */
     81    if (!pTstEnv->u.Guest.TcpOpts.szTcpConnectAddr[0])
     82        RTStrCopy(pTstEnv->u.Guest.TcpOpts.szTcpConnectAddr, sizeof(pTstEnv->u.Guest.TcpOpts.szTcpConnectAddr), "127.0.0.1");
     83
     84    int rc = AudioTestSvcCreate(&pTstEnv->u.Guest.Srv);
     85    AssertRCReturn(rc, rc);
    6286
    6387    /* Generate tag for guest side. */
    64     int rc = RTStrCopy(pTstEnvGst->szTag, sizeof(pTstEnvGst->szTag), pCtx->szTag);
     88    rc = RTStrCopy(pTstEnv->szTag, sizeof(pTstEnv->szTag), pCtx->szTag);
    6589    AssertRCReturn(rc, rc);
    6690
    67     rc = AudioTestPathCreateTemp(pTstEnvGst->szPathTemp, sizeof(pTstEnvGst->szPathTemp), "selftest-guest");
     91    rc = AudioTestPathCreateTemp(pTstEnv->szPathTemp, sizeof(pTstEnv->szPathTemp), "selftest-guest");
    6892    AssertRCReturn(rc, rc);
    6993
    70     rc = AudioTestPathCreateTemp(pTstEnvGst->szPathOut, sizeof(pTstEnvGst->szPathOut), "selftest-out");
     94    rc = AudioTestPathCreateTemp(pTstEnv->szPathOut, sizeof(pTstEnv->szPathOut), "selftest-out");
    7195    AssertRCReturn(rc, rc);
    7296
    73     pTstEnvGst->enmMode = AUDIOTESTMODE_GUEST;
     97    pTstEnv->enmMode = AUDIOTESTMODE_GUEST;
    7498
    7599    /** @todo Make this customizable. */
    76     PDMAudioPropsInit(&pTstEnvGst->Props,
     100    PDMAudioPropsInit(&pTstEnv->Props,
    77101                      2 /* 16-bit */, true  /* fSigned */, 2 /* cChannels */, 44100 /* uHz */);
    78102
    79     rc = audioTestEnvInit(pTstEnvGst, &pCtx->DrvStack);
     103    rc = audioTestEnvInit(pTstEnv, &pCtx->DrvStack);
    80104    if (RT_SUCCESS(rc))
    81105    {
    82106        RTThreadUserSignal(hThread);
    83107
    84         audioTestWorker(pTstEnvGst);
    85         audioTestEnvDestroy(pTstEnvGst);
     108        audioTestWorker(pTstEnv);
     109        audioTestEnvDestroy(pTstEnv);
    86110    }
    87111
     
    98122{
    99123    RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS,  "Running self test ...\n");
    100 
    101     /*
    102      * The self-test does the following:
    103      * - 1. a) Creates an ATS instance to emulate the guest mode ("--mode guest")
    104      *         at port 6042 (ATS_TCP_DEF_BIND_PORT_GUEST).
    105      *      or
    106      *      b) Connect to an already existing guest ATS instance if "--guest-ats-address" is specified.
    107      *      This makes it more flexible in terms of testing / debugging.
    108      * - 2. Uses the Validation Kit audio backend, which in turn creates an ATS instance
    109      *      at port 6052 (ATS_TCP_DEF_BIND_PORT_HOST).
    110      * - 3. Executes a complete test run locally (e.g. without any guest (VM) involved).
    111      */
    112124
    113125    /* Generate a common tag for guest and host side. */
     
    162174        if (RT_SUCCESS(rc))
    163175        {
     176            /*
     177             * Step 4.
     178             */
    164179            rc = audioTestWorker(pTstEnvHst);
    165180            if (RT_SUCCESS(rc))
Note: See TracChangeset for help on using the changeset viewer.

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