Page 1 of 6

Serviio WinHelper (Sleep Management and Tools for Windows)

PostPosted: Thu Aug 08, 2013 1:10 am
by DenyAll
Serviio WinHelper
Updated to version 1.0.9 - 7 February 2016


I have developed a Windows App (32 bit) using Visual C# as an outcome of this topic: viewtopic.php?f=3&t=1947, based on a methodology developed by user, J.M. While I developed this app for my own use it is available below for anyone that would like to use it. The app requires .NET Framework 4.0 or later be installed on your PC.

The original purpose of Serviio WinHelper was to stop the PC going to sleep while you're watching a movie. Over time, Serviio Winhelper evolved to include some "quick access" tools and windows specific enhancements as described below. Serviio WinHelper is designed to run in your system tray (and left running in the background).

Sleep Management
  • WinHelper will query the Serviio Server using the Serviio Configuration API for a list of active renderers. WinHelper will then monitor TCP streaming sessions to these devices by:
    • Periodically scanning for active TCP sessions on both:
      - port 8895 between Serviio and the listed renderers; and
      - port 23424 between Serviio and any IP address (on your network or remote access from the internet).
    • The interval between scans can be set on the Sleep tab, between 1 to 30 minutes - this interval must be less than your Windows sleep timer setting otherwise this helper won't do much :roll:
    • If an active TCP Serviio session is found, WinHelper will put the PC into an "Away" sleep mode - when system sleep is requested the screen will sleep but the CPU remains available for streaming. Also if you manually put your system to sleep while in this mode it will remain in an active state (useful for HTPC's - manually putting your system to "sleep" will instead remain in Away mode).
    • If no active TCP Serviio sessions are found, WinHelper will wait a minimum of ten minutes before reverting back to normal sleep mode (ie. to whatever you have set up in Windows).
  • Disabled devices and the PC Serviio is installed on are not included in the list of renderers monitored by WinHelper.
  • Other PC's (detected as Window Media Player) are not included in the list of renderers monitored by WinHelper by default, however this can be changed in the Settings tab.
  • Devices may be excluded by double-clicking on the device name in the Sleep tab in WinHelper.
Tools
  • Remux and Media Information. Use the ffmpeg program included with your Serviio installation to perform some basic information collection and remuxing functions - see viewtopic.php?f=17&t=12136&p=80505#p80505 for details.
  • Stop or Start the Windows Serviio Service. This is not the same as stopping/starting the server in Serviio Console - this stops or starts the windows service. This process requires UAC elevation (administrator privileges) when starting the service and as such you will be prompted to allow the "changes to your computer".
  • Edit profiles.xlm. If you have Notepad++ installed (recommended) you will have the option to use this as an editor (otherwise the only option is Notepad).
  • View the Serviio log.
  • Enables setting detailed logging mode on/off. Note that these settings will not be saved until you restart the Windows Serviio Service. Also note that Serviio WinHelper will test the current logging mode when started but will not do so while running (ie. if you externally change the logging mode this will not be recognised by WinHelper unless you restart it);
  • Allows you to automatically delete (reset) the Serviio Log file on next restart;
System Tray Access to Quick Tools (Right click the Serviio Winhelper System Tray Icon)
  • Provide quick access to the Serviio Console, Serviio Mediabrowser (Pro Users only), Serviio Web page and the Serviio User Forum.
  • Allows you to edit Profiles.xml and view the Serviio Log file.
  • Provides a list of all established IPV4 TCP sessions to external devices (similar to the NETSTAT command), for info and debugging (from the context menu only).
  • Allows you to stop and start the Windows Serviio Service.
User Settings
  • Set the prefered Text Editor - either Notepad or Notepad++, if installed on your system, is supported.
  • Control whether to use Serviio Device Status as a second level check when determining Sleep mode. This is enabled by default.
  • Control whether Windows Media Player devices (other PC's) are ignored when determining Sleep mode. This is enabled by default as these devices often produce "false positives".
  • Allow Serviio WinHelper to automatic start with windows (at user login). Required for the sleep management feature of Serviio WinHelper.
  • Erase all user settings from the registry. Use this to Uninstall the Serviio WinHelper (make sure it’s the last thing you do before closing otherwise settings may be added back to the registry). There is no uninstall program - simply erase settings from the registry and stop using it.
A Note on Active Connections
The connection status in Serviio WinHelper is not the same as the connected status in Serviio Console. The connection status in Serviio WinHelper shows whether an active TCP session on ports 8895 and 23424 (which Serviio uses for streaming) has been detected. Unfortunately this method is not foolproof - you may occasionally see active connections even when not streaming. This is because TCP sessions do not always terminate when you turn your TV/renderer off or otherwise cease streaming. This is not catastrophic - it just means your system won't go to sleep until after Windows cleans up the "false positive" TCP sessions. This is rare in my testing, but likely depends on your renderers and how they shut down sessions.

To minimise these false positives it is recommended that you disable all devices (in Serviio Console, right click on the device and un-select "Device Allowed") that you don't actively stream media to (usually other PC's). Note that by design the app will not monitor connections from Serviio to software running on the same PC (eg. VLC or MediaBrowser on the same PC).



Hopefully this app helps you. I have tested on Windows 7 32 bit, and other users have confirmed its operation on Windows 7 64 bit and Windows 8. Please let me know your experiences (particularly with other Windows versions) and any issues you may have (no promises but I'll do my best 8-)).

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Fri Aug 09, 2013 11:40 am
by Xmantium
DenyAll - Thanks for handy little tool!!
This has alot potential!!

Im running on Windows 8 Pro 32bit, can you add bottom taskbar access please.

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Fri Aug 09, 2013 1:57 pm
by DenyAll
Thanks Xmantium,
As I haven't been able to test on a Win8 PC can you confirm that it appears in your system tray in Win8 (so that we're on the same page for terminology - the bottom right, in the area that normally houses the clock etc). I made it close to the system tray as this is normally where "background apps" go, and have designed this to be "always on" in the background?

I've had a look at how other apps in the system tray behave and I think I understand your rationale - it's to make it behave like most other apps - I presume you are suggesting it is to also appear in the task bar (once again for common terminology: the bar across the bottom normally showing running apps or apps that you pin there) when in the not "closed to the system tray" state ie. on screen?

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Fri Aug 09, 2013 6:09 pm
by Xmantium
Yes it does appear in system tray, but the icon is the standard Visual Icon. A "Close to system tray" option will be useful.

Was thinking the other day someone should create a third party apps for noobs to access these type of settings.

I got great ideas to expand this further :idea:
I think it should be completely noob proof

1. Rather than user opening and editing the log4j.xml file to change to debug mode. Just a simple checkbox for debug mode and WinHelper does this automatically.
2. One of the first think i do when i install Serviio is change the profiles.xml to HD thumbnails, this can be another tickbox to enable it.
3. Would be very cool if WinHelper can consume the profiles.xml and user can view it like a simple table and even edit it
4. Creating new device profiles if 3. is complete
5. WinHelper has its own log viewer specific for Serviio that is simple to read the warn and info logs

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Sun Aug 11, 2013 2:18 am
by DenyAll
Thanks Xmantium for all the suggestions.
I have made an update (Version 1.0.1) in the OP to incorporate your suggestion of putting the on the task bar when not in hidden mode.

Yes it does appear in system tray, but the icon is the standard Visual Icon. A "Close to system tray" option will be useful.
In the system tray in Windows 7 you get these icons:
System Tray Icon 1.jpg
System Tray Icon 1.jpg (19.93 KiB) Viewed 30052 times

which changes when the sleep mode changes (to Serviio Sleep mode):
System Tray Icon 2.jpg
System Tray Icon 2.jpg (1.26 KiB) Viewed 30052 times

Is this not what you get in Win8?

A "Close to system tray" option will be useful.
The "X" close button (top right) and the "OK" button both close to system tray".

1. Rather than user opening and editing the log4j.xml file to change to debug mode. Just a simple checkbox for debug mode and WinHelper does this automatically.
Great minds.... this was what I was originally thinking, but [as I am teaching myself C#] I put it on the back burner and just provided the edit function for now. Have to work out how writing to xml files works in C# but yes, this is where I want to go as well.

2. One of the first think i do when i install Serviio is change the profiles.xml to HD thumbnails, this can be another tickbox to enable it.
Not sure about this one. Has to be added/removed for each profile, and afaik has only been confirmed as supported on the Xbox (which device do you use it with). This may confuse noobs when they activate it and nothing seems to change

3. Would be very cool if WinHelper can consume the profiles.xml and user can view it like a simple table and even edit it
4. Creating new device profiles if 3. is complete
Another tool I have been thinking of is a "Profile Builder". Basically user selects which profiles are supported natively, and the builder creates a custom profile to transcode everything else. It should also read read profiles.xml and populate these fields as well. Every time I think through this though I get a headache :-) as evn transcoding profiles are rarely as simple as this (h264 levels for example). It will be a massive undertaking, not just to achieve this part but then to incorporate subtitles, mime-type changes, detection, online transcoding, etc that the average profile includes.

5. WinHelper has its own log viewer specific for Serviio that is simple to read the warn and info logs
I was thinks of something along the lines of reading the log file in real time, and displaying on-screen warnings (and a small log) of what we define as "critical" warnings.

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Sun Aug 11, 2013 7:00 am
by Xmantium
Thanks for the update! Wish something like this was available for linux servers as that the main one running Serviio 24/7! Sleep mode is no issues with linux but pain viewing logs etc

Program icons works great now, sorry i thought it was using the standard icon.

Regarding 1. - Theres a few different ways of editing the logs that i didnt know of when i read this - viewtopic.php?f=3&t=1796

Regarding 2. - I just prefer knowing HD thumbnails is enabled. Im sure PS3 uses HD thumbnails or higher res thumbs, not tested it yet, need to dust it off and test it.
My thumbs on my Bravia TV looks alot cleaner.

Regarding 3./.4 - Would love love love!! this to be included, maybe make this project open souce on git, this way others can help and incorporate ideas

Regarding .5 - Realtime logs viewer would be great. Great tool for plugin devs. Would be cool if there was seperate tabs, one for info, one for warns etc
when i look at logs i try skip past all the Info

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Fri Aug 23, 2013 12:23 pm
by DenyAll
Version 1.0.2 released - added to OP.

Changes to this version:
  • Tools and Settings now on two different tabs.
  • New tool to set Serviio Detailed Logging (debug) mode on/off. Note that :
    • Changes to Detailed Logging mode will not be saved until you restart the Windows Serviio Service.
    • Manual changes to the logging mode (outside of WinHelper) may not be reflected in the tool. Serviio WinHelper will test the current logging mode when started but will not do so while running (ie. if you externally change the logging mode this will not be recognised by WinHelper unless you restart it)
  • Removed the button to edit the log4j.xlm file (no longer required as the Detailed Logging mode addresses this for 99% of users).
  • Better handle case where Serviio Service is running, but is in the initialisation state.

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Thu Aug 29, 2013 7:45 am
by Illico
Wow...I did not notice that tool !!!
"quick access" tools are very useful !

Thanks


Question: on settings tab, how can I change the editor to Notepad++, only Notepad appears on list, but Notepad++ was installed (Windows7), I will try on my home Windows8 tonight...

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Thu Aug 29, 2013 9:07 am
by DenyAll
Thanks. On startup, it looks for Notepad++.exe in the %ProgramFiles%\Notepad++\ folder, and if found, adds the option. Where is yours installed (I have a concern that the environment variable ProgramFiles in 64 bit versions may be the wrong one to use - to see your environmental variables type SET from the cmd prompt).

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Thu Aug 29, 2013 12:11 pm
by Illico
DenyAll wrote:Thanks. On startup, it looks for Notepad++.exe in the %ProgramFiles%\Notepad++\ folder, and if found, adds the option. Where is yours installed (I have a concern that the environment variable ProgramFiles in 64 bit versions may be the wrong one to use - to see your environmental variables type SET from the cmd prompt).

On 64 bit, its the "C:\Program Files (x86)\Notepad++" path

%ProgramFiles(x86)%\Notepad++ works, so you can try to scan both environmental variables.

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Mon Sep 02, 2013 5:25 am
by DenyAll
Thanks Illico.

Version 1.0.3 released - added to OP.

Changes to this version:
  • Notepad++ detection on 64bit systems.
  • Support for library.dao debug messages added (refer http://wiki.serviio.org/doku.php?id=debug_filter). There is no option in WinHelper to enable library.dao debug messages - these will be included in a detailed log if either online and local library debugging is enabled.

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Mon Sep 02, 2013 7:11 am
by Illico
DenyAll wrote:Changes to this version:
  • Notepad++ detection on 64bit systems.

OK, works great. Thanks.

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Fri Sep 06, 2013 9:11 pm
by chrismallia
Hi I downloaded your tool but I have windows server 2012 64bit the app opened but it displayed the devices and just said that is established a connection between servio and a rendorer device and it stays that way even with no devices streaming. any help I think it is great someone developed a app to see whats going on I have the pro version so I would really like to see is someone is streaming remotely over the internet

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Sat Sep 07, 2013 12:50 pm
by chrismallia
chrismallia wrote:Hi I downloaded your tool but I have windows server 2012 64bit the app opened but it displayed the devices and just said that is established a connection between servio and a rendorer device and it stays that way even with no devices streaming. any help I think it is great someone developed a app to see whats going on I have the pro version so I would really like to see is someone is streaming remotely over the internet

Hi I restarted windows server 2012 and its now working great nice app thank you something like this should be in the console I do not know why they do not implement this

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Sat Sep 07, 2013 2:09 pm
by Illico
chrismallia wrote:...like this should be in the console I do not know why they do not implement this

Probably because Zip is the only one developer of serviio software, and he manages priorities according to his free time. But your can suggest it !

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Sat Sep 07, 2013 4:26 pm
by Xmantium
I think it's left out on purpose because zip likes to keep the console simple. Gives third party devs a chance to show off their own add ons.
There's a new console resign coming in version 1.4 so there maybe new features there.

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Sat Sep 07, 2013 7:35 pm
by chrismallia
Thanks for your help guys you are all great and very help full I love serviio and people in this forum that are always willimg to discuss and help

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Thu Sep 12, 2013 8:50 pm
by satman777
Hi

Thanks for this great tool. Very usefull for me.

Can you add option to start minimized to system tray?

Option "Start on log in" not working to me on Win8 64bit.

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Fri Sep 13, 2013 12:55 am
by DenyAll
I presume you want this so that you can create your own startup item? if this is the case the option is already there - you can start the app minimised to your system tray by adding the startup switch "/hide" to the end of the command line: eg in your shortcut make your command line something like:
    "C:\Program Files\Serviio WinHelper.exe" /hide
Need to understand why the Start on login option isn't working - this option adds a value "ServiioWinHelper" to the registry key:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
and Windows does the rest. Suspect it may be a registry permissions issue that has changed in Win8. Do you get any error messages when trying to set this option? If you are comfortable looking at the Windows registry can you see if that key is created, if not, or you're not sure what I'm talking about, best to leave it and I'll find another way to find out. Thanks.

Re: Serviio WinHelper (Sleep Management and Tools for Window

PostPosted: Sun Sep 15, 2013 5:38 pm
by satman777
There was a problem with permission to file location.
Now all works fine.
Thanks for helping me out.