[wdmaudiodev] Re: DirectKS not working properly on XP with an USB device

  • From: Maciej Cieślak <m.cieslak@xxxxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Fri, 25 Jun 2010 19:26:50 +0200

2010/6/25 Tim Roberts <timr@xxxxxxxxx>:
> Maciej Cieślak wrote:
>> I am developing an application that plays audio on an USB device using
>> Kernel Streaming. This program is designed to work with one specific
>> device.
>> When I am using the DirectKS sample (slightly modified to pick the
>> right device) on Vista or 7, everything works properly. However, on XP
>> I experience some serious problems: the packets are returned not in
>> order and irregularly.
>>
>
> We can't diagnose this with the information you have provided.  A big
> part depends on how you have coded the application.  Buffers are always
> completed in order, but once they get to your application, anything can
> happen, especially with a multithreaded app on a multicore processor.
>

This is a standard DirectKS sample compiled with VS2010 (I have also
checked VS2008).

On Vista/7 after I set the pin state to KSSTATE_RUN the it gives me output:

  0.115:       Pin state is KSSTATE_STOP
  2.695:       Setting Pin to KSSTATE_RUN ...
  2.698:       Packet 0 is available...  Submitting packet 0
  2.700:       Packet 1 is available...  Submitting packet 1
  2.702:       Packet 2 is available...  Submitting packet 2
  2.704:       Packet 3 is available...  Submitting packet 3
  2.955:       Packet 0 is available...  Submitting packet 0
  3.205:       Packet 1 is available...  Submitting packet 1
  3.455:       Packet 2 is available...  Submitting packet 2
  3.705:       Packet 3 is available...  Submitting packet 3

etc. and I hear the sine wave.

The same sample on Windows XP outputs this when setting the pin state
to KSSTATE_RUN:

 0.079:        Pin state is KSSTATE_STOP
  2.500:       Setting Pin to KSSTATE_RUN ...
  2.532:       Packet 0 is available...  Submitting packet 0
  2.532:       Packet 1 is available...  Submitting packet 1
  2.532:       Packet 2 is available...  Submitting packet 2
  2.547:       Packet 3 is available...  Submitting packet 3

When I press KSSTATE_RUN again, I get:

3.594:  Packet 0 is available...  Submitting packet 0
  3.656:       Packet 1 is available...  Submitting packet 1
  3.656:       Packet 2 is available...  Submitting packet 2
  3.656:       Packet 3 is available...  Submitting packet 3
  3.703:       Packet 0 is available...  Submitting packet 0
  3.797:       Packet 1 is available...  Submitting packet 1
  4.063:       Packet 0 is available...  Submitting packet 0
  4.063:       Packet 2 is available...  Submitting packet 2
  4.063:       Packet 3 is available...  Submitting packet 3
  4.453:       Packet 1 is available...  Submitting packet 1
  4.719:       Packet 2 is available...  Submitting packet 2
  4.844:       Packet 0 is available...  Submitting packet 0

so the packet events are not called in order (0, 1, 2, 3) and the
sound I hear is not constant, the sine wave is interrupted many times.
******************

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: