RT KS Audio problem

I used the RT KS API to implement a service to bridge audio from a mic to a speaker, which works generally well, except for occasional clicks which might be due to some other user mode activity so I thought to try the same code in the kernel and put together an NT4 style driver which does the same; opens the RT devices, creates pins, gets a buffer, sets an event, and gets the position register.

There is one rather odd problem though, absoloutely no sound out.

Dumping the mic data on both the service and the driver produces similar looking data (from a sine wave generator) so the data is coming in. Both mic and speaker events get triggered, the position sensor looks reasonable (the event is set to trigger twice in the buffer) so the position sensor is roughly start of buffer and mid point when the event triggers.

I tried variations on ZwCreateFile and KsCreatePin functions, synchronous, pass through no alert, etc, nothing helped.

Has anyone any experience of RT KS? It is a bit obscure, and documentation almost non existent, so there isn’t much out there to go on.

Thanks in advance

The difference is the device enumeration between user mode and kernel. In user mode the physical devices are enumerated in order, in the kernel the device types are enumerated in order.

As always, no sooner than you have asked the question, the answer becomes apparent! :slight_smile: