Windows Hibernate/Sleep problem

Hi,

I developed a driver that create a virtual audio device, this driver redirect the output audio stream to the input(virtual device) what was created by my drive, everthing is working well but i?m facing a little problem.

I have an application(user mode) connected to input device (virtual microphone) through WaveApi or through Kernel Streaming, but in both cases the Windows don?t hibernate. This happens because the applicaton is connected to the input all the time.

There is any way to Windows hibernate even if the application still connected to the input?

xxxxx@gmail.com wrote:

I developed a driver that create a virtual audio device, this driver redirect the output audio stream to the input(virtual device) what was created by my drive, everthing is working well but i?m facing a little problem.

I have an application(user mode) connected to input device (virtual microphone) through WaveApi or through Kernel Streaming, but in both cases the Windows don?t hibernate. This happens because the applicaton is connected to the input all the time.

There is any way to Windows hibernate even if the application still connected to the input?

The MSVAD source does not reject any power state change requests.
Unless you have modified it, there’s no reason that the mere presence of
a stream would suppress hibernate. Some streaming drivers include a
registry entry that suppresses power state changes when streaming is
active, but MSVAD does not have that, either.

Are other audio devices involved?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi Tim,

Thanks for your reply.

Well there is no other devices involved, my driver create only two virtual devices, in output and other in the input.

I made some tests with my driver and other drivers like realtek.

If i install my driver on windows and i schedule a hibernate task, the system hibernate with no problem, but if i attach my application(in user mode) to the input device, the windows don?t hibernate. My application attached to the input device with waveInOpen, or Kernel Streaming, or Direct Sound or Direct Show, in all cases the windows don?t hibernate by the fact that my application is connected on the input. There is no need to send a stream to the input for the problem occurs, the mere fact of open the input cause the problem.

The same problem occurs with realtek when my application attach to the realtek microphone.
The same problem occurs with Sound Recorder from Microsoft accessories too.

Did you face a similar problem?
Any ideia how can i solve this problem?

Thanks.

xxxxx@gmail.com wrote:

I made some tests with my driver and other drivers like realtek.

If i install my driver on windows and i schedule a hibernate task, the system hibernate with no problem, but if i attach my application(in user mode) to the input device, the windows don?t hibernate. My application attached to the input device with waveInOpen, or Kernel Streaming, or Direct Sound or Direct Show, in all cases the windows don?t hibernate by the fact that my application is connected on the input. There is no need to send a stream to the input for the problem occurs, the mere fact of open the input cause the problem.

The same problem occurs with realtek when my application attach to the realtek microphone.
The same problem occurs with Sound Recorder from Microsoft accessories too.

Did you face a similar problem?
Any ideia how can i solve this problem?

In the registry, go to
HKEY_LOCAL_MACHINE\
SYSTEM\
CurrentControlSet\
Control\
Class\
{4D36E96C-E325-11CE-BFC1-08002BE10318}

That’s the MEDIA class key. One of the subkeys (probably greater than
0023) will be your device. Add a new binary value to that key. Call it
“OkToHibernate”. Set the value to 01. See if that changes anything.
You’ll have to restart your device, or reboot.

If that works, you can put this in your INF file by adding an AddReg
section:

[MyHardware.NT]

AddReg = Hibernate.AddReg

[Hibernate.AddReg]
HKR,OkToHibernate,3,01

I would have pointed this out earlier, but I thought this applied only
to Windows 98. However, a quick hex edit on stream.sys shows that the
string “OkToHibernate” is still present in XP.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks for your reply Tim.

I?m getting this problem on Windows 7.
I tried to add the binary value in Registry but didn?t work.

I opened the stream.sys file with a hex editor but the string OkToHibernate doesn?t exists .

Thanks.