2012-05-17, 13:51
Ok, so, i've made the following changes in AESinkWasapi.cpp in the EnumerateDevicesEx function.
Code change 1 :
Code change 2 :
And tadaaaa !!!
Now that there is no more inconsistancy on the datas, receiver answer as expected.
The was one crucial information wich has not been given enough weigth, and because of that we insist on the wrong path : The fact that in Windows audio property informations were correct. It should have been a lighthouse telling that it can't be wrong EDID informations, otherwise Windows would have never been able to get the correct ones.
You have the full log here.
Can you commit (after testing on your side there is no regression) a patch of the Change code 2 for this fix ?
The test with Change Code 1 well, is half a faillure...
No idea why nothing has been logged...
Code change 1 :
Code:
/* Test format AAC */
wfxex.SubFormat = KSDATAFORMAT_SUBTYPE_IEC61937_AAC;
hr = pClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE, &wfxex.Format, NULL);
if (SUCCEEDED(hr))
{
deviceInfo.m_dataFormats.push_back(AEDataFormat(AE_FMT_AAC));
CLog::Log(LOGDEBUG,__FUNCTION__": AAC is supported by device.");
}
else CLog::Log(LOGDEBUG,__FUNCTION__": AAC is not supported by device.");
Code change 2 :
Code:
/* Test format for channels iteration */
wfxex.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX);
wfxex.dwChannelMask = AE_CH_FL | AE_CH_FR;
wfxex.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
wfxex.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
wfxex.Format.nSamplesPerSec = 48000;
wfxex.Format.wBitsPerSample = 16;
wfxex.Samples.wValidBitsPerSample = 16;
wfxex.Format.nChannels = 2;
wfxex.Format.nBlockAlign = wfxex.Format.nChannels * (wfxex.Format.wBitsPerSample >> 3);
wfxex.Format.nAvgBytesPerSec = wfxex.Format.nSamplesPerSec * wfxex.Format.nBlockAlign;
//bool mpcmFlagged = false;
for (int k = AE_CH_LAYOUT_MAX; k > 0; k--)
{
DWORD mask = 0;
for (int c = 0; c < k; c++)
{
if (uiChannelMask & WASAPIChannelOrder[c])
mask |= WASAPIChannelOrder[c];
}
wfxex.dwChannelMask = mask;
wfxex.Format.nChannels = k;
wfxex.Format.nBlockAlign = wfxex.Format.nChannels * (wfxex.Format.wBitsPerSample >> 3);
wfxex.Format.nAvgBytesPerSec = wfxex.Format.nSamplesPerSec * wfxex.Format.nBlockAlign;
hr = pClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE, &wfxex.Format, NULL);
And tadaaaa !!!
Code:
12:59:24 T:2096 NOTICE: Enumerated WASAPI devices:
12:59:24 T:2096 NOTICE: Device 1
12:59:24 T:2096 NOTICE: m_deviceName : {40182C1F-23F5-4D64-B27E-0E47E44F71A0}
12:59:24 T:2096 NOTICE: m_displayName : HDMI - HD Audio HDMI out (VIA High Definition Audio)
12:59:24 T:2096 NOTICE: m_displayNameExtra: WASAPI: HD Audio HDMI out (VIA High Definition Audio)
12:59:24 T:2096 NOTICE: m_deviceType : AE_DEVTYPE_HDMI
12:59:24 T:2096 NOTICE: m_channels : FL,FR
12:59:24 T:2096 NOTICE: m_sampleRates : 48000,44100
12:59:24 T:2096 NOTICE: m_dataFormats : AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_S16BE
12:59:24 T:2096 NOTICE: Device 2
12:59:24 T:2096 NOTICE: m_deviceName : {6B6599F3-DF3D-4D08-8EC4-6A327023F29F}
12:59:24 T:2096 NOTICE: m_displayName : SPDIF - SPDIF Interface (TX1) (VIA High Definition Audio)
12:59:24 T:2096 NOTICE: m_displayNameExtra: WASAPI: SPDIF Interface (TX1) (VIA High Definition Audio)
12:59:24 T:2096 NOTICE: m_deviceType : AE_DEVTYPE_IEC958
12:59:24 T:2096 NOTICE: m_channels : FL,FR
12:59:24 T:2096 NOTICE: m_sampleRates : 96000,48000,44100
12:59:24 T:2096 NOTICE: m_dataFormats : AE_FMT_DTS,AE_FMT_AC3,AE_FMT_S24NE4,AE_FMT_S24LE4,AE_FMT_S24BE4,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_S16BE
12:59:24 T:2096 NOTICE: Device 3
12:59:24 T:2096 NOTICE: m_deviceName : {7F59FF03-AE3F-4C2C-A164-FBBF33EAB278}
12:59:24 T:2096 NOTICE: m_displayName : HDMI - VSX-921-1 (NVIDIA High Definition Audio)
12:59:24 T:2096 NOTICE: m_displayNameExtra: WASAPI: VSX-921-1 (NVIDIA High Definition Audio)
12:59:24 T:2096 NOTICE: m_deviceType : AE_DEVTYPE_HDMI
12:59:24 T:2096 NOTICE: m_channels : FL,FR,FC,LFE,BL,BR,SL,SR
12:59:24 T:2096 NOTICE: m_sampleRates : 192000,96000,48000,44100
12:59:24 T:2096 NOTICE: m_dataFormats : AE_FMT_DTSHD,AE_FMT_TRUEHD,AE_FMT_EAC3,AE_FMT_DTS,AE_FMT_AC3,AE_FMT_S24NE4,AE_FMT_S24LE4,AE_FMT_S24BE4,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_S16BE
12:59:24 T:2096 NOTICE: Device 4
12:59:24 T:2096 NOTICE: m_deviceName : {DB751CB1-4460-4CA3-B146-D5AC24E8A80B}
12:59:24 T:2096 NOTICE: m_displayName : Speakers - Haut-parleurs (VIA High Definition Audio)
12:59:24 T:2096 NOTICE: m_displayNameExtra: WASAPI: Haut-parleurs (VIA High Definition Audio)
12:59:24 T:2096 NOTICE: m_deviceType : AE_DEVTYPE_PCM
12:59:24 T:2096 NOTICE: m_channels : FL,FR
12:59:24 T:2096 NOTICE: m_sampleRates : 192000,96000,48000,44100
12:59:24 T:2096 NOTICE: m_dataFormats : AE_FMT_S24NE4,AE_FMT_S24LE4,AE_FMT_S24BE4,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_S16BE
12:59:24 T:2096 NOTICE: Enumerated DirectSound devices:
12:59:24 T:2096 NOTICE: Device 1
The was one crucial information wich has not been given enough weigth, and because of that we insist on the wrong path : The fact that in Windows audio property informations were correct. It should have been a lighthouse telling that it can't be wrong EDID informations, otherwise Windows would have never been able to get the correct ones.
You have the full log here.
Can you commit (after testing on your side there is no regression) a patch of the Change code 2 for this fix ?
The test with Change Code 1 well, is half a faillure...
No idea why nothing has been logged...