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 07-05-2017, 05:35 PM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 999
Android Mini-Client UI Freeze

I have a problem where I'm browsing recorded TV on the Android client and it will freeze and not accept any more input. I know this has been mentioned in some other threads and not just by me, but don't think there's a dedicated thread for this.

I have seen this on the following devices: SHIELD TV, Galaxy Tab S, and Galaxy Tab S3. (I know it happens on the LAN, but can't remember if I've had this problem when placeshifting.) I am currently using the stock UI with only a few plugins with Phoenix providing fanart (full list in the attached log file).

Sometimes things just work great and there is no freeze while I'm using it. Other times it will freeze after I've already watched something. I've had it freeze, but I can restart the app, navigate to the same thing and get it to play. And it doesn't just freeze on navigation. I can make it all the way to the "Play" dialog just to have it freeze there. Anyway, I've tried so many things to try and find a root cause that I can't remember what I've done. So, I'm hoping for help systematically narrowing this down and keeping a better record of what's been tried.

Recently I thought that when a transcoding job it might be causing the issue, but for this latest test I restarted the SageTV service, made sure no transcoding, recording or comskip jobs were running or would fire off any time soon, and connected with the SHIELD. I went into Recorded TV and started scrolling down the list until it froze, (which was before I got to the end of the list). I haven't gotten around to figuring out out to pull data off the SHIELD, so don't have the log for that, but attached is the server log as a start.
Attached Files
File Type: zip sagetv_0.zip (138.4 KB, 202 views)
__________________
Home Network: https://karylstein.com/technology.html
Reply With Quote
  #2  
Old 07-06-2017, 04:34 AM
EnterNoEscape's Avatar
EnterNoEscape EnterNoEscape is offline
SageTVaholic
 
Join Date: Jun 2010
Location: Harrisburg, PA
Posts: 2,657
Without knowing what happened on the miniclient side of things, this is difficult to debug, but the appearance is that the miniclient stopped responding for almost a minute before SageTV decided to drop the connection. The question is what happened from the miniclient's perspective and is there anything inbetween that's not helping (firewalls, bad switches)?

Code:
Fri 6/23 16:37:10.316 [BGLoader2-4957424a5845@1a8aa0a] Allocated image-4 for .\userdata\Phoenix\cache\imagetrans\HDx00h\81081ef5b2f6fb87b34718a7dfdd28a2.jpg width=758 height=140 ptr=-66
Fri 6/23 16:37:10.356 [BGLoader2-4957424a5845@1a8aa0a] Allocated image-6 for [MetaImage[.\userdata\Phoenix\cache\imagetrans\HDx00h\81081ef5b2f6fb87b34718a7dfdd28a2.jpg#0 758x140 javaImage=false javaMem=0 jref=0], MetaImage[C:\Program Files (x86)\SageTV\SageTV\STVs\SageTV7\Themes\Standard\MaskReflectionBelow.png#0 64x64 javaImage=false javaMem=0 jref=0#1 758x140 javaImage=false javaMem=0 jref=0], null, false, true, 16777215] width=758 height=140 ptr=1
Fri 6/23 16:37:10.361 [BGLoader2-4957424a5845@1a8aa0a] Loading RawImage of size 758x140 for .\userdata\Phoenix\cache\imagetrans\HDx00h\81081ef5b2f6fb87b34718a7dfdd28a2.jpg fileSize=64148
Fri 6/23 16:37:10.364 [BGLoader2-4957424a5845@1a8aa0a] Loading 0x0 image from file .\userdata\Phoenix\cache\imagetrans\HDx00h\81081ef5b2f6fb87b34718a7dfdd28a2.jpg
Fri 6/23 16:37:11.418 [Fork-OPUS4-112742@14018f] Allocated image-4 for C:\Program Files (x86)\SageTV\SageTV\STVs\SageTV7\VideoArt.png width=380 height=380 ptr=-68
Fri 6/23 16:37:11.431 [BGLoader2-4957424a5845@1a8aa0a] Allocated image-4 for C:\Program Files (x86)\SageTV\SageTV\GeneratedThumbnails\STEINSERVERRecorded TVJeopardy! - S33E195 - 28253725-0mkv.jpg width=512 height=288 ptr=-69
Fri 6/23 16:37:11.452 [ThumbnailGen@14711db] MediaFile creating thumbnail to C:\Program Files (x86)\SageTV\SageTV\GeneratedThumbnails\STEINSERVERRecorded TVThe Late Show With Stephen Colbert - S02E169 - Seth Rogen; Kumail Nanjiani; Paul Shaffer & The World's Most Dangerous Band - 28489145-0mkv.jpg for MediaFile[id=28566707 A[28489145,28489021,"The Late Show with Stephen Colbert",20376@0619.23:35,62,T] mask=TV host=STEINSERVER encodedBy=Hauppauge WinTV-7164 Analog Capture WWJDT format=MATROSKA 1:01:58 384 kbps [#0 Video[H.264 29.97 fps 1920x1080 16:9 progressive]#1 Audio[AC3 48000 Hz 6 channels 384 kbps idx=1 eng]{SeriesInfoID=1906276, ScrapedBy=Phoenix, MediaType=TV, ScrapedDate=1497933421295, MediaProviderDataID=289574, MediaTitle=The Late Show with Stephen Colbert, MediaProviderID=tvdb}] \\STEINSERVER\Recorded TV\The Late Show With Stephen Colbert - S02E169 - Seth Rogen; Kumail Nanjiani; Paul Shaffer & The World's Most Dangerous Band - 28489145-0.mkv, Seg0[Mon 6/19 23:35:00.030-Tue 6/20 0:36:58.940]]
Fri 6/23 16:37:11.480 [EventRouter-4957424a5845@1ec886d] processUserEvent-UserEvent[page_down] evtTime=Fri 6/23 16:37:11.476
Fri 6/23 16:37:11.822 [BGLoader2-4957424a5845@1a8aa0a] Allocated image-4 for C:\Program Files (x86)\SageTV\SageTV\GeneratedThumbnails\STEINSERVERRecorded TVThe Late Show With Stephen Colbert - S02E169 - Seth Rogen; Kumail Nanjiani; Paul Shaffer & The World's Most Dangerous Band - 28489145-0mkv.jpg width=512 height=288 ptr=1429066161
Fri 6/23 16:37:13.379 [EventRouter-4957424a5845@1ec886d] processUserEvent-UserEvent[down] evtTime=Fri 6/23 16:37:13.375
Fri 6/23 16:37:15.028 [ThumbnailGen@14711db] MediaFile creating thumbnail to C:\Program Files (x86)\SageTV\SageTV\GeneratedThumbnails\STEINSERVERRecorded TVThe Tonight Show Starring Jimmy Fallon - S04E160 - Will Ferrell; Alison Brie; Shawn Mendes - 28465640-0mkv.jpg for MediaFile[id=28566706 A[28465640,28465042,"The Tonight Show Starring Jimmy Fallon",20359@0619.23:34,63,T] mask=TV host=STEINSERVER encodedBy=Hauppauge WinTV-7164 Analog Capture #2 WDIVDT format=MATROSKA 1:02:59 384 kbps [#0 Video[H.264 29.97 fps 1920x1080 16:9 progressive]#1 Audio[AC3 48000 Hz 6 channels 384 kbps idx=1 eng]{SeriesInfoID=1721107, MediaType=TV, ScrapedBy=Phoenix, UserRating=81, ScrapedDate=1497933422701, MediaProviderDataID=270261, MediaTitle=The Tonight Show Starring Jimmy Fallon, MediaProviderID=tvdb}] \\STEINSERVER\Recorded TV\The Tonight Show Starring Jimmy Fallon - S04E160 - Will Ferrell; Alison Brie; Shawn Mendes - 28465640-0.mkv, Seg0[Mon 6/19 23:34:00.035-Tue 6/20 0:36:59.235]]
Fri 6/23 16:38:01.058 [Ministry@f88b49] Ministry is waiting for 180 sec
Fri 6/23 16:38:11.886 [BGLoader2-4957424a5845@1a8aa0a] ERROR: MiniUIClient receiver timed out waiting for response from the MiniClient!
Fri 6/23 16:38:11.891 [BGLoader2-4957424a5845@1a8aa0a] MiniUI client error16:java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
Fri 6/23 16:38:11.895 [BGLoader2-4957424a5845@1a8aa0a] java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
Fri 6/23 16:38:11.895 [MCSRReconnect@1ca8adb] MCSR reconnect daemon has started...wait up to 30 seconds for a client reconnect...
Fri 6/23 16:38:11.899 [BGLoader2-4957424a5845@1a8aa0a] java.util.Vector.remove(Unknown Source)
Fri 6/23 16:38:11.902 [BGLoader2-4957424a5845@1a8aa0a] sage.MiniClientSageRenderer$MiniUIClientReceiver.getReply(MiniClientSageRenderer.java:8632)
Fri 6/23 16:38:11.906 [BGLoader2-4957424a5845@1a8aa0a] sage.MiniClientSageRenderer$MiniUIClientReceiver.getIntReply(MiniClientSageRenderer.java:8637)
Fri 6/23 16:38:11.909 [BGLoader2-4957424a5845@1a8aa0a] sage.MiniClientSageRenderer.loadImageCompressedMini(MiniClientSageRenderer.java:6089)
Fri 6/23 16:38:11.913 [BGLoader2-4957424a5845@1a8aa0a] sage.MiniClientSageRenderer.createNativeImage(MiniClientSageRenderer.java:3333)
Fri 6/23 16:38:11.916 [BGLoader2-4957424a5845@1a8aa0a] sage.MetaImage.getNativeImage(MetaImage.java:1876)
Fri 6/23 16:38:11.919 [BGLoader2-4957424a5845@1a8aa0a] sage.MiniClientSageRenderer.preloadImage(MiniClientSageRenderer.java:4052)
Fri 6/23 16:38:11.923 [BGLoader2-4957424a5845@1a8aa0a] sage.BGResourceLoader.run(BGResourceLoader.java:183)
Fri 6/23 16:38:11.926 [BGLoader2-4957424a5845@1a8aa0a] java.lang.Thread.run(Unknown Source)
__________________
SageTV v9 Server: ASRock Z97 Extreme4, Intel i7-4790K @ 4.4Ghz, 32GB RAM, 6x 3TB 7200rpm HD, 2x 5TB 7200rpm HD, 2x 6TB 7200rpm HD, 4x 256GB SSD, 4x 500GB SSD, unRAID Pro 6.7.2 (Dual Parity + SSD Cache).
Capture: 1x Ceton InfiniTV 4 (ClearQAM), 2x Ceton InfiniTV 6, 1x BM1000-HDMI, 1x BM3500-HDMI.

Clients: 1x HD300 (Living Room), 1x HD200 (Master Bedroom).
Software: OpenDCT :: WMC Live TV Tuner :: Schedules Direct EPG
Reply With Quote
  #3  
Old 07-06-2017, 09:38 AM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 999
Mini Client + Server Logs

I figured out how to expose the SHIELD file system on the network, (had to enable Plex, which I had previously disabled), and was able to capture a log. This one took a minute or two to trigger the freeze. I scrolled through the recorded TV listings and folders a bit until I tried to bring up the "Play" menu on one recording which triggered the freeze. Note that it doesn't always happen when bringing up "Play". In the last test I didn't even get through scrolling down the recording listing before a freeze.

Again, I rebooted the server and SHIELD before starting the test.
Attached Files
File Type: zip sagetv_0.zip (180.4 KB, 182 views)
File Type: zip sagetv-miniclient.zip (95.6 KB, 195 views)
__________________
Home Network: https://karylstein.com/technology.html
Reply With Quote
  #4  
Old 07-06-2017, 11:12 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I know of two issues that cause a pause in the UI
1. Server drives goes to sleep, and need to be spun up again
2. Images are very large (ie, background image that is 2048x1920, etc)

The second one happens because the cache sizes for sagetv server and client are fairly small, so when these images load they basically take up all the cache and then evict all other images, causing them to be reloaded from the server, which causes the lag. In the MiniClient there is a memroy cache option, and you should maximize that. Also you can adjust the server cache sizes as well, and they should be made fairly large.

But, you have also found a 3rd reason.
According to your log, the miniclient cannot cache the image from the server because the image filename is too large. I guess android has a filename limit on the # of characters that ca be in the filename. I'm not 100% sure how to fix this, but, now that I know it exists, I'll look at the code and see what I can do to shorten the filenames when they are cached. Because it can't be cached, it has to request it everytime from the server.
Reply With Quote
  #5  
Old 07-06-2017, 11:50 AM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 999
Quote:
Originally Posted by stuckless View Post
I know of two issues that cause a pause in the UI
1. Server drives goes to sleep, and need to be spun up again
2. Images are very large (ie, background image that is 2048x1920, etc)

The second one happens because the cache sizes for sagetv server and client are fairly small, so when these images load they basically take up all the cache and then evict all other images, causing them to be reloaded from the server, which causes the lag. In the MiniClient there is a memroy cache option, and you should maximize that. Also you can adjust the server cache sizes as well, and they should be made fairly large.

But, you have also found a 3rd reason.
According to your log, the miniclient cannot cache the image from the server because the image filename is too large. I guess android has a filename limit on the # of characters that ca be in the filename. I'm not 100% sure how to fix this, but, now that I know it exists, I'll look at the code and see what I can do to shorten the filenames when they are cached. Because it can't be cached, it has to request it everytime from the server.
OK, I see that. So if I delete the various late show recordings (with the really long names) and turn off the favorite for now do you think (barring any other issues) that the UI won't freeze?

It looks like I maxed out the cache on the devices already during one of my debugging sessions. I didn't know you could do it on the server as well, so will look into that.

One thing I've found scrolling through lists to cause a freeze is how much stuff no one (as far as I know) watches that is being recorded. I mean, who needs 534 episodes of the Simpsons?! I guess usually I'm just looking for a certain thing and somehow don't notice all the stuff people have put in there to record over the years. Might as well do some late spring cleaning as well .
__________________
Home Network: https://karylstein.com/technology.html
Reply With Quote
  #6  
Old 07-06-2017, 12:38 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by KarylFStein View Post
OK, I see that. So if I delete the various late show recordings (with the really long names) and turn off the favorite for now do you think (barring any other issues) that the UI won't freeze?

It looks like I maxed out the cache on the devices already during one of my debugging sessions. I didn't know you could do it on the server as well, so will look into that.

One thing I've found scrolling through lists to cause a freeze is how much stuff no one (as far as I know) watches that is being recorded. I mean, who needs 534 episodes of the Simpsons?! I guess usually I'm just looking for a certain thing and somehow don't notice all the stuff people have put in there to record over the years. Might as well do some late spring cleaning as well .
Yeah, I think if you get rid of those recordings, then you'll be OK, especially if you have maxed out the cache on the miniclient side.

I'm not sure of the exact property for the server image caching... I do know that I changed mine some time ago because I was getting freezes related to the sizes of my fanart files.
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
Android TV Mini-client observations panteragstk SageTV Clients Development 29 10-29-2017 04:07 PM
Android Mini Client Transcoding KarylFStein SageTV Clients Development 16 08-26-2017 09:57 PM
Android mini client screen draw issues Gustovier SageTV Clients Development 6 10-25-2016 02:33 PM
Mini-Client vs Full Client vs HD300 NetworkGuy SageTV Clients Development 5 09-12-2016 06:11 PM
[Android Mini Client] Integrate with Android TV 'Live Channels' dinki SageTV Clients Development 11 01-31-2016 09:43 AM


All times are GMT -6. The time now is 12:54 PM.


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