eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
861 stars 784 forks source link

PaperUI prevents Windows from sleeping. #2444

Closed DavidR1953 closed 7 years ago

DavidR1953 commented 7 years ago

Using Chrome, Windows7 for PaperUI access to a Raspberry Pi build #577 PaperUI opens an audio stream, and my Windows settings allow this to prevent sleeping, which I guess many other people have. Windows shows this:

C:\Windows\system32>powercfg -requests
DISPLAY:
None.

SYSTEM:
[DRIVER] High Definition Audio Device (HDAUDIO\FUNC_01&VEN_10EC&DEV_0889&SUBSYS_104383C0&REV_1000\4&108e67b5&0&0001)
An audio stream is currently in use.

AWAYMODE:
None.

Closing PaperUI causes the [DRIVER] entry to go away, and Windows will subsequently sleep.

kaikreuzer commented 7 years ago

@aounhaider1 Could you please have a look?

kaikreuzer commented 7 years ago

@ghys Does HABPanel have a similar issue?

ghys commented 7 years ago

@kaikreuzer not the current master branch which doesn't include the patch (https://github.com/openhab/org.openhab.ui.habpanel/pull/56, equivalent to https://github.com/eclipse/smarthome/pull/2344) adding IE/Safari support. I also tried after merging it and it would appear so. My wild guess is, it's caused by the <bgsound> element.

ghys commented 7 years ago

Fixed it for HABPanel like this: https://github.com/openhab/org.openhab.ui.habpanel/pull/56/commits/35fa2df054a1aec3afbe7c206aede28617c4d0aa Basically create everything dynamically and closes the AudioContext when playback ends (or an error occurred). The latter is probably the most important.