SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Clients Development
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Clients Development This forum is for discussions relating to SageTV Open Source Clients Development.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-22-2016, 06:57 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
How to improve MiniClient performance

I discovered something today, which testing on the Mi Box, using Gemstone. Baically some of my views would get really slow... It would be 1-2 seconds (sometimes longer) when moving from item A to item B, etc. It turns out that the Miniclient was having to purge it's cache in order to show a poster, and the poster sizes were coming in at 1920x2800 (approx), and it was taking up 21mb of memory on the server (and on the Miniclient) to just show it.

The MiniClient (until release 1.2.4 - 2016 dec 22), had a 30mb image cache, so when more than 30mb of images are loaded, then things have to be unloaded in order to make room. At 30mb, the miniclient was spending a considerable amount of time just unloading and unloading images. Keep in mind that EVERYTHING in the miniclient is an image (ie, all fonts, rectangles, boxes, etc).

In Release 1.2.4, I added a setting in the configuration to allow you to change the amount of memory you want to allow for the image cache. For example in my shield, I set mine to 192mb. The default was upped from 30mb to 64mb.

This alone should give some UI smoothness, especially if you were experiencing hiccups in the UI (most likely with fanart enabled).

The other optimisation tip, is related to Gemstone... In the Image Utilities you can set the image scaling options. BACKGROUND and POSTER "FULL" is set to 100 (being 100%). The problem is that many of these background images are REALLY LARGE so using 100% means that each image could be using 20-30mb of memory. This adds up quickly.

I basically set mine to 50. You'll need to clear the memory cache and the disk cache, and because I hate sluggishness... I told Gemstone to prescale everything.

Keep in mind these Android boxes has lots of memory... On the shield, the MiniClient reports having 512mb available for the MiniClient app. So, using 192mb isn't that bad. I haven't checked the Mi Box yet, but it likely has the same or a little less. In the MiniClient settings, if you jump to the bottom, you can see what is being reported as max memory.
Reply With Quote
  #2  
Old 12-22-2016, 11:18 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
I thought those settings were a percentage of UI resolution, but I'll be honest I've never checked that to be the case.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #3  
Old 12-23-2016, 01:17 AM
mackb mackb is offline
Sage User
 
Join Date: Oct 2004
Posts: 14
Seems this latest version broke the animation off detection and is blocky. Turning animation back on fixes it. I wouldn't care so much of animations didn't slow the UI down so much.

Thanks,
Mack
Reply With Quote
  #4  
Old 12-23-2016, 04:34 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Fuzzy View Post
I thought those settings were a percentage of UI resolution, but I'll be honest I've never checked that to be the case.
You could be right... but based on the sizes that i'm seeing being sent to the MiniClient for posters... that doesn't appear to be the case... ie, I'm seeing posters that are at least 2x my UI size. Another interesting fact about sagetv... when it loads an image it will load it full size, and the scaling doesn't happen until it reaches the UI, and in the case of the MiniClient it happens ON the miniclient. For example if you have a 1920x2600 but only needs 200x350 on the UI, the UI gets the 1920x2600 image and is told to scale it 200x350. If scaling is happening in the widget, then sagetv is always having to load/process the full size image, and then scale it at the client. I know that Phoenix, using the Image APIs, will handle this per client and create images that scaled and stored, per client, that is exactly the size it needs in the UI, and it avoids the clients having to scale the images, and saves memory on the server, since SageTV is dealing with smaller images.

Quote:
Originally Posted by mackb View Post
Seems this latest version broke the animation off detection and is blocky. Turning animation back on fixes it. I wouldn't care so much of animations didn't slow the UI down so much.

Thanks,
Mack
I'll push out an update today... I was doing some testing around this, and I left it at the incorrect setting... sorry
Reply With Quote
  #5  
Old 12-23-2016, 05:36 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by stuckless View Post
You could be right... but based on the sizes that i'm seeing being sent to the MiniClient for posters... that doesn't appear to be the case... ie, I'm seeing posters that are at least 2x my UI size. Another interesting fact about sagetv... when it loads an image it will load it full size, and the scaling doesn't happen until it reaches the UI, and in the case of the MiniClient it happens ON the miniclient. For example if you have a 1920x2600 but only needs 200x350 on the UI, the UI gets the 1920x2600 image and is told to scale it 200x350. If scaling is happening in the widget, then sagetv is always having to load/process the full size image, and then scale it at the client. I know that Phoenix, using the Image APIs, will handle this per client and create images that scaled and stored, per client, that is exactly the size it needs in the UI, and it avoids the clients having to scale the images, and saves memory on the server, since SageTV is dealing with smaller images.
I'm thinknig it is possible the image widget might be able to be tweaked to do the scaling on the server, which would solve most the problems right there (though would still waste server side heap space).

Regarding the gemstone cache, those are using the phoenix image api's for the cached images, so they should be working well (though if it is indeed scaling the percentage based on original image size instead of UI size, that is sort of strange). I honestly have not even looked at gemstone2 to see how he is dealing with images there - it'd be nice to cache them based on the actual used resolutions for the various flows - this might require a few more versions of an image, if it happens to be used at different sizes in different flows, so it would take up more server side space, but it would be the best compromise of quality vs. performance I'd think.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #6  
Old 12-23-2016, 06:28 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by mackb View Post
Seems this latest version broke the animation off detection and is blocky. Turning animation back on fixes it. I wouldn't care so much of animations didn't slow the UI down so much.

Thanks,
Mack
FYI... new update posted... out of curiosity what is your device? Just wondering why animations are slow (if it's a phone/tablet, then yeah, i can see it).
Reply With Quote
  #7  
Old 12-23-2016, 07:05 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by stuckless View Post
FYI... new update posted... out of curiosity what is your device? Just wondering why animations are slow (if it's a phone/tablet, then yeah, i can see it).
I noticed the problem when using my phone remotely. When placeshifting (remote connection), miniclient forces animations to disabled (there is a property [ui/allow_non_local_animations] to override this behavior).
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #8  
Old 12-23-2016, 08:35 AM
mackb mackb is offline
Sage User
 
Join Date: Oct 2004
Posts: 14
Quote:
Originally Posted by stuckless View Post
FYI... new update posted... out of curiosity what is your device? Just wondering why animations are slow (if it's a phone/tablet, then yeah, i can see it).
Thanks for the update. It is working great. I am using Mi boxes now but animations have always slowed down UI navigation no matter the device. I can't stand them and even turn them off on my Android phones. They have always seemed like useless fluff to me since I prefer immediate reaction times. I always thought the majority of folks felt the same but I obviously must be wrong.

Cheers,
Mack
Reply With Quote
  #9  
Old 01-06-2017, 02:12 PM
DarkWolf77 DarkWolf77 is offline
Sage Advanced User
 
Join Date: Dec 2006
Posts: 169
Quote:
Originally Posted by mackb View Post
Thanks for the update. It is working great. I am using Mi boxes now but animations have always slowed down UI navigation no matter the device. I can't stand them and even turn them off on my Android phones. They have always seemed like useless fluff to me since I prefer immediate reaction times. I always thought the majority of folks felt the same but I obviously must be wrong.

Cheers,
Mack
Interestingly, Android itself actually uses animations like that to mask interface lag. Basically, it's camo to make the interface seem faster when it's actually running slowly. I remember reading up on it way back when Android 4 was released (it's a big part of the "Project butter" they implemented as a methodology to speed up device responsiveness). So a fancy transition is launched while the CPU chugs along in the back to load up the next screen in the background and, hopefully, it's done before or at the same time as the animation finishes.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Software tweaks to help improve My Movies performance on HD-200? mkanet Sage My Movies 8 09-08-2010 10:29 PM
Top Ten Way to Improve Performance randyth General Discussion 11 09-11-2009 09:30 AM
Will my LCD TV Image Improve? joe123 SageTV HD Theater - Media Player 13 03-04-2009 11:49 AM
Seeking Help to Improve Stability PushOneInfinite SageTV Software 9 03-27-2008 06:12 AM
Improve Placeshifter PQ over LAN? zubblwump SageTV Placeshifter 7 11-06-2006 04:21 PM


All times are GMT -6. The time now is 06:00 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.