VirtualBox

Changeset 91613 in vbox


Ignore:
Timestamp:
Oct 7, 2021 9:08:17 AM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: Try to fix testbox errors when setting an explicit audio controller type. ​bugref:10008

File:
1 edited

Legend:

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

    r91585 r91613  
    106106        # Audio controller type to use.
    107107        # If set to None, the OS' recommended controller type will be used (defined by Main).
    108         self.enmAudioControllerType = None;
     108        self.sAudioControllerType = None;
    109109
    110110    def showUsage(self):
     
    156156            if iArg >= len(asArgs):
    157157                raise base.InvalidOption('Option "%s" needs a value' % (asArgs[iArg - 1]));
    158             if not self.importVBoxApi(): # So we can use the constant below.
    159                 return iArg + 1; # Just skip stuff.
    160             if   asArgs[iArg] == 'HDA':
    161                 self.enmAudioControllerType = vboxcon.AudioControllerType_HDA;
    162             elif asArgs[iArg] == 'AC97':
    163                 self.enmAudioControllerType = vboxcon.AudioControllerType_AC97;
    164             elif asArgs[iArg] == 'SB16':
    165                 self.enmAudioControllerType = vboxcon.AudioControllerType_SB16;
     158            if    asArgs[iArg] == 'HDA' \
     159               or asArgs[iArg] == 'AC97' \
     160               or asArgs[iArg] == 'SB16':
     161                self.sAudioControllerType = asArgs[iArg];
    166162            else:
    167163                raise base.InvalidOption('The "--audio-controller-type" value "%s" is not valid' % (asArgs[iArg]));
     
    719715            # Make sure that the VM's audio adapter is configured the way we need it to.
    720716            if self.fpApiVer >= 4.0:
     717                enmAudioControllerType = None;
    721718                reporter.log('Configuring audio controller type ...');
    722                 if self.enmAudioControllerType is None:
     719                if self.sAudioControllerType is None:
    723720                    oOsType = oSession.getOsType();
    724                     self.enmAudioControllerType = oOsType.recommendedAudioController;
    725 
    726                 reporter.log('Setting user-defined audio controller type to %d' % (self.enmAudioControllerType));
    727                 oSession.setupAudio(self.enmAudioControllerType,
     721                    enmAudioControllerType = oOsType.recommendedAudioController;
     722                else:
     723                    if self.sAudioControllerType == 'HDA':
     724                        enmAudioControllerType = vboxcon.AudioControllerType_HDA;
     725                    elif self.sAudioControllerType == 'AC97':
     726                        enmAudioControllerType = vboxcon.AudioControllerType_AC97;
     727                    elif self.sAudioControllerType == 'SB16':
     728                        enmAudioControllerType = vboxcon.AudioControllerType_SB16;
     729                    assert enmAudioControllerType is not None;
     730
     731                reporter.log('Setting user-defined audio controller type to %d' % (enmAudioControllerType));
     732                oSession.setupAudio(enmAudioControllerType,
    728733                                    fEnable = True, fEnableIn = True, fEnableOut = True);
    729734
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