VirtualBox

Changeset 89281 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
May 25, 2021 5:00:06 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144627
Message:

Audio/ValKit: Made the Validation Kit audio driver selectable in Main (via extra-data); saves a (dummy) LUN when enabled. bugref:10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r89098 r89281  
    30203020
    30213021#ifdef VBOX_WITH_AUDIO_VALIDATIONKIT
    3022             GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/Audio/VaKit/Enabled", &strTmp);
    3023             const bool fVaKitEnabled = strTmp.equalsIgnoreCase("true") || strTmp.equalsIgnoreCase("1");
     3022            GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/Audio/VaKit/Enabled", &strTmp); /* Deprecated; do not use! */
     3023            if (strTmp.isEmpty())
     3024                GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/Audio/ValKit/Enabled", &strTmp);
     3025            const bool fValKitEnabled = strTmp.equalsIgnoreCase("true") || strTmp.equalsIgnoreCase("1");
    30243026#endif
    30253027            /** @todo Implement an audio device class, similar to the audio backend class, to construct the common stuff
     
    31463148             * The audio driver.
    31473149             */
    3148             AudioDriverType_T enmAudioDriver;
    3149             hrc = audioAdapter->COMGETTER(AudioDriver)(&enmAudioDriver);                    H();
    3150             const char *pszAudioDriver;
    3151             switch (enmAudioDriver)
    3152             {
    3153                 case AudioDriverType_Null:
    3154                     pszAudioDriver = "NullAudio";
    3155                     break;
     3150            const char *pszAudioDriver = NULL;
     3151#ifdef VBOX_WITH_AUDIO_VALIDATIONKIT
     3152            if (fValKitEnabled)
     3153            {
     3154                pszAudioDriver = "ValidationKitAudio";
     3155                LogRel(("Audio: ValidationKit driver active\n"));
     3156            }
     3157#endif
     3158            /* If nothing else was selected before, ask the API. */
     3159            if (pszAudioDriver == NULL)
     3160            {
     3161                AudioDriverType_T enmAudioDriver;
     3162                hrc = audioAdapter->COMGETTER(AudioDriver)(&enmAudioDriver);                    H();
     3163                switch (enmAudioDriver)
     3164                {
     3165                    case AudioDriverType_Null:
     3166                        pszAudioDriver = "NullAudio";
     3167                        break;
    31563168#ifdef RT_OS_WINDOWS
    31573169# ifdef VBOX_WITH_WINMM
    3158                 case AudioDriverType_WinMM:
     3170                    case AudioDriverType_WinMM:
    31593171#  error "Port WinMM audio backend!" /** @todo Still needed? */
    3160                     break;
     3172                        break;
    31613173# endif
    3162                 case AudioDriverType_DirectSound:
    3163                     /* Use the windows audio session (WAS) API rather than Direct Sound on windows
    3164                        versions we've tested it on (currently W10+).  Since Vista, Direct Sound has
    3165                        been emulated on top of WAS according to the docs, so better use WAS directly. */
    3166                     pszAudioDriver = "DSoundAudio";
    3167                     if (RTSystemGetNtVersion() >= RTSYSTEM_MAKE_NT_VERSION(10,0,0))
    3168                         pszAudioDriver = "HostAudioWas";
    3169                     break;
     3174                    case AudioDriverType_DirectSound:
     3175                        /* Use the windows audio session (WAS) API rather than Direct Sound on windows
     3176                           versions we've tested it on (currently W10+).  Since Vista, Direct Sound has
     3177                           been emulated on top of WAS according to the docs, so better use WAS directly. */
     3178                        pszAudioDriver = "DSoundAudio";
     3179                        if (RTSystemGetNtVersion() >= RTSYSTEM_MAKE_NT_VERSION(10,0,0))
     3180                            pszAudioDriver = "HostAudioWas";
     3181                        break;
    31703182#endif /* RT_OS_WINDOWS */
    31713183#ifdef RT_OS_SOLARIS
    3172                 case AudioDriverType_SolAudio:
    3173                     /* Should not happen, as the Solaris Audio backend is not around anymore.
    3174                      * Remove this sometime later. */
    3175                     LogRel(("Audio: WARNING: Solaris Audio is deprecated, please switch to OSS!\n"));
    3176                     LogRel(("Audio: Automatically setting host audio backend to OSS\n"));
    3177 
    3178                     /* Manually set backend to OSS for now. */
    3179                     pszAudioDriver = "OSSAudio";
    3180                     break;
     3184                    case AudioDriverType_SolAudio:
     3185                        /* Should not happen, as the Solaris Audio backend is not around anymore.
     3186                         * Remove this sometime later. */
     3187                        LogRel(("Audio: WARNING: Solaris Audio is deprecated, please switch to OSS!\n"));
     3188                        LogRel(("Audio: Automatically setting host audio backend to OSS\n"));
     3189
     3190                        /* Manually set backend to OSS for now. */
     3191                        pszAudioDriver = "OSSAudio";
     3192                        break;
    31813193#endif
    31823194#ifdef VBOX_WITH_AUDIO_OSS
    3183                 case AudioDriverType_OSS:
    3184                     pszAudioDriver = "OSSAudio";
    3185                     break;
     3195                    case AudioDriverType_OSS:
     3196                        pszAudioDriver = "OSSAudio";
     3197                        break;
    31863198#endif
    31873199#ifdef VBOX_WITH_AUDIO_ALSA
    3188                 case AudioDriverType_ALSA:
    3189                     pszAudioDriver = "ALSAAudio";
    3190                     break;
     3200                    case AudioDriverType_ALSA:
     3201                        pszAudioDriver = "ALSAAudio";
     3202                        break;
    31913203#endif
    31923204#ifdef VBOX_WITH_AUDIO_PULSE
    3193                 case AudioDriverType_Pulse:
    3194                     pszAudioDriver = "PulseAudio";
    3195                     break;
     3205                    case AudioDriverType_Pulse:
     3206                        pszAudioDriver = "PulseAudio";
     3207                        break;
    31963208#endif
    31973209#ifdef RT_OS_DARWIN
    3198                 case AudioDriverType_CoreAudio:
    3199                     pszAudioDriver = "CoreAudio";
    3200                     break;
     3210                    case AudioDriverType_CoreAudio:
     3211                        pszAudioDriver = "CoreAudio";
     3212                        break;
    32013213#endif
    3202                 default:
    3203                     pszAudioDriver = "oops";
    3204                     AssertFailedBreak();
     3214                    default:
     3215                        pszAudioDriver = "oops";
     3216                        AssertFailedBreak();
     3217                }
    32053218            }
    32063219
     
    32533266                    LogRel(("Audio: Setting debug logging failed, rc=%Rrc\n", rc));
    32543267            }
    3255 
    3256 #ifdef VBOX_WITH_AUDIO_VALIDATIONKIT
    3257             if (fVaKitEnabled)
    3258             {
    3259                 /*
    3260                  * The ValidationKit backend.
    3261                  */
    3262                 InsertConfigNodeF(pInst, &pLunL0, "LUN#%u", idxAudioLun);
    3263                 i_configAudioDriver(audioAdapter, virtualBox, pMachine, pLunL0, "ValidationKitAudio");
    3264                 idxAudioLun++;
    3265 
    3266                 LogRel(("Audio: ValidationKit driver active\n"));
    3267             }
    3268 #endif /* VBOX_WITH_AUDIO_VALIDATIONKIT */
    32693268        }
    32703269
Note: See TracChangeset for help on using the changeset viewer.

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