Changeset 90769 in vbox
- Timestamp:
- Aug 20, 2021 6:16:17 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/audio/vkatCmdSelfTest.cpp
r90766 r90769 1 1 /* $Id$ */ 2 2 /** @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). 4 20 */ 5 21 … … 56 72 PSELFTESTCTX pCtx = (PSELFTESTCTX)pvUser; 57 73 58 PAUDIOTESTENV pTstEnv Gst= &pCtx->Guest.TstEnv;74 PAUDIOTESTENV pTstEnv = &pCtx->Guest.TstEnv; 59 75 60 76 /* 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); 62 86 63 87 /* 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); 65 89 AssertRCReturn(rc, rc); 66 90 67 rc = AudioTestPathCreateTemp(pTstEnv Gst->szPathTemp, sizeof(pTstEnvGst->szPathTemp), "selftest-guest");91 rc = AudioTestPathCreateTemp(pTstEnv->szPathTemp, sizeof(pTstEnv->szPathTemp), "selftest-guest"); 68 92 AssertRCReturn(rc, rc); 69 93 70 rc = AudioTestPathCreateTemp(pTstEnv Gst->szPathOut, sizeof(pTstEnvGst->szPathOut), "selftest-out");94 rc = AudioTestPathCreateTemp(pTstEnv->szPathOut, sizeof(pTstEnv->szPathOut), "selftest-out"); 71 95 AssertRCReturn(rc, rc); 72 96 73 pTstEnv Gst->enmMode = AUDIOTESTMODE_GUEST;97 pTstEnv->enmMode = AUDIOTESTMODE_GUEST; 74 98 75 99 /** @todo Make this customizable. */ 76 PDMAudioPropsInit(&pTstEnv Gst->Props,100 PDMAudioPropsInit(&pTstEnv->Props, 77 101 2 /* 16-bit */, true /* fSigned */, 2 /* cChannels */, 44100 /* uHz */); 78 102 79 rc = audioTestEnvInit(pTstEnv Gst, &pCtx->DrvStack);103 rc = audioTestEnvInit(pTstEnv, &pCtx->DrvStack); 80 104 if (RT_SUCCESS(rc)) 81 105 { 82 106 RTThreadUserSignal(hThread); 83 107 84 audioTestWorker(pTstEnv Gst);85 audioTestEnvDestroy(pTstEnv Gst);108 audioTestWorker(pTstEnv); 109 audioTestEnvDestroy(pTstEnv); 86 110 } 87 111 … … 98 122 { 99 123 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 * or106 * 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 instance109 * 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 */112 124 113 125 /* Generate a common tag for guest and host side. */ … … 162 174 if (RT_SUCCESS(rc)) 163 175 { 176 /* 177 * Step 4. 178 */ 164 179 rc = audioTestWorker(pTstEnvHst); 165 180 if (RT_SUCCESS(rc))
Note:
See TracChangeset
for help on using the changeset viewer.