[wdmaudiodev] mme <-> directKS Wrapper DLL

  • From: Uwe Kirst <u.kirst@xxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Wed, 02 Jul 2003 19:31:57 +0200

Hi,
I'm developing a mme to directKS wrapper user mode dll but having some
problems. Maybee anyone can help me.
I made some assumptions how directKS works and I don't know wether these
are correct or not:

-You have to set the state of the pin to KSSTATE_RUN before you can
issue reads or writes otherwise the writes/reads fail.

-You can set the state of the pin to KSSTATE_STOP at anytime after it
has been set to KSSTATE_RUN

-The pins Position-Property returns 0 if the state is set to
KSSTATE_STOP (But the mme expects to get a vaild position != 0 during
pause?)

-You must provide Events to read/write operations to pins, apcs do not
work. I did some experiments with queueUserApc but was not successfull.

-There is no way of knowing from a write operation how many bytes have
actually been played. The documentations says the number of bytes played
is returned in the status->information field, but this seems to be not
true or there is no way of getting this information (GetOverlappedResult
seems to fail if the event is not set)

-If the corresponding event is set, all bytes of a write operation have
been played.



At the moment I'm doing some tests with different mme applications like
Wavelab and Cooledit Pro. As a starting point for the development I took
the directKS Sample application source and a mme.dll source form an old
DDK version.
There are 2 major difficulties:
a) installation.
b) make it compatible with all kinds of mme applications.

a)
After installing and reboot I get the following message box during
startup:
Stop: error loading mmsys.cpl; Invalid access to memory location.
I'm not really sure how the .inf file should look like for this kind of
wrapper, or do I have a problem with the stack space here?

b)
Using Wavelab seems to be no problem (does not use pause), recording
also possible; Cooledit: the "pause" button does not work as expected.
If pause is pressed, the playback does not stop, instead the cursor
jumps to the point, where the playback started. Cursor position and
music do not match any more. I captured some debug output, but really
don't understand it. My major question is why Cooledit sends a
WODM_WRITE-message after it has issued a WODM_PAUSE-message. My wrapper
restarts in that case (by setting the state of the pin to RUN again).
Depending on whatever sometimes the unexpected WODM_WRITE-message is
coming before the outstanding write bufferes are completed, sometimes
after they are completed. In the case shown below, it's coming before
the outstanding write buffers are completed. In both cases the pin-write
is executed after the all outstanding write buffers are completed,
because events assosiated with the completion of a buffers have a higher
priority than new operations (I assume thats the way the original mme
dll worked: apcs have a higher priority than events [using
WaitForSingleObjectEx]).
The pins Position-Property returns 0 if the driver is stopped. That may
explain the jump of the Cursor, but it does not explain why the playback
continues.
I'm also wondering why I get these strange WODM_PREPARE/WODM_UNPREPARE
messages, should be handled by windows? Using Wavelab I don't get them.


Thanks,
Uwe




[684] Wrap_WriteFileEx
[684] MMDRV:
[684] BytesOutstanding = 348160
[684]
..
[684] MMDRV:
[684] WODM_PAUSE
[684]
[684] Wrap_sndSetState 1                //the pin is stopped at this
stage
[684] MMDRV:
[684] waveCompleteBuffers
[684] MMDRV:
[684] waveOvl: pHdr = 415cd40
[684]
[684] Wrap_CompletePacket: 0
[684] MMDRV:
[684] waveCompleteBuffers
[684] MMDRV:
[684] waveOvl: pHdr = 25eed90
[684]
[684] Wrap_CompletePacket: 1
[684] MMDRV:
[684] waveCompleteBuffers
[684]
[684] MMDRV:
[684] blkfin: lpHdr = 25eed90
[684]
[684] MMDRV:
[684] MMDRV:
[684] waveStart
[684] WODM_UNPREPARE
[684]
[684]
[684] MMDRV:
[684] MMDRV:
[684] waveOvl: pHdr = 41556f8
[684] WODM_PREPARE
[684]
[684]
[684] Wrap_CompletePacket: 2
[684] MMDRV:
[684] MMDRV:
[684] WODM_WRITE                  // the write operations has to wait
until all buffers are completed, but why does cooledit issue a write if
it wants to pause?
[684] waveCompleteBuffers
[684]
[684]
[684] MMDRV:
[684] MMDRV:
[684] waveWrite
[684] blkfin: lpHdr = 41556f8
[684]
[684]
[684] MMDRV:
[684] waveStart
[684]
[684] MMDRV:
[684] waveOvl: pHdr = 4155e08
[684]
[684] Wrap_CompletePacket: 3
[684] MMDRV:
[684] waveCompleteBuffers
[684]
[684] MMDRV:
[684] blkfin: lpHdr = 4155e08
[684]
[684] MMDRV:
[684] waveStart
[684]
[684] MMDRV:
[684] waveOvl: pHdr = 25effa8
[684]
[684] Wrap_CompletePacket: 4
[684] MMDRV:
[684] waveCompleteBuffers
[684]
[684] MMDRV:
[684] blkfin: lpHdr = 25effa8
[684]
[684] MMDRV:
[684] waveStart
[684]
[684] MMDRV:
[684] waveOvl: pHdr = 14cc68
[684]
[684] Wrap_CompletePacket: 5
[684] MMDRV:
[684] waveCompleteBuffers
[684]
[684] MMDRV:
[684] blkfin: lpHdr = 14cc68
[684]
[684] MMDRV:
[684] waveStart
[684]
[684] MMDRV:
[684] waveOvl: pHdr = 415cdb0
[684]
[684] Wrap_CompletePacket: 6
[684] MMDRV:
[684] waveCompleteBuffers
[684]
[684] MMDRV:
[684] blkfin: lpHdr = 415cdb0
[684]
[684] MMDRV:
[684] waveStart
[684]
[684] MMDRV:
[684] waveOvl: pHdr = 25efec0
[684]
[684] Wrap_CompletePacket: 7
[684] MMDRV:
[684] waveCompleteBuffers
[684]
[684] MMDRV:
[684] blkfin: lpHdr = 25efec0
[684]
[684] MMDRV:
[684] waveStart
[684]
[684] MMDRV:
[684] waveOvl: pHdr = 415af78
[684]
[684] Wrap_CompletePacket: 8
[684] MMDRV:
[684] waveCompleteBuffers
[684]
[684] MMDRV:
[684] blkfin: lpHdr = 415af78
[684]
[684] MMDRV:
[684] waveStart
[684]
[684] MMDRV:
[684] waveOvl: pHdr = 415ae58
[684]
[684] Wrap_CompletePacket: 9
[684] MMDRV:
[684] waveCompleteBuffers
[684]
[684] MMDRV:
[684] blkfin: lpHdr = 415ae58
[684]
[684] MMDRV:
[684] blkfin: lpHdr = 415cd40
[684]
[684] MMDRV:
[684] waveStart
[684]
[684] Wrap_FlushState: STOP           //all 10 used buffers have been
completed at this stage
[684] MMDRV:
[684] waveStart
[684]
[684] Wrap_WriteFileEx                   //a new write op is passed to
the pin, but why? This causes the pin to start again.


******************

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.de/

Other related posts: