VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp@ 89711

Last change on this file since 89711 was 89711, checked in by vboxsync, 4 years ago

Audio/ValKit: More validation code. bugref:10008

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 40.3 KB
Line 
1/* $Id: vkat.cpp 89711 2021-06-15 15:08:23Z vboxsync $ */
2/** @file
3 * Validation Kit Audio Test (VKAT) utility for testing and validating the audio stack.
4 */
5
6/*
7 * Copyright (C) 2021 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27
28/*********************************************************************************************************************************
29* Header Files *
30*********************************************************************************************************************************/
31#include <iprt/buildconfig.h>
32#include <iprt/ctype.h>
33#include <iprt/dir.h>
34#include <iprt/errcore.h>
35#include <iprt/initterm.h>
36#include <iprt/getopt.h>
37#include <iprt/message.h>
38#include <iprt/path.h>
39#include <iprt/process.h>
40#include <iprt/rand.h>
41#include <iprt/stream.h>
42#include <iprt/string.h>
43#include <iprt/test.h>
44
45#include <package-generated.h>
46#include "product-generated.h"
47
48#include <VBox/version.h>
49#include <VBox/log.h>
50
51#ifdef RT_OS_WINDOWS
52# include <iprt/win/windows.h> /* for CoInitializeEx */
53#endif
54#include <signal.h>
55
56#include "vkatInternal.h"
57
58
59/*********************************************************************************************************************************
60* Internal Functions *
61*********************************************************************************************************************************/
62static int audioTestCombineParms(PAUDIOTESTPARMS pBaseParms, PAUDIOTESTPARMS pOverrideParms);
63static int audioVerifyOne(const char *pszPathSetA, const char *pszPathSetB);
64
65
66/*********************************************************************************************************************************
67* Global Variables *
68*********************************************************************************************************************************/
69/**
70 * Backends.
71 *
72 * @note The first backend in the array is the default one for the platform.
73 */
74struct
75{
76 /** The driver registration structure. */
77 PCPDMDRVREG pDrvReg;
78 /** The backend name.
79 * Aliases are implemented by having multiple entries for the same backend. */
80 const char *pszName;
81} const g_aBackends[] =
82{
83#if defined(VBOX_WITH_AUDIO_ALSA) && defined(RT_OS_LINUX)
84 { &g_DrvHostALSAAudio, "alsa" },
85#endif
86#ifdef VBOX_WITH_AUDIO_PULSE
87 { &g_DrvHostPulseAudio, "pulseaudio" },
88 { &g_DrvHostPulseAudio, "pulse" },
89 { &g_DrvHostPulseAudio, "pa" },
90#endif
91#ifdef VBOX_WITH_AUDIO_OSS
92 { &g_DrvHostOSSAudio, "oss" },
93#endif
94#if defined(RT_OS_DARWIN)
95 { &g_DrvHostCoreAudio, "coreaudio" },
96 { &g_DrvHostCoreAudio, "core" },
97 { &g_DrvHostCoreAudio, "ca" },
98#endif
99#if defined(RT_OS_WINDOWS)
100 { &g_DrvHostAudioWas, "wasapi" },
101 { &g_DrvHostAudioWas, "was" },
102 { &g_DrvHostDSound, "directsound" },
103 { &g_DrvHostDSound, "dsound" },
104 { &g_DrvHostDSound, "ds" },
105#endif
106 { &g_DrvHostValidationKitAudio, "valkit" }
107};
108AssertCompile(sizeof(g_aBackends) > 0 /* port me */);
109
110/**
111 * Long option values for the 'test' command.
112 */
113enum
114{
115 VKAT_TEST_OPT_COUNT = 900,
116 VKAT_TEST_OPT_DEV,
117 VKAT_TEST_OPT_GUEST_ATS_ADDR,
118 VKAT_TEST_OPT_GUEST_ATS_PORT,
119 VKAT_TEST_OPT_HOST_ATS_ADDR,
120 VKAT_TEST_OPT_HOST_ATS_PORT,
121 VKAT_TEST_OPT_MODE,
122 VKAT_TEST_OPT_NO_VERIFY,
123 VKAT_TEST_OPT_OUTDIR,
124 VKAT_TEST_OPT_PAUSE,
125 VKAT_TEST_OPT_PCM_HZ,
126 VKAT_TEST_OPT_PCM_BIT,
127 VKAT_TEST_OPT_PCM_CHAN,
128 VKAT_TEST_OPT_PCM_SIGNED,
129 VKAT_TEST_OPT_TAG,
130 VKAT_TEST_OPT_TEMPDIR,
131 VKAT_TEST_OPT_VOL
132};
133
134/**
135 * Long option values for the 'verify' command.
136 */
137enum
138{
139 VKAT_VERIFY_OPT_TAG = 900
140};
141
142/**
143 * Common command line parameters.
144 */
145static const RTGETOPTDEF g_aCmdCommonOptions[] =
146{
147 { "--quiet", 'q', RTGETOPT_REQ_NOTHING },
148 { "--verbose", 'v', RTGETOPT_REQ_NOTHING },
149 { "--debug-audio", AUDIO_TEST_OPT_CMN_DEBUG_AUDIO_ENABLE, RTGETOPT_REQ_NOTHING },
150 { "--debug-audio-path", AUDIO_TEST_OPT_CMN_DEBUG_AUDIO_PATH, RTGETOPT_REQ_STRING },
151};
152
153/**
154 * Command line parameters for test mode.
155 */
156static const RTGETOPTDEF g_aCmdTestOptions[] =
157{
158 { "--backend", 'b', RTGETOPT_REQ_STRING },
159 { "--drvaudio", 'd', RTGETOPT_REQ_NOTHING },
160 { "--exclude", 'e', RTGETOPT_REQ_UINT32 },
161 { "--exclude-all", 'a', RTGETOPT_REQ_NOTHING },
162 { "--guest-ats-address", VKAT_TEST_OPT_GUEST_ATS_ADDR, RTGETOPT_REQ_STRING },
163 { "--guest-ats-port", VKAT_TEST_OPT_GUEST_ATS_PORT, RTGETOPT_REQ_UINT32 },
164 { "--host-ats-address", VKAT_TEST_OPT_HOST_ATS_ADDR, RTGETOPT_REQ_STRING },
165 { "--host-ats-port", VKAT_TEST_OPT_HOST_ATS_PORT, RTGETOPT_REQ_UINT32 },
166 { "--include", 'i', RTGETOPT_REQ_UINT32 },
167 { "--outdir", VKAT_TEST_OPT_OUTDIR, RTGETOPT_REQ_STRING },
168 { "--count", VKAT_TEST_OPT_COUNT, RTGETOPT_REQ_UINT32 },
169 { "--device", VKAT_TEST_OPT_DEV, RTGETOPT_REQ_STRING },
170 { "--pause", VKAT_TEST_OPT_PAUSE, RTGETOPT_REQ_UINT32 },
171 { "--pcm-bit", VKAT_TEST_OPT_PCM_BIT, RTGETOPT_REQ_UINT8 },
172 { "--pcm-chan", VKAT_TEST_OPT_PCM_CHAN, RTGETOPT_REQ_UINT8 },
173 { "--pcm-hz", VKAT_TEST_OPT_PCM_HZ, RTGETOPT_REQ_UINT16 },
174 { "--pcm-signed", VKAT_TEST_OPT_PCM_SIGNED, RTGETOPT_REQ_BOOL },
175 { "--mode", VKAT_TEST_OPT_MODE, RTGETOPT_REQ_STRING },
176 { "--no-verify", VKAT_TEST_OPT_NO_VERIFY, RTGETOPT_REQ_NOTHING },
177 { "--tag", VKAT_TEST_OPT_TAG, RTGETOPT_REQ_STRING },
178 { "--tempdir", VKAT_TEST_OPT_TEMPDIR, RTGETOPT_REQ_STRING },
179 { "--volume", VKAT_TEST_OPT_VOL, RTGETOPT_REQ_UINT8 }
180};
181
182/**
183 * Command line parameters for verification mode.
184 */
185static const RTGETOPTDEF g_aCmdVerifyOptions[] =
186{
187 { "--tag", VKAT_VERIFY_OPT_TAG, RTGETOPT_REQ_STRING }
188};
189
190/** Terminate ASAP if set. Set on Ctrl-C. */
191bool volatile g_fTerminate = false;
192/** The release logger. */
193PRTLOGGER g_pRelLogger = NULL;
194/** The test handle. */
195RTTEST g_hTest;
196/** The current verbosity level. */
197unsigned g_uVerbosity = 0;
198/** DrvAudio: Enable debug (or not). */
199bool g_fDrvAudioDebug = 0;
200/** DrvAudio: The debug output path. */
201const char *g_pszDrvAudioDebug = NULL;
202
203
204/**
205 * Get default backend.
206 */
207PCPDMDRVREG AudioTestGetDefaultBackend(void)
208{
209 return g_aBackends[0].pDrvReg;
210}
211
212
213/**
214 * Helper for handling --backend options.
215 *
216 * @returns Pointer to the specified backend, NULL if not found (error
217 * displayed).
218 * @param pszBackend The backend option value.
219 */
220PCPDMDRVREG AudioTestFindBackendOpt(const char *pszBackend)
221{
222 for (uintptr_t i = 0; i < RT_ELEMENTS(g_aBackends); i++)
223 if ( strcmp(pszBackend, g_aBackends[i].pszName) == 0
224 || strcmp(pszBackend, g_aBackends[i].pDrvReg->szName) == 0)
225 return g_aBackends[i].pDrvReg;
226 RTMsgError("Unknown backend: '%s'", pszBackend);
227 return NULL;
228}
229
230
231/**
232 * Overrides audio test base parameters with another set.
233 *
234 * @returns VBox status code.
235 * @param pBaseParms Base parameters to override.
236 * @param pOverrideParms Override parameters to use for overriding the base parameters.
237 *
238 * @note Overriding a parameter depends on its type / default values.
239 */
240static int audioTestCombineParms(PAUDIOTESTPARMS pBaseParms, PAUDIOTESTPARMS pOverrideParms)
241{
242 RT_NOREF(pBaseParms, pOverrideParms);
243
244 /** @todo Implement parameter overriding. */
245 return VERR_NOT_IMPLEMENTED;
246}
247
248
249/*********************************************************************************************************************************
250* Test callbacks *
251*********************************************************************************************************************************/
252
253/**
254 * @copydoc FNAUDIOTESTSETUP
255 */
256static DECLCALLBACK(int) audioTestPlayToneSetup(PAUDIOTESTENV pTstEnv, PAUDIOTESTDESC pTstDesc, PAUDIOTESTPARMS pTstParmsAcq, void **ppvCtx)
257{
258 RT_NOREF(pTstEnv, pTstDesc, ppvCtx);
259
260 pTstParmsAcq->enmType = AUDIOTESTTYPE_TESTTONE_PLAY;
261
262 PDMAudioPropsInit(&pTstParmsAcq->Props, 16 /* bit */ / 8, true /* fSigned */, 2 /* Channels */, 44100 /* Hz */);
263
264 pTstParmsAcq->enmDir = PDMAUDIODIR_OUT;
265#ifdef DEBUG
266 pTstParmsAcq->cIterations = 2;
267#else
268 pTstParmsAcq->cIterations = RTRandU32Ex(1, 10);
269#endif
270 pTstParmsAcq->idxCurrent = 0;
271
272 return VINF_SUCCESS;
273}
274
275/**
276 * @copydoc FNAUDIOTESTEXEC
277 */
278static DECLCALLBACK(int) audioTestPlayToneExec(PAUDIOTESTENV pTstEnv, void *pvCtx, PAUDIOTESTPARMS pTstParms)
279{
280 RT_NOREF(pvCtx);
281
282 int rc = VINF_SUCCESS;
283
284 for (uint32_t i = 0; i < pTstParms->cIterations; i++)
285 {
286 AudioTestToneParamsInitRandom(&pTstParms->TestTone, &pTstParms->Props);
287
288 PAUDIOTESTTONEPARMS const pToneParms = &pTstParms->TestTone;
289 rc = AudioTestSvcClientToneRecord(&pTstEnv->u.Host.AtsClValKit, pToneParms);
290 if (RT_SUCCESS(rc))
291 rc = AudioTestSvcClientTonePlay(&pTstEnv->u.Host.AtsClGuest, pToneParms);
292
293 if (RT_FAILURE(rc))
294 RTTestFailed(g_hTest, "Playing tone failed\n");
295 }
296
297 return rc;
298}
299
300/**
301 * @copydoc FNAUDIOTESTDESTROY
302 */
303static DECLCALLBACK(int) audioTestPlayToneDestroy(PAUDIOTESTENV pTstEnv, void *pvCtx)
304{
305 RT_NOREF(pTstEnv, pvCtx);
306
307 return VINF_SUCCESS;
308}
309
310/**
311 * @copydoc FNAUDIOTESTSETUP
312 */
313static DECLCALLBACK(int) audioTestRecordToneSetup(PAUDIOTESTENV pTstEnv, PAUDIOTESTDESC pTstDesc, PAUDIOTESTPARMS pTstParmsAcq, void **ppvCtx)
314{
315 RT_NOREF(pTstEnv, pTstDesc, ppvCtx);
316
317 pTstParmsAcq->enmType = AUDIOTESTTYPE_TESTTONE_RECORD;
318
319 PDMAudioPropsInit(&pTstParmsAcq->Props, 16 /* bit */ / 8, true /* fSigned */, 2 /* Channels */, 44100 /* Hz */);
320
321 pTstParmsAcq->enmDir = PDMAUDIODIR_IN;
322#ifdef DEBUG
323 pTstParmsAcq->cIterations = 2;
324#else
325 pTstParmsAcq->cIterations = RTRandU32Ex(1, 10);
326#endif
327 pTstParmsAcq->idxCurrent = 0;
328
329 return VINF_SUCCESS;
330}
331
332/**
333 * @copydoc FNAUDIOTESTEXEC
334 */
335static DECLCALLBACK(int) audioTestRecordToneExec(PAUDIOTESTENV pTstEnv, void *pvCtx, PAUDIOTESTPARMS pTstParms)
336{
337 RT_NOREF(pvCtx);
338
339 int rc = VINF_SUCCESS;
340
341 for (uint32_t i = 0; i < pTstParms->cIterations; i++)
342 {
343 pTstParms->TestTone.Props = pTstParms->Props;
344#ifdef DEBUG_andy
345 pTstParms->TestTone.msDuration = RTRandU32Ex(50 /* ms */, 2000);
346#else
347 pTstParms->TestTone.msDuration = RTRandU32Ex(50 /* ms */, RT_MS_30SEC); /** @todo Record even longer? */
348#endif
349 /*
350 * 1. Arm the ValKit ATS with the recording parameters.
351 */
352 rc = AudioTestSvcClientTonePlay(&pTstEnv->u.Host.AtsClValKit, &pTstParms->TestTone);
353 if (RT_SUCCESS(rc))
354 {
355 /*
356 * 2. Tell the guest ATS to start recording.
357 */
358 rc = AudioTestSvcClientToneRecord(&pTstEnv->u.Host.AtsClGuest, &pTstParms->TestTone);
359 }
360
361 if (RT_FAILURE(rc))
362 RTTestFailed(g_hTest, "Recording tone failed\n");
363 }
364
365 return rc;
366}
367
368/**
369 * @copydoc FNAUDIOTESTDESTROY
370 */
371static DECLCALLBACK(int) audioTestRecordToneDestroy(PAUDIOTESTENV pTstEnv, void *pvCtx)
372{
373 RT_NOREF(pTstEnv, pvCtx);
374
375 return VINF_SUCCESS;
376}
377
378
379/*********************************************************************************************************************************
380* Test execution *
381*********************************************************************************************************************************/
382
383/** Test definition table. */
384AUDIOTESTDESC g_aTests[] =
385{
386 /* pszTest fExcluded pfnSetup */
387 { "PlayTone", false, audioTestPlayToneSetup, audioTestPlayToneExec, audioTestPlayToneDestroy },
388 { "RecordTone", false, audioTestRecordToneSetup, audioTestRecordToneExec, audioTestRecordToneDestroy }
389};
390/** Number of tests defined. */
391unsigned g_cTests = RT_ELEMENTS(g_aTests);
392
393/**
394 * Runs one specific audio test.
395 *
396 * @returns VBox status code.
397 * @param pTstEnv Test environment to use for running the test.
398 * @param pTstDesc Test to run.
399 * @param uSeq Test sequence # in case there are more tests.
400 * @param pOverrideParms Test parameters for overriding the actual test parameters. Optional.
401 */
402static int audioTestOne(PAUDIOTESTENV pTstEnv, PAUDIOTESTDESC pTstDesc,
403 unsigned uSeq, PAUDIOTESTPARMS pOverrideParms)
404{
405 RT_NOREF(uSeq);
406
407 int rc;
408
409 AUDIOTESTPARMS TstParms;
410 audioTestParmsInit(&TstParms);
411
412 RTTestSub(g_hTest, pTstDesc->pszName);
413
414 if (pTstDesc->fExcluded)
415 {
416 RTTestSkipped(g_hTest, "Excluded from list");
417 return VINF_SUCCESS;
418 }
419
420 void *pvCtx = NULL; /* Test-specific opaque context. Optional and can be NULL. */
421
422 if (pTstDesc->pfnSetup)
423 {
424 rc = pTstDesc->pfnSetup(pTstEnv, pTstDesc, &TstParms, &pvCtx);
425 if (RT_FAILURE(rc))
426 {
427 RTTestFailed(g_hTest, "Test setup failed with %Rrc\n", rc);
428 return rc;
429 }
430 }
431
432 audioTestCombineParms(&TstParms, pOverrideParms);
433
434 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%u: %RU32 iterations\n", uSeq, TstParms.cIterations);
435
436 if (TstParms.Dev.pszName && strlen(TstParms.Dev.pszName)) /** @todo Refine this check. Use pszId for starters! */
437 rc = audioTestDeviceOpen(&TstParms.Dev);
438
439 AssertPtr(pTstDesc->pfnExec);
440 rc = pTstDesc->pfnExec(pTstEnv, pvCtx, &TstParms);
441 if (RT_FAILURE(rc))
442 RTTestFailed(g_hTest, "Test failed with %Rrc\n", rc);
443
444 RTTestSubDone(g_hTest);
445
446 if (pTstDesc->pfnDestroy)
447 {
448 int rc2 = pTstDesc->pfnDestroy(pTstEnv, pvCtx);
449 if (RT_SUCCESS(rc))
450 rc = rc2;
451
452 if (RT_FAILURE(rc2))
453 RTTestFailed(g_hTest, "Test destruction failed with %Rrc\n", rc2);
454 }
455
456 rc = audioTestDeviceClose(&TstParms.Dev);
457
458 audioTestParmsDestroy(&TstParms);
459
460 return rc;
461}
462
463/**
464 * Runs all specified tests in a row.
465 *
466 * @returns VBox status code.
467 * @param pTstEnv Test environment to use for running all tests.
468 * @param pOverrideParms Test parameters for (some / all) specific test parameters. Optional.
469 */
470int audioTestWorker(PAUDIOTESTENV pTstEnv, PAUDIOTESTPARMS pOverrideParms)
471{
472 int rc = VINF_SUCCESS;
473
474 if (pTstEnv->enmMode == AUDIOTESTMODE_GUEST)
475 {
476 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Guest ATS running\n");
477
478 while (!g_fTerminate)
479 RTThreadSleep(100);
480
481 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Shutting down guest ATS ...\n");
482
483 int rc2 = AudioTestSvcShutdown(&pTstEnv->u.Guest.Srv);
484 if (RT_SUCCESS(rc))
485 rc = rc2;
486
487 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Guest ATS shutdown complete\n");
488 }
489 else if (pTstEnv->enmMode == AUDIOTESTMODE_HOST)
490 {
491 RTTestPrintf(g_hTest, RTTESTLVL_DEBUG, "Using tag '%s'\n", pTstEnv->szTag);
492
493 rc = AudioTestSvcClientTestSetBegin(&pTstEnv->u.Host.AtsClValKit, pTstEnv->szTag);
494 if (RT_SUCCESS(rc))
495 rc = AudioTestSvcClientTestSetBegin(&pTstEnv->u.Host.AtsClGuest, pTstEnv->szTag);
496
497 if (RT_SUCCESS(rc))
498 {
499 unsigned uSeq = 0;
500 for (unsigned i = 0; i < RT_ELEMENTS(g_aTests); i++)
501 {
502 int rc2 = audioTestOne(pTstEnv, &g_aTests[i], uSeq, pOverrideParms);
503 if (RT_SUCCESS(rc))
504 rc = rc2;
505
506 if (!g_aTests[i].fExcluded)
507 uSeq++;
508
509 if (g_fTerminate)
510 break;
511 }
512
513 int rc2 = AudioTestSvcClientTestSetEnd(&pTstEnv->u.Host.AtsClGuest, pTstEnv->szTag);
514 if (RT_SUCCESS(rc))
515 rc = rc2;
516
517 rc2 = AudioTestSvcClientTestSetEnd(&pTstEnv->u.Host.AtsClValKit, pTstEnv->szTag);
518 if (RT_SUCCESS(rc))
519 rc = rc2;
520
521 if (RT_SUCCESS(rc))
522 {
523 /*
524 * Download guest + Validation Kit audio driver test sets to our output directory.
525 */
526 char szFileName[RTPATH_MAX];
527 if (RTStrPrintf2(szFileName, sizeof(szFileName), "%s-guest.tar.gz", pTstEnv->szTag))
528 {
529 rc = RTPathJoin(pTstEnv->u.Host.szPathTestSetGuest, sizeof(pTstEnv->u.Host.szPathTestSetGuest),
530 pTstEnv->szPathOut, szFileName);
531 if (RT_SUCCESS(rc))
532 {
533 if (RTStrPrintf2(szFileName, sizeof(szFileName), "%s-host.tar.gz", pTstEnv->szTag))
534 {
535 rc = RTPathJoin(pTstEnv->u.Host.szPathTestSetValKit, sizeof(pTstEnv->u.Host.szPathTestSetValKit),
536 pTstEnv->szPathOut, szFileName);
537 }
538 else
539 rc = VERR_BUFFER_OVERFLOW;
540 }
541 else
542 rc = VERR_BUFFER_OVERFLOW;
543
544 if (RT_SUCCESS(rc))
545 {
546 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Downloading guest test set to '%s'\n",
547 pTstEnv->u.Host.szPathTestSetGuest);
548 rc = AudioTestSvcClientTestSetDownload(&pTstEnv->u.Host.AtsClGuest,
549 pTstEnv->szTag, pTstEnv->u.Host.szPathTestSetGuest);
550 }
551
552 if (RT_SUCCESS(rc))
553 {
554 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Downloading host test set to '%s'\n",
555 pTstEnv->u.Host.szPathTestSetValKit);
556 rc = AudioTestSvcClientTestSetDownload(&pTstEnv->u.Host.AtsClValKit,
557 pTstEnv->szTag, pTstEnv->u.Host.szPathTestSetValKit);
558 }
559 }
560 else
561 rc = VERR_BUFFER_OVERFLOW;
562
563 if ( RT_SUCCESS(rc)
564 && !pTstEnv->fSkipVerify)
565 {
566 rc = audioVerifyOne(pTstEnv->u.Host.szPathTestSetGuest, pTstEnv->u.Host.szPathTestSetValKit);
567 }
568 else
569 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Verification skipped\n");
570 }
571 }
572 }
573 else
574 AssertFailed();
575
576 if (RT_FAILURE(rc))
577 RTTestFailed(g_hTest, "Test worker failed with %Rrc", rc);
578
579 return rc;
580}
581
582/** Option help for the 'test' command. */
583static DECLCALLBACK(const char *) audioTestCmdTestHelp(PCRTGETOPTDEF pOpt)
584{
585 switch (pOpt->iShort)
586 {
587 case 'd': return "Go via DrvAudio instead of directly interfacing with the backend";
588 case VKAT_TEST_OPT_DEV: return "Use the specified audio device";
589 case VKAT_TEST_OPT_GUEST_ATS_ADDR: return "Address of guest ATS to connect to.";
590 case VKAT_TEST_OPT_GUEST_ATS_PORT: return "Port of guest ATS to connect to [6052].";
591 case VKAT_TEST_OPT_HOST_ATS_ADDR: return "Address of host ATS to connect to.";
592 case VKAT_TEST_OPT_HOST_ATS_PORT: return "Port of host ATS to connect to [6052].";
593 case VKAT_TEST_OPT_MODE: return "Specifies the mode this program runs at";
594 case VKAT_TEST_OPT_NO_VERIFY: return "Skips the verification step.";
595 case 'e': return "Exclude the given test id from the list";
596 case 'a': return "Exclude all tests from the list (useful to enable single tests later with --include)";
597 case 'i': return "Include the given test id in the list";
598 }
599 return NULL;
600}
601
602/**
603 * Main (entry) function for the testing functionality of VKAT.
604 *
605 * @returns Program exit code.
606 * @param pGetState RTGetOpt state.
607 */
608static DECLCALLBACK(RTEXITCODE) audioTestMain(PRTGETOPTSTATE pGetState)
609{
610 AUDIOTESTENV TstEnv;
611 RT_ZERO(TstEnv);
612
613 AUDIOTESTPARMS TstCust;
614 audioTestParmsInit(&TstCust);
615
616 const char *pszDevice = NULL; /* Custom device to use. Can be NULL if not being used. */
617 const char *pszTag = NULL; /* Custom tag to use. Can be NULL if not being used. */
618 PCPDMDRVREG pDrvReg = AudioTestGetDefaultBackend();
619 bool fWithDrvAudio = false;
620 uint8_t cPcmSampleBit = 0;
621 uint8_t cPcmChannels = 0;
622 uint32_t uPcmHz = 0;
623 bool fPcmSigned = true;
624
625 const char *pszGuestTcpAddr = NULL;
626 uint16_t uGuestTcpPort = ATS_TCP_GUEST_DEFAULT_PORT;
627 const char *pszValKitTcpAddr = NULL;
628 uint16_t uValKitTcpPort = ATS_TCP_HOST_DEFAULT_PORT;
629
630 int rc;
631 RTGETOPTUNION ValueUnion;
632 while ((rc = RTGetOpt(pGetState, &ValueUnion)))
633 {
634 switch (rc)
635 {
636 case 'a':
637 for (unsigned i = 0; i < RT_ELEMENTS(g_aTests); i++)
638 g_aTests[i].fExcluded = true;
639 break;
640
641 case 'b':
642 pDrvReg = AudioTestFindBackendOpt(ValueUnion.psz);
643 if (pDrvReg == NULL)
644 return RTEXITCODE_SYNTAX;
645 break;
646
647 case 'd':
648 fWithDrvAudio = true;
649 break;
650
651 case 'e':
652 if (ValueUnion.u32 >= RT_ELEMENTS(g_aTests))
653 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Invalid test number %u passed to --exclude", ValueUnion.u32);
654 g_aTests[ValueUnion.u32].fExcluded = true;
655 break;
656
657 case VKAT_TEST_OPT_GUEST_ATS_ADDR:
658 pszGuestTcpAddr = ValueUnion.psz;
659 break;
660
661 case VKAT_TEST_OPT_GUEST_ATS_PORT:
662 uGuestTcpPort = ValueUnion.u32;
663 break;
664
665 case VKAT_TEST_OPT_HOST_ATS_ADDR:
666 pszValKitTcpAddr = ValueUnion.psz;
667 break;
668
669 case VKAT_TEST_OPT_HOST_ATS_PORT:
670 uValKitTcpPort = ValueUnion.u32;
671 break;
672
673 case VKAT_TEST_OPT_MODE:
674 if (TstEnv.enmMode != AUDIOTESTMODE_UNKNOWN)
675 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Test mode (guest / host) already specified");
676 TstEnv.enmMode = RTStrICmp(ValueUnion.psz, "guest") == 0 ? AUDIOTESTMODE_GUEST : AUDIOTESTMODE_HOST;
677 break;
678
679 case VKAT_TEST_OPT_NO_VERIFY:
680 TstEnv.fSkipVerify = true;
681 break;
682
683 case 'i':
684 if (ValueUnion.u32 >= RT_ELEMENTS(g_aTests))
685 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Invalid test number %u passed to --include", ValueUnion.u32);
686 g_aTests[ValueUnion.u32].fExcluded = false;
687 break;
688
689 case VKAT_TEST_OPT_COUNT:
690 return RTMsgErrorExitFailure("Not yet implemented!");
691
692 case VKAT_TEST_OPT_DEV:
693 pszDevice = ValueUnion.psz;
694 break;
695
696 case VKAT_TEST_OPT_PAUSE:
697 return RTMsgErrorExitFailure("Not yet implemented!");
698
699 case VKAT_TEST_OPT_OUTDIR:
700 rc = RTStrCopy(TstEnv.szPathOut, sizeof(TstEnv.szPathOut), ValueUnion.psz);
701 if (RT_FAILURE(rc))
702 return RTMsgErrorExitFailure("Failed to copy out directory: %Rrc", rc);
703 break;
704
705 case VKAT_TEST_OPT_PCM_BIT:
706 cPcmSampleBit = ValueUnion.u8;
707 break;
708
709 case VKAT_TEST_OPT_PCM_CHAN:
710 cPcmChannels = ValueUnion.u8;
711 break;
712
713 case VKAT_TEST_OPT_PCM_HZ:
714 uPcmHz = ValueUnion.u32;
715 break;
716
717 case VKAT_TEST_OPT_PCM_SIGNED:
718 fPcmSigned = ValueUnion.f;
719 break;
720
721 case VKAT_TEST_OPT_TAG:
722 pszTag = ValueUnion.psz;
723 break;
724
725 case VKAT_TEST_OPT_TEMPDIR:
726 rc = RTStrCopy(TstEnv.szPathTemp, sizeof(TstEnv.szPathTemp), ValueUnion.psz);
727 if (RT_FAILURE(rc))
728 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Temp dir invalid, rc=%Rrc", rc);
729 break;
730
731 case VKAT_TEST_OPT_VOL:
732 TstCust.TestTone.uVolumePercent = ValueUnion.u8;
733 break;
734
735 AUDIO_TEST_COMMON_OPTION_CASES(ValueUnion);
736
737 default:
738 return RTGetOptPrintError(rc, &ValueUnion);
739 }
740 }
741
742 /*
743 * Start testing.
744 */
745 RTTestBanner(g_hTest);
746
747 /* Initialize the custom test parameters with sensible defaults if nothing else is given. */
748 PDMAudioPropsInit(&TstCust.TestTone.Props,
749 cPcmSampleBit ? cPcmSampleBit / 8 : 2 /* 16-bit */, fPcmSigned, cPcmChannels ? cPcmChannels : 2,
750 uPcmHz ? uPcmHz : 44100);
751
752 if (TstEnv.enmMode == AUDIOTESTMODE_UNKNOWN)
753 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "No test mode specified!\n");
754
755 if (TstEnv.enmMode == AUDIOTESTMODE_HOST)
756 {
757 if (!pszGuestTcpAddr)
758 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "--guest-ats-address missing\n");
759 }
760
761 /* For now all tests have the same test environment. */
762 rc = audioTestEnvInit(&TstEnv, pDrvReg, fWithDrvAudio,
763 pszValKitTcpAddr, uValKitTcpPort,
764 pszGuestTcpAddr, uGuestTcpPort);
765 if (RT_SUCCESS(rc))
766 {
767 audioTestWorker(&TstEnv, &TstCust);
768 audioTestEnvDestroy(&TstEnv);
769 }
770
771 audioTestParmsDestroy(&TstCust);
772
773 if (RT_FAILURE(rc)) /* Let us know that something went wrong in case we forgot to mention it. */
774 RTTestFailed(g_hTest, "Testing failed with %Rrc\n", rc);
775
776 /*
777 * Print summary and exit.
778 */
779 return RTTestSummaryAndDestroy(g_hTest);
780}
781
782
783const VKATCMD g_CmdTest =
784{
785 "test",
786 audioTestMain,
787 "Runs audio tests and creates an audio test set.",
788 g_aCmdTestOptions,
789 RT_ELEMENTS(g_aCmdTestOptions),
790 audioTestCmdTestHelp
791};
792
793
794/*********************************************************************************************************************************
795* Command: verify *
796*********************************************************************************************************************************/
797
798static int audioVerifyOpenTestSet(const char *pszPathSet, PAUDIOTESTSET pSet)
799{
800 int rc;
801
802 char szPathExtracted[RTPATH_MAX];
803
804 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Opening test set '%s'\n", pszPathSet);
805
806 const bool fPacked = AudioTestSetIsPacked(pszPathSet);
807 if (fPacked)
808 {
809 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test set is an archive and needs to be unpacked\n");
810
811 char szPathTemp[RTPATH_MAX];
812 rc = RTPathTemp(szPathTemp, sizeof(szPathTemp));
813 if (RT_SUCCESS(rc))
814 {
815 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Using temporary directory '%s'\n", szPathTemp);
816
817 rc = RTPathJoin(szPathExtracted, sizeof(szPathExtracted), szPathTemp, "vkat-XXXX");
818 if (RT_SUCCESS(rc))
819 {
820 rc = RTDirCreateTemp(szPathExtracted, 0755);
821 if (RT_SUCCESS(rc))
822 {
823 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Unpacking archive to '%s'\n", szPathExtracted);
824 rc = AudioTestSetUnpack(pszPathSet, szPathExtracted);
825 if (RT_SUCCESS(rc))
826 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Archive successfully unpacked\n");
827 }
828 }
829 }
830 }
831 else
832 rc = VINF_SUCCESS;
833
834 if (RT_SUCCESS(rc))
835 rc = AudioTestSetOpen(pSet, fPacked ? szPathExtracted : pszPathSet);
836
837 if (RT_FAILURE(rc))
838 RTTestFailed(g_hTest, "Unable to open / unpack test set archive: %Rrc", rc);
839
840 return rc;
841}
842
843/**
844 * Verifies one test set pair.
845 *
846 * @returns VBox status code.
847 * @param pszPathSetA Absolute path to test set A.
848 * @param pszPathSetB Absolute path to test set B.
849 */
850static int audioVerifyOne(const char *pszPathSetA, const char *pszPathSetB)
851{
852 RTTestSubF(g_hTest, "Verifying");
853 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Verifying test set '%s' with test set '%s'\n", pszPathSetA, pszPathSetB);
854
855 AUDIOTESTSET SetA, SetB;
856 int rc = audioVerifyOpenTestSet(pszPathSetA, &SetA);
857 if (RT_SUCCESS(rc))
858 rc = audioVerifyOpenTestSet(pszPathSetB, &SetB);
859
860 if (RT_SUCCESS(rc))
861 {
862 AUDIOTESTERRORDESC errDesc;
863 rc = AudioTestSetVerify(&SetA, &SetB, &errDesc);
864 if (RT_SUCCESS(rc))
865 {
866 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "%RU32 errors occurred while verifying\n", AudioTestErrorDescCount(&errDesc));
867 if (AudioTestErrorDescFailed(&errDesc))
868 {
869 /** @todo Use some AudioTestErrorXXX API for enumeration here later. */
870 PAUDIOTESTERRORENTRY pErrEntry;
871 RTListForEach(&errDesc.List, pErrEntry, AUDIOTESTERRORENTRY, Node)
872 RTTestFailed(g_hTest, pErrEntry->szDesc);
873 }
874 else
875 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Verification successful\n");
876
877 AudioTestErrorDescDestroy(&errDesc);
878 }
879 else
880 RTTestFailed(g_hTest, "Verification failed with %Rrc", rc);
881 }
882
883 AudioTestSetClose(&SetA);
884 AudioTestSetClose(&SetB);
885
886 RTTestSubDone(g_hTest);
887
888 return rc;
889}
890
891/**
892 * Main (entry) function for the verification functionality of VKAT.
893 *
894 * @returns Program exit code.
895 * @param pGetState RTGetOpt state.
896 */
897static DECLCALLBACK(RTEXITCODE) audioVerifyMain(PRTGETOPTSTATE pGetState)
898{
899 /*
900 * Parse options and process arguments.
901 */
902 const char *apszSets[2] = { NULL, NULL };
903 unsigned iTestSet = 0;
904
905 int rc;
906 RTGETOPTUNION ValueUnion;
907 while ((rc = RTGetOpt(pGetState, &ValueUnion)))
908 {
909 switch (rc)
910 {
911 case VKAT_VERIFY_OPT_TAG:
912 break;
913
914 case VINF_GETOPT_NOT_OPTION:
915 if (iTestSet == 0)
916 RTTestBanner(g_hTest);
917 if (iTestSet >= RT_ELEMENTS(apszSets))
918 return RTMsgErrorExitFailure("Only two test sets can be verified at one time");
919 apszSets[iTestSet++] = ValueUnion.psz;
920 break;
921
922 AUDIO_TEST_COMMON_OPTION_CASES(ValueUnion);
923
924 default:
925 return RTGetOptPrintError(rc, &ValueUnion);
926 }
927 }
928
929 if (!iTestSet)
930 return RTMsgErrorExitFailure("At least one test set must be specified");
931
932 /*
933 * If only test set A is given, default to the current directory
934 * for test set B.
935 */
936 char szDirCur[RTPATH_MAX];
937 if (iTestSet == 1)
938 {
939 rc = RTPathGetCurrent(szDirCur, sizeof(szDirCur));
940 if (RT_SUCCESS(rc))
941 apszSets[1] = szDirCur;
942 else
943 RTTestFailed(g_hTest, "Failed to retrieve current directory: %Rrc", rc);
944 }
945
946 if (RT_SUCCESS(rc))
947 audioVerifyOne(apszSets[0], apszSets[1]);
948
949 /*
950 * Print summary and exit.
951 */
952 return RTTestSummaryAndDestroy(g_hTest);
953}
954
955
956const VKATCMD g_CmdVerify =
957{
958 "verify",
959 audioVerifyMain,
960 "Verifies a formerly created audio test set.",
961 g_aCmdVerifyOptions,
962 RT_ELEMENTS(g_aCmdVerifyOptions),
963 NULL,
964};
965
966
967/*********************************************************************************************************************************
968* Main *
969*********************************************************************************************************************************/
970
971/**
972 * Ctrl-C signal handler.
973 *
974 * This just sets g_fTerminate and hope it will be noticed soon. It restores
975 * the SIGINT action to default, so that a second Ctrl-C will have the normal
976 * effect (just in case the code doesn't respond to g_fTerminate).
977 */
978static void audioTestSignalHandler(int iSig) RT_NOEXCEPT
979{
980 Assert(iSig == SIGINT); RT_NOREF(iSig);
981 RTPrintf("Ctrl-C!\n");
982 ASMAtomicWriteBool(&g_fTerminate, true);
983 signal(SIGINT, SIG_DFL);
984}
985
986/**
987 * Commands.
988 */
989const VKATCMD *g_apCommands[] =
990{
991 &g_CmdTest,
992 &g_CmdVerify,
993 &g_CmdEnum,
994 &g_CmdPlay,
995 &g_CmdRec,
996 &g_CmdSelfTest
997};
998
999/**
1000 * Shows tool usage text.
1001 */
1002RTEXITCODE audioTestUsage(PRTSTREAM pStrm)
1003{
1004 RTStrmPrintf(pStrm, "usage: %s [global options] <command> [command-options]\n",
1005 RTPathFilename(RTProcExecutablePath()));
1006 RTStrmPrintf(pStrm,
1007 "\n"
1008 "Global Options:\n"
1009 " --debug-audio\n"
1010 " Enables DrvAudio debugging.\n"
1011 " --debug-audio-path=<path>\n"
1012 " Tells DrvAudio where to put its debug output (wav-files).\n"
1013 " -q, --quiet\n"
1014 " Sets verbosity to zero.\n"
1015 " -v, --verbose\n"
1016 " Increase verbosity.\n"
1017 " -V, --version\n"
1018 " Displays version.\n"
1019 " -h, -?, --help\n"
1020 " Displays help.\n"
1021 );
1022
1023 for (uintptr_t iCmd = 0; iCmd < RT_ELEMENTS(g_apCommands); iCmd++)
1024 {
1025 PCVKATCMD const pCmd = g_apCommands[iCmd];
1026 RTStrmPrintf(pStrm,
1027 "\n"
1028 "Command '%s':\n"
1029 " %s\n"
1030 "Options for '%s':\n",
1031 pCmd->pszCommand, pCmd->pszDesc, pCmd->pszCommand);
1032 PCRTGETOPTDEF const paOptions = pCmd->paOptions;
1033 for (unsigned i = 0; i < pCmd->cOptions; i++)
1034 {
1035 if (RT_C_IS_PRINT(paOptions[i].iShort))
1036 RTStrmPrintf(pStrm, " -%c, %s\n", paOptions[i].iShort, paOptions[i].pszLong);
1037 else
1038 RTStrmPrintf(pStrm, " %s\n", paOptions[i].pszLong);
1039
1040 const char *pszHelp = NULL;
1041 if (pCmd->pfnOptionHelp)
1042 pszHelp = pCmd->pfnOptionHelp(&paOptions[i]);
1043 if (pszHelp)
1044 RTStrmPrintf(pStrm, " %s\n", pszHelp);
1045 }
1046 }
1047 return RTEXITCODE_SUCCESS;
1048}
1049
1050/**
1051 * Shows tool version.
1052 */
1053RTEXITCODE audioTestVersion(void)
1054{
1055 RTPrintf("%s\n", RTBldCfgRevisionStr());
1056 return RTEXITCODE_SUCCESS;
1057}
1058
1059/**
1060 * Shows the logo.
1061 *
1062 * @param pStream Output stream to show logo on.
1063 */
1064static void audioTestShowLogo(PRTSTREAM pStream)
1065{
1066 RTStrmPrintf(pStream, VBOX_PRODUCT " VKAT (Validation Kit Audio Test) Version " VBOX_VERSION_STRING " - r%s\n"
1067 "(C) " VBOX_C_YEAR " " VBOX_VENDOR "\n"
1068 "All rights reserved.\n\n", RTBldCfgRevisionStr());
1069}
1070
1071int main(int argc, char **argv)
1072{
1073 /*
1074 * Init IPRT and globals.
1075 */
1076 RTEXITCODE rcExit = RTTestInitAndCreate("AudioTest", &g_hTest);
1077 if (rcExit != RTEXITCODE_SUCCESS)
1078 return rcExit;
1079
1080#ifdef RT_OS_WINDOWS
1081 HRESULT hrc = CoInitializeEx(NULL /*pReserved*/, COINIT_MULTITHREADED | COINIT_SPEED_OVER_MEMORY | COINIT_DISABLE_OLE1DDE);
1082 if (FAILED(hrc))
1083 RTMsgWarning("CoInitializeEx failed: %#x", hrc);
1084#endif
1085
1086 /*
1087 * Configure release logging to go to stderr.
1088 */
1089 static const char * const g_apszLogGroups[] = VBOX_LOGGROUP_NAMES;
1090 int rc = RTLogCreate(&g_pRelLogger, RTLOGFLAGS_PREFIX_THREAD, "all.e.l", "VKAT_RELEASE_LOG",
1091 RT_ELEMENTS(g_apszLogGroups), g_apszLogGroups, RTLOGDEST_STDERR, NULL /*"vkat-release.log"*/);
1092 if (RT_SUCCESS(rc))
1093 RTLogRelSetDefaultInstance(g_pRelLogger);
1094 else
1095 RTMsgWarning("Failed to create release logger: %Rrc", rc);
1096
1097 /*
1098 * Install a Ctrl-C signal handler.
1099 */
1100#ifdef RT_OS_WINDOWS
1101 signal(SIGINT, audioTestSignalHandler);
1102#else
1103 struct sigaction sa;
1104 RT_ZERO(sa);
1105 sa.sa_handler = audioTestSignalHandler;
1106 sigaction(SIGINT, &sa, NULL);
1107#endif
1108
1109 /*
1110 * Process common options.
1111 */
1112 RTGETOPTSTATE GetState;
1113 rc = RTGetOptInit(&GetState, argc, argv, g_aCmdCommonOptions,
1114 RT_ELEMENTS(g_aCmdCommonOptions), 1 /*idxFirst*/, 0 /*fFlags - must not sort! */);
1115 AssertRCReturn(rc, RTEXITCODE_INIT);
1116
1117 RTGETOPTUNION ValueUnion;
1118 while ((rc = RTGetOpt(&GetState, &ValueUnion)) != 0)
1119 {
1120 switch (rc)
1121 {
1122 case 'q':
1123 g_uVerbosity = 0;
1124 if (g_pRelLogger)
1125 RTLogGroupSettings(g_pRelLogger, "all=0 all.e");
1126 break;
1127
1128 case 'v':
1129 g_uVerbosity++;
1130 if (g_pRelLogger)
1131 RTLogGroupSettings(g_pRelLogger, g_uVerbosity == 1 ? "all.e.l" : g_uVerbosity == 2 ? "all.e.l.f" : "all=~0");
1132 break;
1133
1134 case 'V':
1135 return audioTestVersion();
1136
1137 case 'h':
1138 audioTestShowLogo(g_pStdOut);
1139 return audioTestUsage(g_pStdOut);
1140
1141 case VINF_GETOPT_NOT_OPTION:
1142 {
1143 for (uintptr_t iCmd = 0; iCmd < RT_ELEMENTS(g_apCommands); iCmd++)
1144 {
1145 PCVKATCMD const pCmd = g_apCommands[iCmd];
1146 if (strcmp(ValueUnion.psz, pCmd->pszCommand) == 0)
1147 {
1148 size_t const cCombinedOptions = pCmd->cOptions + RT_ELEMENTS(g_aCmdCommonOptions);
1149 PRTGETOPTDEF paCombinedOptions = (PRTGETOPTDEF)RTMemAlloc(cCombinedOptions * sizeof(RTGETOPTDEF));
1150 if (paCombinedOptions)
1151 {
1152 memcpy(paCombinedOptions, g_aCmdCommonOptions, sizeof(g_aCmdCommonOptions));
1153 memcpy(&paCombinedOptions[RT_ELEMENTS(g_aCmdCommonOptions)],
1154 pCmd->paOptions, pCmd->cOptions * sizeof(RTGETOPTDEF));
1155
1156 rc = RTGetOptInit(&GetState, argc, argv, paCombinedOptions, cCombinedOptions,
1157 GetState.iNext /*idxFirst*/, RTGETOPTINIT_FLAGS_OPTS_FIRST);
1158 if (RT_SUCCESS(rc))
1159 {
1160
1161 rcExit = pCmd->pfnHandler(&GetState);
1162 RTMemFree(paCombinedOptions);
1163 return rcExit;
1164 }
1165 return RTMsgErrorExitFailure("RTGetOptInit failed for '%s': %Rrc", ValueUnion.psz, rc);
1166 }
1167 return RTMsgErrorExitFailure("Out of memory!");
1168 }
1169 }
1170 RTMsgError("Unknown command '%s'!\n", ValueUnion.psz);
1171 audioTestUsage(g_pStdErr);
1172 return RTEXITCODE_SYNTAX;
1173 }
1174
1175 default:
1176 return RTGetOptPrintError(rc, &ValueUnion);
1177 }
1178 }
1179
1180 RTMsgError("No command specified!\n");
1181 audioTestUsage(g_pStdErr);
1182 return RTEXITCODE_SYNTAX;
1183}
1184
Note: See TracBrowser for help on using the repository browser.

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