Very funny. That's the plan. :doh:
I'm happy you are in James.
_ _ _ _
Very funny. That's the plan. :doh:
I see no reason why it shouldn't work in our 5870s. You gonna give me your Xonar? I need a new frisbee.
Come on James :bang:
I see no reason why it shouldn't work in our 5870s.
vladd (whurlston above) got his TrueHD light to show up but with the Realtek drivers. Do they work on the 5000 series?
Then you could focus on bitstreaming and leave the rendering work to James.
[4020] CMpcAudioRenderer::InitAudioClient
[4020]
[4020] WAVEFORMATEXTENSIBLE :
[4020] subFormat : {00000000-0000-0000-0000-000000000000}
[4020]
[4020]
[4020] wSamplesPerBlock : 0
[4020] Valid bits per sample : 0
[4020]
[4020]
[4020] WAVEFORMATEX :
[4020] wFormatTag :
[4020] PCM
[4020]
[4020]
[4020] cbSize : 22
[4020] nAvgBytesPerSec : 176400
[4020] Channels : 2
[4020] Bits per sample : 16
[4020] Samples per second : 44100
[4020] nBlockAlign : 4
[4020]
[4020] CMpcAudioRenderer::InitAudioClient format supported
[4020] CMpcAudioRenderer::InitAudioClient [COLOR="Red"][B]failed (80070057)[/B][/COLOR]
I have seen "format supported" but InitAudioClient failed, but the error code was different, not E_INVALIDARG, which is strange. Other formats work with the same code? Buffer size too small/large? Don't trust most of the Wasapi functions like GetDevicePeriod() or others which "suggest" something for you. Never trust anyone, especially hardware manufacturers writing drivers. Or Microsoft.Hi again, I really don't understand why wasapi fails on this one
It says that the format is supported but then it says E_INVALIDARG for the initialization
Code:[4020] CMpcAudioRenderer::InitAudioClient [4020] [4020] WAVEFORMATEXTENSIBLE : [4020] subFormat : {00000000-0000-0000-0000-000000000000} [4020] [4020] [4020] wSamplesPerBlock : 0 [4020] Valid bits per sample : 0 [4020] [4020] [4020] WAVEFORMATEX : [4020] wFormatTag : [4020] PCM [4020] [4020] [4020] cbSize : 22 [4020] nAvgBytesPerSec : 176400 [4020] Channels : 2 [4020] Bits per sample : 16 [4020] Samples per second : 44100 [4020] nBlockAlign : 4 [4020] [4020] CMpcAudioRenderer::InitAudioClient format supported [4020] CMpcAudioRenderer::InitAudioClient [COLOR="Red"][B]failed (80070057)[/B][/COLOR]
// Sleep for half the buffer duration.
hnsActualDuration=(double)10000000 * numFramesAvailable / m_pWaveFileFormat->nSamplesPerSec;
Sleep((DWORD)(hnsActualDuration/10000/2));
DWORD type = 0x0001;
short subDataType = 0; // TODO : 0 for all these formats (but different for AAC and WMA Pro)
short errorFlag = 0;
short datatypeInfo = 0;
short bitstreamNumber = 0;
switch (codecId)
{
case CODEC_ID_SPDIF_AC3:type=1;length=2048;break;
case CODEC_ID_BITSTREAM_TRUEHD:type=22;length=15360;break;
case CODEC_ID_BITSTREAM_EAC3:type=21;length=6144;break;
...
}
DWORD Pc=type | (subDataType << 5) | (errorFlag << 7) | (datatypeInfo << 8) | (bitstreamNumber << 13);
// TODO : insert pause between data bursts for audio/video syncs according to each format recommandations
memset(pDataOut + 16 + size, 0, length -16 - size);
WORD *pDataOutW=(WORD*)pDataOut;
pDataOutW[0] = pDataOutW[1] = pDataOutW[2] = pDataOutW[3] = 0;
pDataOutW[4]=0xf872;
pDataOutW[5]=0x4e1f;
pDataOutW[6]=Pc;
pDataOutW[7]=WORD(size*8);
_swab((char*)buf,(char*)&pDataOutW[8],(int)(size & ~1));
if (size & 1) // _swab doesn't like odd number.
{
pDataOut[16 + size] = ((BYTE*)buf)[size - 1];
pDataOut[15 + size] = 0;
}
pInputBufferPointer=&pMediaBuffer[0];
UINT frameSize = m_pWaveFileFormat->nChannels *
m_pWaveFileFormat->wBitsPerSample / 8;
// Each loop fills one of the two buffers.
while (flags != AUDCLNT_BUFFERFLAGS_SILENT)
{
UINT32 numFramesPadding;
pAudioClient->GetCurrentPadding(&numFramesPadding);
UINT32 numFramesAvailable = bufferFrameCount - numFramesPadding;
// If remaining input bytes < output size of buffer, reduce the size to write
if (&pMediaBuffer[0]+lSize-pInputBufferPointer < numFramesAvailable*frameSize)
{
numFramesAvailable = (&pMediaBuffer[0]+lSize-pInputBufferPointer)/frameSize;
}
// Grab the next empty buffer from the audio device.
hr = pRenderClient->GetBuffer(numFramesAvailable, &pData);
if (FAILED (hr)) return hr;
// Load the buffer with data from the audio source.
if (pData != NULL)
{
memcpy(&pData[0], pInputBufferPointer, numFramesAvailable*frameSize);
pInputBufferPointer += numFramesAvailable*frameSize;
}
hr = pRenderClient->ReleaseBuffer(numFramesAvailable, flags);
if (FAILED (hr)) return hr;
// Sleep for half the buffer duration.
hnsActualDuration=(double)10000000 * numFramesAvailable / m_pWaveFileFormat->nSamplesPerSec;
Sleep((DWORD)(hnsActualDuration/10000/2));
if (pInputBufferPointer >= &pMediaBuffer[0] + lSize)
break;
}
I have some experience on sending TrueHD, DTSHD, EAC3 bitstream to the receiver. (It works here.) I want to provide some help on this.
Did you swap the bytes of the MAT/MLP file?