VirtualBox

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


Ignore:
Timestamp:
Apr 23, 2021 11:53:54 AM (4 years ago)
Author:
vboxsync
Message:

Audio: Use HostAudioWas on windows 10 instead of DSound. Only set the StreamName CFGM value for host audio drivers who needs it (PulseAudio and now WAS). Renamed StreamName to VmName. Added VmUuid to WAS. bugref:9890

File:
1 edited

Legend:

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

    r88653 r88672  
    31353135                    break;
    31363136#ifdef RT_OS_WINDOWS
    3137 # ifdef VBOX_WITH_WINMM
     3137#ifdef VBOX_WITH_WINMM
    31383138                case AudioDriverType_WinMM:
    31393139#  error "Port WinMM audio backend!" /** @todo Still needed? */
     
    31413141# endif
    31423142                case AudioDriverType_DirectSound:
     3143                    /* Use the windows audio session (WAS) API rather than Direct Sound on windows
     3144                       versions we've tested it on (currently W10+).  Since Vista, Direct Sound has
     3145                       been emulated on top of WAS according to the docs, so better use WAS directly. */
    31433146                    pszAudioDriver = "DSoundAudio";
     3147                    if (RTSystemGetNtVersion() >= RTSYSTEM_MAKE_NT_VERSION(10,0,0))
     3148                        pszAudioDriver = "HostAudioWas";
    31443149                    break;
    31453150#endif /* RT_OS_WINDOWS */
     
    37283733    PCFGMNODE pLunL1;
    37293734    InsertConfigNode(pLUN, "AttachedDriver", &pLunL1);
     3735    InsertConfigString(pLunL1, "Driver", pszDrvName);
    37303736    InsertConfigNode(pLunL1, "Config", &pCfg);
    3731     Bstr bstrTmp;
    3732     hrc = pMachine->COMGETTER(Name)(bstrTmp.asOutParam());                                  H();
    3733     InsertConfigString(pCfg, "StreamName", bstrTmp);
    3734     InsertConfigString(pLunL1, "Driver", pszDrvName);
     3737
     3738#ifdef RT_OS_WINDOWS
     3739    if (strcmp(pszDrvName, "HostAudioWas") == 0)
     3740    {
     3741        Bstr bstrTmp;
     3742        hrc = pMachine->COMGETTER(Id)(bstrTmp.asOutParam());                                    H();
     3743        InsertConfigString(pCfg, "VmUuid", bstrTmp);
     3744    }
     3745#endif
     3746
     3747#if defined(RT_OS_WINDOWS) || defined(RT_OS_LINUX)
     3748    if (   strcmp(pszDrvName, "HostAudioWas") == 0
     3749        || strcmp(pszDrvName, "PulseAudio") == 0)
     3750    {
     3751        Bstr bstrTmp;
     3752        hrc = pMachine->COMGETTER(Name)(bstrTmp.asOutParam());                                  H();
     3753        InsertConfigString(pCfg, "VmName", bstrTmp);
     3754    }
     3755#endif
    37353756
    37363757    LogFlowFunc(("szDrivName=%s\n", pszDrvName));
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