INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Server going to sleep during streaming to client PC  (Read 9461 times)

Mikkel

  • Galactic Citizen
  • ****
  • Posts: 321
Server going to sleep during streaming to client PC
« on: November 19, 2013, 08:51:12 am »

Hello everyone,

I have a problem. When I use my office pc (client) to playback music the server goes to sleep after what to me seems like a random number of minutes.

The server is not a 24/7 server but in fact my home theater PC. So the client wakes the server. Unfortunately the server desides to sleep before I'm done using it :).

Have I missed a setting somewhere or is this just how it is?


Best regards,
Mikkel
Logged

sunfire7

  • Citizen of the Universe
  • *****
  • Posts: 550
Re: Server going to sleep during streaming to client PC
« Reply #1 on: November 20, 2013, 10:46:13 am »

Happens to me with JRemote, I would like an option to avoid sleep while streaming.
Logged
Happy licensed MC 15-19 User :)
Mac version early bird
My english is not perfect! My native lang is spanish

rjm

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 2699
Re: Server going to sleep during streaming to client PC
« Reply #2 on: November 20, 2013, 11:51:17 am »

+1

I'd like to set my server to go to sleep after an hour but must manually put it to sleep because of this problem.
Logged

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2661
Re: Server going to sleep during streaming to client PC
« Reply #3 on: November 20, 2013, 11:59:13 am »

Quote
18.0.125 (1/28/2013)
1. Changed: Corrected translation errors in Chinese language file (thanks kelijun).
2. Fixed: Empty directory detection was not working with the last couple builds.
3. Changed: LAV Video decoder is used by Red October for DVD decoding in more cases[ (should be an internal change, but please report any DVD issues, and include the OS you're using).
4. Changed: VideoClock works better with videos that start with an unknown frame rate or change frame rates during playback.
5. NEW: Added Options > Video > Display Settings > Wait after change (use if display changes slowly).
6. Fixed: Image playback and other video hardware accelerated views were not working on some older video hardware.
7. Changed: Renamed 'JRSS v2.0™ surround sound' to 'JRSS™ mixing' so that it's more clear it's used for both upmixing and downmixing.
8. NEW: The computer will not be allowed to sleep while serving media or ripping discs.

Hmmm...
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Server going to sleep during streaming to client PC
« Reply #4 on: November 20, 2013, 12:06:20 pm »

In Control Panel/Power, try changing the setting for Multimedia.  Image attached.
Logged

rjm

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 2699
Re: Server going to sleep during streaming to client PC
« Reply #5 on: November 20, 2013, 12:41:40 pm »

Yes, I have it set to not sleep when sharing Multimedia.

It's been a while since I tested this problem because when first encountered I turned off auto sleep.

I turned auto sleep back on and will monitor.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: Server going to sleep during streaming to client PC
« Reply #6 on: November 20, 2013, 12:44:49 pm »

I'm trying to understand this problem a little better.

If we serve an "important" file (defined as a media file for playback), we prevent sleep while serving.  This distinction is important because there's also a bit of chatter (SSDP discovery, etc.) and serving responses to that should not keep a machine awake.

However, the documentation is not real clear if the system sleep timer is reset when we release our no-sleep lock after serving the file.  In other words, if the system is supposed to sleep in 60 seconds and we serve for 50 seconds, will it sleep in 10 seconds or 60 seconds after we finish?

My guess is that it's using 10 seconds and this is the root of the problem.

If that's the case, the solution is for us to make a central power manager in the program where we can register no-sleep things and define a tail when unregistering them.  I think a reasonable tail would be 20 minutes when serving.  In other words, if a server serves an "important" file, the system should not be allowed to sleep for 20 minutes after that.
Logged
Matt Ashland, JRiver Media Center

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: Server going to sleep during streaming to client PC
« Reply #7 on: November 20, 2013, 12:45:42 pm »

In Control Panel/Power, try changing the setting for Multimedia.  Image attached.

Does that know about multimedia shared with MC?  I always assumed that was a WMP thing, but maybe it monitors outbound ports or something to know when MC is serving media?
Logged
Matt Ashland, JRiver Media Center

rjm

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 2699
Re: Server going to sleep during streaming to client PC
« Reply #8 on: November 20, 2013, 01:24:09 pm »

Does that know about multimedia shared with MC?  I always assumed that was a WMP thing, but maybe it monitors outbound ports or something to know when MC is serving media?
That's what I thought too.

Just started a test with sleep set on server to 15 minutes. Will be back soon with results.
Logged

rjm

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 2699
Re: Server going to sleep during streaming to client PC
« Reply #9 on: November 20, 2013, 01:52:30 pm »

Whoaa, there is some strange stuff going on here...

1) set server to sleep in 15 minutes
2) using JRemote, added several hours of music to playing now and started playing
3) closed JRemote and put iPad to sleep (music keeps playing in background)
4) 15 minutes later server is sleeping, BUT music keeps playing including playing next song(s) in playing now
5) server still sleeping AND JRemote allowed me to add another several hours of songs to playing now and when I selected one of these newly added songs it played

There must be some magic memory buffering going on here. I do not understand.

Double checked server is actually sleeping by visually inspecting flashing power light and by trying to connect with Remote Desktop.

Pretty sure my test results are real but I have trouble believing what I see.
Logged

Mikkel

  • Galactic Citizen
  • ****
  • Posts: 321
Re: Server going to sleep during streaming to client PC
« Reply #10 on: November 21, 2013, 02:51:59 am »

@rjm: Mine does the same. No magic, though. There must be some sort of buffering (perhaps even across multiple files?), so that the server can shut down but the client keep playing until the buffer is empty.


Best regards,
Mikkel
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: Server going to sleep during streaming to client PC
« Reply #11 on: November 21, 2013, 03:00:39 am »

1) set server to sleep in 15 minutes
2) using JRemote, added several hours of music to playing now and started playing
3) closed JRemote and put iPad to sleep (music keeps playing in background)
4) 15 minutes later server is sleeping, BUT music keeps playing including playing next song(s) in playing now
5) server still sleeping AND JRemote allowed me to add another several hours of songs to playing now and when I selected one of these newly added songs it played

There must be some magic memory buffering going on here. I do not understand.
Double checked server is actually sleeping by visually inspecting flashing power light and by trying to connect with Remote Desktop.
Pretty sure my test results are real but I have trouble believing what I see.
Are you sure the system is sleeping and not in Away Mode?
Logged

InflatableMouse

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3978
Re: Server going to sleep during streaming to client PC
« Reply #12 on: November 21, 2013, 04:32:01 am »

Sleep mode has different states. In some states, certain tasks can continue to run like streaming media.

See here.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: Server going to sleep during streaming to client PC
« Reply #13 on: November 21, 2013, 10:01:08 am »

In a coming build:
NEW: Added a centralized system power manager that can better track if and when the system should be allowed to sleep.
Changed: After serving a media file, the computer will not be allowed to sleep for 20 minutes so that a server won't go away while pausing or browsing.

Feedback appreciated once it's available.
Logged
Matt Ashland, JRiver Media Center

rjm

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 2699
Re: Server going to sleep during streaming to client PC
« Reply #14 on: November 21, 2013, 10:42:23 am »

Sleep mode has different states. In some states, certain tasks can continue to run like streaming media.
See here.
Thanks I was aware of these states. I use S3 sleep and S5 soft off. I measured these as 5 watts for S3 and 4 watts for S5. Both wake nicely with a magic packet sent over the lan.

There is one big trick you need to know to wake-on-lan from soft off (shutdown) with Windows 8. In power options, disable "turn on fast startup".

Quote
Posted by: 6233638
Are you sure the system is sleeping and not in Away Mode?
I was not aware of away mode until you mentioned it but I checked my settings and I have it disabled.

Quote
Posted by: Mikkel
@rjm: Mine does the same. No magic, though. There must be some sort of buffering (perhaps even across multiple files?), so that the server can shut down but the client keep playing until the buffer is empty.
Well it must be one heck of a big buffer. Because not only did it buffer many albums not yet displayed in the view, it also buffered the actual mp3 data associated with the albums. I did not do elaborate tests but I know for a fact it buffered more than 200 songs! I'm still having trouble understanding what I see. I can't imagine that 200+ songs were copied to a buffer on my iPad in a heartbeat over Wi-Fi ...
Logged

rjm

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 2699
Re: Server going to sleep during streaming to client PC
« Reply #15 on: November 21, 2013, 11:42:42 am »

Oh, and contrary to what most sources say on the web, it is possible to wake-on-lan with a Wi-Fi adapter. But I was getting occasional spontaneous wakes so I stopped using it. Maybe the router sends a packet once in a while? I don't know.
Logged

Manhole

  • Recent member
  • *
  • Posts: 16
Re: Server going to sleep during streaming to client PC
« Reply #16 on: January 31, 2014, 01:02:02 pm »

Hello All,

I recently set up an HTPC using windows 8.1, serving media off of a NAS.  This HTPC has WoL enabled, and is set to sleep after 15 minutes.  I have similar behavior described here and elsewhere on the forums where if I am streaming from a remote PC client (on lan or wan) it will 1) not wake up the server, and 2) not prevent it from sleeping in 15 minutes if it is awakened.

I know that WoL is working because Gizmo on my android devices wake the device from LAN or WAN, and furthermore if I stream to the Gizmo, it will properly prevent the server from sleeping.

Is there some sort of setting that I need to enable on the pc clients to send magic packets and/or prevent the htpc from sleeping while serving?  The Gizmo seems to work by default...

Thanks in advance.
Logged

Manhole

  • Recent member
  • *
  • Posts: 16
Re: Server going to sleep during streaming to client PC
« Reply #17 on: January 31, 2014, 01:15:01 pm »

I should add: 

1) I'm using MC 19.0.108
2) It's not always lasting all the way until the server sleeps before disconnecting, but it's ALWAYS disconnecting after the buffer runs out after the server sleeps.
Logged

Manhole

  • Recent member
  • *
  • Posts: 16
Re: Server going to sleep during streaming to client PC
« Reply #18 on: February 03, 2014, 03:58:27 pm »

I'd like to commit to using this software, but this is kind of a big deal to me.  I've done quite a few searches and I haven't found a silver bullet response to this, or even a verification that it's a bug with either windows 8.X or jriver.

Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10933
Re: Server going to sleep during streaming to client PC
« Reply #19 on: February 03, 2014, 04:02:41 pm »

Just to clear things up a bit, you stream with another PC which runs MC from your HTPC, and during this the HTPC falls asleep?
That at least sounds like something we should look into.
Logged
~ nevcairiel
~ Author of LAV Filters

Manhole

  • Recent member
  • *
  • Posts: 16
Re: Server going to sleep during streaming to client PC
« Reply #20 on: February 03, 2014, 04:37:20 pm »

There are 4 devices involved (5 if you count the NAS):

  • Windows 8.1 64 bit HTPC (server) at home connected to a NAS (containing the source files)
  • Windows 7 Enterprise remote PC running jriver as a client, streaming over WAN
  • Android Mobile device running Gizmo, streaming over LAN/WAN
  • Windows 7 ProlLocal networked PC running jriver as a client, streaming over LAN

All the PCs are using the free trial Mediacenter 19.0.108

The HTPC stays awake properly/indefinitely while in use if:

  • The HTPC plays files directly to the AV receiver
  • The Android device streams from the HTPC (either wan or lan)

The HTPC disconnects semi randomly or (more likely) gets to the point where the htpc sleeps if:

  • The Local Windows 7 machine streams over LAN from the HTPC
  • The Remote Windows 7 machines streams over WAN from the HTPC
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10933
Re: Server going to sleep during streaming to client PC
« Reply #21 on: February 03, 2014, 04:40:44 pm »

Ok thanks for the details, I'll have a look in the coming days.
Logged
~ nevcairiel
~ Author of LAV Filters

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10933
Re: Server going to sleep during streaming to client PC
« Reply #22 on: February 04, 2014, 04:17:38 am »

It seems everything is in place that should prevent sleeping during file streaming. It functions exactly the same between Gizmo and normal MC streaming, so I'm slightly puzzled.

You can check "Help -> System Info" in the menu, it has a point called "Power", which lists all things that keep your PC awake.
If you're streaming a file, it should say "Serving (disable automatic sleep)". Typically you have a few entries which are already marked as expiring, and one without an expiry date for the current stream.

Is there anything in that list for you?

Note that it would only pick this up if you're actually streaming through MC, while it is also possible to set everything up so that the MC client would stream directly from the NAS, in which case sleep may not be controlled by it.
This would only work if your Server (HTPC) and the clients see the files in the exact same path, and you have in the options  "Media Network -> Client Options -> Play local file if one matches Library Server file is found" active.
Logged
~ nevcairiel
~ Author of LAV Filters

Manhole

  • Recent member
  • *
  • Posts: 16
Re: Server going to sleep during streaming to client PC
« Reply #23 on: February 04, 2014, 10:47:56 am »

I went to system info and I have no section listed for power at all.  System Info lists many sections for CPU, memory, devices, OS, etc etc but nothing at all about power.  This is true if I connect through gizmo, or play locally on the HTPC (the two conditions which keep the htpc awake)

On the PC clients, I do have "play local file if one that matches library server file is found" but I do not have the files stored on the disk of either Client PC.  The PC on LAN however would likely have access to the same file paths as the server, so I will try to see if this setting has any issue.  However that still makes very little sense to me, because if the Client PC is pulling the source file directly from the NAS on network, why would it disconnect/stop playing when the HTPC sleeps?  Either way, I'll test tonight and see how it works out.

Second, I would think that the Remote Client PC would have no such access to the NAS and should not trigger that issue either.   

And lastly, there appears to be a clear difference in the Wake on LAN behavior between PC clients and Gizmo, because neither PC client appears to be able to wake the HTPC from sleep, but the Gizmo can.   Is there an explicit WoL setting I have to enable in the PC clients?
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10933
Re: Server going to sleep during streaming to client PC
« Reply #24 on: February 04, 2014, 10:51:57 am »

Weird, are you sure you're running MC 19.0.108? Using Help -> System Info should open the reporter screen, which has this information.
You can also find it in the tree on the left under Services & Plugins -> Reporter

Please verify the version again to make sure. Power Management was also recently revamped (in 19.0.79), so if you happen to run a much older version I'm not sure how it functioned exactly.
Logged
~ nevcairiel
~ Author of LAV Filters

Manhole

  • Recent member
  • *
  • Posts: 16
Re: Server going to sleep during streaming to client PC
« Reply #25 on: February 04, 2014, 11:15:20 am »

ok I feel like kind of a moron!

So I just double checked the version on my htpc, and it is in fact an older version (19.0.64)  I do not understand how on earth I managed to do that.  The clients are running 19.0.108, and I installed all of these within the last week...  I'm really confused about how I managed to get an old version at all on that htpc.

I'll test the remote pc client later today, but the local appears to WoL now, as well as show up in the power settings, so I am pretty sure everything's fine now.  I apologize for the waste of time, and thanks for looking into it! 
Logged
Pages: [1]   Go Up