Hey guys,
I am using the DVBViewer Recording Service (later referred to as RS) as PVR backend to KODI under Windows. I investigated a bit on the suspend (later referred to as Sleep) behavior when both are running on the same PC.
The RS prevents Sleep on Windows by setting the ES_AWAYMODE_REQUIRED flag as soon as a streaming (UPnP) client is connected. This means that whenever you use Live TV inside KODI on the same PC, Sleep is always prevented unless you manually execute a Stop (playback) before.
The way I think KODI works is that it waits for the PBT_APMSUSPEND event and stops all playback there. In this way you equally handle an externally triggered Sleep. This is too late for Live TV though. In fact you shouldn't even get this event with the ES_AWAYMODE_REQUIRED flag being set by the RS.
I would suggest to execute another Stop when the user triggers Suspend from within KODI right before the PC is put to the Sleep state. When a user tries to trigger Suspend from within KODI, he sure does not want to consume any media any longer, even if another program prevents Sleep (maybe due to a pending recording) and you never receive the PBT_APMSUSPEND event.
Or do you think that the RS should not prevent Sleep when a streaming client is connected? What if remote network clients are connected? You usually don't want the RS PC to go to sleep then. Or should local and remote clients be handled differently within the RS?
I would love to hear your opinions.
I am using the DVBViewer Recording Service (later referred to as RS) as PVR backend to KODI under Windows. I investigated a bit on the suspend (later referred to as Sleep) behavior when both are running on the same PC.
The RS prevents Sleep on Windows by setting the ES_AWAYMODE_REQUIRED flag as soon as a streaming (UPnP) client is connected. This means that whenever you use Live TV inside KODI on the same PC, Sleep is always prevented unless you manually execute a Stop (playback) before.
The way I think KODI works is that it waits for the PBT_APMSUSPEND event and stops all playback there. In this way you equally handle an externally triggered Sleep. This is too late for Live TV though. In fact you shouldn't even get this event with the ES_AWAYMODE_REQUIRED flag being set by the RS.
I would suggest to execute another Stop when the user triggers Suspend from within KODI right before the PC is put to the Sleep state. When a user tries to trigger Suspend from within KODI, he sure does not want to consume any media any longer, even if another program prevents Sleep (maybe due to a pending recording) and you never receive the PBT_APMSUSPEND event.
Or do you think that the RS should not prevent Sleep when a streaming client is connected? What if remote network clients are connected? You usually don't want the RS PC to go to sleep then. Or should local and remote clients be handled differently within the RS?
I would love to hear your opinions.