Changeset 91946 in vbox
- Timestamp:
- Oct 21, 2021 1:30:54 PM (3 years ago)
- Location:
- trunk/src/VBox/ValidationKit/utils/audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp
r91934 r91946 940 940 } 941 941 942 /* Do this first before everything else below. */ 943 rc = AudioTestDriverStackPerformSelftest(); 944 if (RT_FAILURE(rc)) 945 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Testing driver stack failed: %Rrc\n", rc); 946 942 947 AUDIOTESTDRVSTACK DrvStack; 943 948 if (fProbeBackends) -
trunk/src/VBox/ValidationKit/utils/audio/vkatCmdSelfTest.cpp
r91653 r91946 115 115 116 116 /********************************************************************************************************************************* 117 * Driver stack self-test implementation * 118 *********************************************************************************************************************************/ 119 120 /** 121 * Performs a (quick) audio driver stack self test. 122 * 123 * Local only, no guest/host communication involved. 124 * 125 * @returns VBox status code. 126 */ 127 int AudioTestDriverStackPerformSelftest(void) 128 { 129 PCPDMDRVREG pDrvReg = AudioTestGetDefaultBackend(); 130 131 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Testing driver stack started\n"); 132 133 AUDIOTESTDRVSTACK DrvStack; 134 int rc = audioTestDriverStackProbe(&DrvStack, pDrvReg, 135 true /* fEnabledIn */, true /* fEnabledOut */, false /* fWithDrvAudio */); 136 AssertRCReturn(rc, rc); 137 138 AUDIOTESTIOOPTS IoOpts; 139 audioTestIoOptsInitDefaults(&IoOpts); 140 141 PPDMAUDIOSTREAM pStream; 142 PDMAUDIOSTREAMCFG CfgAcq; 143 rc = audioTestDriverStackStreamCreateOutput(&DrvStack, &IoOpts.Props, 144 IoOpts.cMsBufferSize, IoOpts.cMsPreBuffer, IoOpts.cMsSchedulingHint, 145 &pStream, &CfgAcq); 146 AssertRCReturn(rc, rc); 147 148 rc = audioTestDriverStackStreamEnable(&DrvStack, pStream); 149 AssertRCReturn(rc, rc); 150 151 AssertReturn(audioTestDriverStackStreamIsOkay(&DrvStack, pStream), VERR_AUDIO_STREAM_NOT_READY); 152 153 uint8_t abBuf[_4K]; 154 memset(abBuf, 0x42, sizeof(abBuf)); 155 156 uint32_t cbWritten; 157 rc = audioTestDriverStackStreamPlay(&DrvStack, pStream, abBuf, sizeof(abBuf), &cbWritten); 158 AssertRCReturn(rc, rc); 159 AssertReturn(cbWritten == sizeof(abBuf), VERR_AUDIO_STREAM_NOT_READY); 160 161 audioTestDriverStackStreamDrain(&DrvStack, pStream, true /* fSync */); 162 audioTestDriverStackStreamDestroy(&DrvStack, pStream); 163 164 audioTestDriverStackDelete(&DrvStack); 165 166 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Testing driver stack ended with %Rrc\n", rc); 167 return rc; 168 } 169 170 171 /********************************************************************************************************************************* 117 172 * Self-test implementation * 118 173 *********************************************************************************************************************************/ … … 346 401 } 347 402 } 403 404 rc = AudioTestDriverStackPerformSelftest(); 405 if (RT_FAILURE(rc)) 406 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Testing driver stack failed: %Rrc\n", rc); 348 407 349 408 /* Go with the Validation Kit audio backend if nothing else is specified. */ -
trunk/src/VBox/ValidationKit/utils/audio/vkatInternal.h
r91632 r91946 396 396 /** @name Driver stack 397 397 * @{ */ 398 int AudioTestDriverStackPerformSelftest(void); 399 398 400 void audioTestDriverStackDelete(PAUDIOTESTDRVSTACK pDrvStack); 399 401 int audioTestDriverStackInitEx(PAUDIOTESTDRVSTACK pDrvStack, PCPDMDRVREG pDrvReg, bool fEnabledIn, bool fEnabledOut, bool fWithDrvAudio);
Note:
See TracChangeset
for help on using the changeset viewer.