[wdmaudiodev] Re: HD Audio WaveCyclic timing problems

  • From: Lex Nahumury <nahumury.l@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Tue, 12 Jan 2010 17:32:59 +0100

Hi Mike,

> Okay. I think PAGE_SIZE should be more than enough for that. In fact you
> need a buffer big enough for at least 2 * 10ms worth of samples. So that the
> codec can be transferring data from one part of the buffer while your DMA
> object is copying in the data to another part.
>
>>>> In SetNotificationFreq() I compute the needed 10msec FramingSize,
>>>>   FramingSize_in_bytes = nBlockAlign * sampleRate * Interval / 1000;
>>>>
> You might be better off using nAvgBytesPerSec here as well. Saves you having
> to adjust things later for different channel counts.

Will do, thanks for the tip!

>>>> I use that FramingSize;
>>>> - to set the current buffersize via SetBufferSize(FramingSize_in_bytes)
>>>> - to program the length of the first (and only) BDL entry
>>>> - and in the call to SetupDmaEngineWithBdl() with LVI = 1
>>>>
> This is calling SetBufferSize in the IDMAChannelObject? You shouldn't do
> that. Windows will set the buffer size itself if necessary. In all my
> testing it always used all of the allocated buffer.

Aha, that was it! Plus I didn't setup the BDL correctly.
Thanks a lot Mike, you just saved my day:)

> That is an weird fifo size. For 16bit samples I'd expect a power of 2 at
> least. In the Intel HDA codecs I used during testing I never got a value
> other than 16.
Hmmm, that's weird indeed but that *is* the fifo size returned by the
call to SetupDmaEngineWithBdl().

Thanks again Mike!

/Lex.
******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.com/

Other related posts: