VirtualBox

Changeset 91413 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 27, 2021 5:04:53 PM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: Added "--tone-duration <ms>" option to specify test tone fixed durations being recorded / played back. ​bugref:10008

Location:
trunk/src/VBox/ValidationKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/audio/tdAudioTest.py

    r91212 r91413  
    114114        reporter.log('  --audio-test-count <number>');
    115115        reporter.log('      Default: 0 (means random)');
     116        reporter.log('  --audio-test-tone-duration <ms>');
     117        reporter.log('      Default: 0 (means random)');
    116118        reporter.log('  --audio-verify-max-diff-count <number>');
    117119        reporter.log('      Default: 0 (strict)');
     
    142144                        raise base.InvalidOption('The "--audio-tests" value "%s" is not valid; valid values are: %s'
    143145                                                    % (s, ' '.join(self.asTestsDef)));
    144         elif    asArgs[iArg] == '--audio-test-count':
     146        elif    asArgs[iArg] == 'audio-test-count' \
     147             or asArgs[iArg] == 'audio-test-tone-duration':
    145148            # Strip the "--audio-test-" prefix and keep the options as defined in VKAT,
    146149            # e.g. "--audio-test-count" -> "--count". That way we don't
  • trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp

    r91211 r91413  
    119119    VKAT_TEST_OPT_COUNT = 900,
    120120    VKAT_TEST_OPT_DEV,
     121    VKAT_TEST_OPT_TONE_DURATION_MS,
    121122    VKAT_TEST_OPT_GUEST_ATS_ADDR,
    122123    VKAT_TEST_OPT_GUEST_ATS_PORT,
     
    195196    { "--tcp-bind-port",     VKAT_TEST_OPT_TCP_BIND_PORT,       RTGETOPT_REQ_UINT16  },
    196197    { "--tcp-connect-addr",  VKAT_TEST_OPT_TCP_CONNECT_ADDRESS, RTGETOPT_REQ_STRING  },
    197     { "--tcp-connect-port",  VKAT_TEST_OPT_TCP_CONNECT_PORT,    RTGETOPT_REQ_UINT16  }
     198    { "--tcp-connect-port",  VKAT_TEST_OPT_TCP_CONNECT_PORT,    RTGETOPT_REQ_UINT16  },
     199    { "--tone-duration",     VKAT_TEST_OPT_TONE_DURATION_MS,    RTGETOPT_REQ_UINT32  }
    198200};
    199201
     
    280282    pToneParms->dbFreqHz       = AudioTestToneGetRandomFreq();
    281283    pToneParms->msPrequel      = 0; /** @todo Implement analyzing this first! */
    282     pToneParms->msDuration     = RTRandU32Ex(200, RT_MS_30SEC); /** @todo Probably a bit too long, but let's see. */
     284    pToneParms->msDuration     = pTstEnv->cMsToneDuration == 0 ? RTRandU32Ex(200, RT_MS_30SEC) : pTstEnv->cMsToneDuration;
    283285    pToneParms->msSequel       = 0;   /** @todo Implement analyzing this first! */
    284286    pToneParms->uVolumePercent = 100; /** @todo Implement analyzing this first! */
     
    387389    pToneParms->msPrequel      = 0; /** @todo Implement analyzing this first! */
    388390    pToneParms->Props          = pTstParmsAcq->Props;
    389     pToneParms->msDuration     = RTRandU32Ex(200 /* ms */, RT_MS_30SEC); /** @todo Record even longer? */
     391    pToneParms->msDuration     = pTstEnv->cMsToneDuration == 0 ? RTRandU32Ex(200, RT_MS_30SEC) : pTstEnv->cMsToneDuration;
    390392    pToneParms->msSequel       = 0;   /** @todo Implement analyzing this first! */
    391393    pToneParms->uVolumePercent = 100; /** @todo Implement analyzing this first! */
     
    710712        case VKAT_TEST_OPT_DEV:                 return "Name of the input/output device to use\n"
    711713                                                       "    Default: default device";
     714        case VKAT_TEST_OPT_TONE_DURATION_MS:    return "Duration (in ms) of test tone to play / record for selected tests\n"
     715                                                       "    Default: random number";
    712716        case VKAT_TEST_OPT_GUEST_ATS_ADDR:      return "Address of guest ATS to connect to\n"
    713717                                                       "    Default: " ATS_TCP_DEF_CONNECT_GUEST_STR;
     
    840844                break;
    841845
     846            case VKAT_TEST_OPT_TONE_DURATION_MS:
     847                TstEnv.cMsToneDuration = ValueUnion.u32;
     848                break;
     849
    842850            case VKAT_TEST_OPT_PAUSE:
    843851                return RTMsgErrorExitFailure("Not yet implemented!");
  • trunk/src/VBox/ValidationKit/utils/audio/vkatInternal.h

    r91211 r91413  
    236236     *  When set to 0 (default), a random value (see specific test) will be chosen. */
    237237    uint32_t                cIterations;
     238    /** Duration (in ms) to play / record test tone.
     239     *  When set to 0 (default), a random value (see specific test) will be chosen. */
     240    uint32_t                cMsToneDuration;
    238241    /** Output path for storing the test environment's final test files. */
    239242    char                    szTag[AUDIOTEST_TAG_MAX];
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