[wdmaudiodev] Re: MSVAD simple example plays wav file continuously under debugger

  • From: Tim Roberts <timr@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Mon, 18 Jan 2010 14:04:56 -0800

Jan M wrote:
> Hi Tim,
>> If so, how do you know it's repeating?  Are you spewing any debug
>> information to the debugger?
> Yes. It repeats calls to CSaveData::WriteData() with calls to
> CSaveData::FileWrite() when the buffer is full.
> Under the debugger the output file (normally 41k bytes) grows to
> hundreds of K.
>> If you send a sound to the normal audio output device and then break in
>> the debugger, you will hear the last bufferful repeated forever.  This
>> is just the way sound cards work.  They have to be told to stop playing,
>> and while you're in the debugger, it can't process interrupts to know
>> that playing should stop.  It's quite normal.  As soon as you step or
>> run in the  debugger, it will start handling interrupts again and move
>> on to the next sample.
> MSVAD simply writes audio output to a file. The driver does not send
> anything to a sound card.
> I believe it simulates hardware interrupts with timers.
> The debugger is not stopping at a breakpoint, just outputting trace
> messages:
> ...
> MSVAD: [CSaveData::WriteData ulByteCount=440]
> MSVAD: [CSaveData::WriteData ulByteCount=440]
> MSVAD: [CMiniportWaveCyclicStreamMSVAD::SetState]
> MSVAD: [CSaveData::WriteData ulByteCount=444]
> MSVAD: [CSaveData::WriteData ulByteCount=440]
> .
> . repeated 35 times
> .
> MSVAD: [CSaveData::SaveFrame]
> The CSaveData::WriteData and CSaveData::SaveFrame repeat ad nauseam.

It's probably a timeout issue, as you surmised.  Writing to the debugger
takes a surprisingly long time, and clocks get confused.  It is very
tricky to use debug messages in a real-time path, unless you use
something like DebugView instead of windbg.

Best you can do is reduce or eliminate the debug messages that happen in
the real-time path.

> I can step the driver (MSVAD) - not the free build OS. If you can tell
> me how to step the free build nt module (other than the disassembly,
> i.e. with C/C++ source code) I would be grateful.

You don't EVER get source code for the operating system, even with a
checked build.  You need to know assembler in order to debug drivers.

Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.


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


Other related posts: