[wdmaudiodev] - Problem with CopyFrom() - I copied less audio data than my expected.

  • From: Jun Jiang <jun.jiang77@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Thu, 5 May 2011 20:19:48 +0800

Hi All,

# current problem:
I met a problem when I made my microphone driver based on MSVAD sample.
CopyFrom() copied less audio data than my expected after Notify() was called
in my virtual ISR handler sometimes. In my driver it should copy 1920 x 2
byte data every time.

Here only the audio format, 48K 16bit 2-channel, is supported in my driver.
The HW triggered interrupt every 20ms and each time 1920 X 2 byte (for left
and right channel) audio data were ready in DMA buffer.
In my virtual ISR handler, call Notify() to let PortClass to copy data.
CopyFrom() were called for serveral times to copy totally 1920 x 2 byte
audio data for each interrupt.
Sometimes(low frequency), CopyFrom() only copied partable data. For example,
only 1344 bytes were copied. 2496 byte should be copied, too. But they were
not copied actually.

What is reason to cause CopyFrom() copying less data?
Could somebody show me suggestions on it?
This problem causes me mad now. [?]

# simple description of my microphone driver:
I use WaveCyclic in my microphone driver.
There is virtual ISR handler in my microphone driver because there is a bus
driver to handle HW interrupt actually.
Bus driver will notify microphone driver when HW interrupt is coming.



Best Regards,
Audleyswood

GIF image

Other related posts: