How to prevent a usb device from entering low power state?

Hi
I am trying to create a emulated usb camera, I found that the driver will soon enter low power state,
Which I can not accept UVC command then
So how can I prevent the driver from entering the low power state?
Will WdfDeviceAssignS0IdleSettings works for this purpose?
Thanks in advance

If you do that, you will prevent the whole system from going to sleep. I don’t see how it will help for your emulator driver to call that API; what’s important is usbvideo.sys, and it’s going to follow its rules. You do have a very small amount of control over the power behavior in your USB descriptors, but it’s not enough.

Still, when an app sends a command, that should cause the driver to go back to D0. Are you seeing them get blocked?

I have told you many times that this is not the right way to support a non-USB video device. You will continue to have pain like this.

Well, you can NOT specify an idle timeout in your S0 idle settings.

Or just call WdfStopIdle.

Peter