diff options
author | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2021-06-24 11:43:47 +0000 |
---|---|---|
committer | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2021-06-24 11:43:47 +0000 |
commit | 891b234764b207fd6124500ed04501522c9e5083 (patch) | |
tree | b4574f4c174bad239e3502eb515bcb4018a35d10 /src/VBox/Devices/Audio | |
parent | c515fe6f562c11261e517ec77bce87fbdf87b35b (diff) | |
download | VirtualBox-svn-891b234764b207fd6124500ed04501522c9e5083.tar.gz |
DevIchAc97: Hint 48kHz config to the windows backend. bugref:9890
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@89886 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'src/VBox/Devices/Audio')
-rw-r--r-- | src/VBox/Devices/Audio/DevIchAc97.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/VBox/Devices/Audio/DevIchAc97.cpp b/src/VBox/Devices/Audio/DevIchAc97.cpp index 7904fbd39dc..467fd7c63e7 100644 --- a/src/VBox/Devices/Audio/DevIchAc97.cpp +++ b/src/VBox/Devices/Audio/DevIchAc97.cpp @@ -4165,6 +4165,39 @@ static int ichac97R3AttachInternal(PPDMDEVINS pDevIns, PAC97STATER3 pThisCC, uns if (ppDrv) *ppDrv = pDrv; + + /* + * While we're here, give the windows backends a hint about our typical playback + * configuration. + */ + if ( pDrv->pConnector + && pDrv->pConnector->pfnStreamConfigHint) + { + /* 48kHz */ + PDMAUDIOSTREAMCFG Cfg; + RT_ZERO(Cfg); + Cfg.enmDir = PDMAUDIODIR_OUT; + Cfg.enmPath = PDMAUDIOPATH_OUT_FRONT; + Cfg.Device.cMsSchedulingHint = 5; + Cfg.Backend.cFramesPreBuffering = UINT32_MAX; + PDMAudioPropsInit(&Cfg.Props, 2, true /*fSigned*/, 2, 48000); + RTStrPrintf(Cfg.szName, sizeof(Cfg.szName), "output 48kHz 2ch S16 (HDA config hint)"); + + pDrv->pConnector->pfnStreamConfigHint(pDrv->pConnector, &Cfg); /* (may trash CfgReq) */ +# if 0 + /* 44.1kHz */ + RT_ZERO(Cfg); + Cfg.enmDir = PDMAUDIODIR_OUT; + Cfg.enmPath = PDMAUDIOPATH_OUT_FRONT; + Cfg.Device.cMsSchedulingHint = 10; + Cfg.Backend.cFramesPreBuffering = UINT32_MAX; + PDMAudioPropsInit(&Cfg.Props, 2, true /*fSigned*/, 2, 44100); + RTStrPrintf(Cfg.szName, sizeof(Cfg.szName), "output 44.1kHz 2ch S16 (HDA config hint)"); + + pDrv->pConnector->pfnStreamConfigHint(pDrv->pConnector, &Cfg); /* (may trash CfgReq) */ +# endif + } + LogFunc(("LUN#%u: returns VINF_SUCCESS (pCon=%p)\n", iLun, pDrv->pConnector)); return VINF_SUCCESS; } |