SageTV Community

SageTV Community (http://forums.sagetv.com/forums/index.php)
-   SageTV v7 Customizations (http://forums.sagetv.com/forums/forumdisplay.php?f=47)
-   -   Plugin: Sage Recording Extender 4 (SREv4) (http://forums.sagetv.com/forums/showthread.php?t=57364)

wayner 11-08-2015 05:49 PM

NBA recordings don't seem to be monitored for me right now. Is that a known issue?

Slugger 11-08-2015 07:34 PM

The web service is monitoring NBA games and I see evidence in the logs there that SRE clients are connecting and receiving status info. Your sre log file will tell you if games are properly being monitored, but on the whole, it appears as though NBA is working fine.

wayner 11-08-2015 07:45 PM

Everything looked good until a few days ago - the last properly monitored event appears to be the Leafs game on 11/4.

As today's Raptors game started at 1800 there was this entry:
Code:

2015-11-08 18:00:04,842 WARN : Failed to dispatch event for: RecordingStarted to method createMonitor in class com.google.code.sagetvaddons.sre.plugin.SrePlugin
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at sagex.plugin.AbstractPlugin.invoke(AbstractPlugin.java:267)
        at sagex.plugin.AbstractPlugin.sageEvent(AbstractPlugin.java:205)
        at sage.plugin.b.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Timer already cancelled.
        at java.util.Timer.sched(Unknown Source)
        at java.util.Timer.scheduleAtFixedRate(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrap.invoke(PojoMetaMethodSite.java:210)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
        at com.google.code.sagetvaddons.sre.plugin.ServerPlugin.createMonitor(ServerPlugin.groovy:85)
        at com.google.code.sagetvaddons.sre.plugin.IPlugin$createMonitor.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
        at com.google.code.sagetvaddons.sre.plugin.SrePlugin.createMonitor(SrePlugin.groovy:121)
        ... 8 more
2015-11-08 18:00:04,847 WARN : Failed to handled SageEvent: 'RecordingStarted' in class: com.google.code.sagetvaddons.sre.plugin.SrePlugin

And there aren't log entries for last night's Leafs game either - I got the same error as above when that game started.

Slugger 11-08-2015 08:22 PM

Hmm... looks like the task timer was prematurely cancelled by the main plugin thread. Nothing will monitor until you restart the plugin.** Quick glance at the code shows only one spot where the task timer is ever cancelled, and that's when the plugin is stopped. So maybe there was a Sage shutdown that was aborted or failed or something that put the plugin in this state? Definitely weird, but anyways, that's the problem.

** Restarting the plugin should kill all the plugin threads and restart them. Not 100% sure as I can't remember the full Plugin interface. I see a stop() and start() method defined in the plugin; if a restart calls stop then start then that should work. If a restart calls a restart() method in the plugin then I never defined that and restarting definitely won't help. You can try a plugin restart and see what happens. If it doesn't work, you'll need to restart Sage. Either way, nothing's going to monitor until you get the plugin threads to reinitialize one way or the other.

wayner 11-08-2015 09:45 PM

Ok, I disabled and then re-enabled SRE in the Sage UI. I started recording tonight's NFL game and it is being monitored. I also started recording an NBA game and it was also monitored.

All of my future NBA games are still showing the red exclamation mark and "SRE Status: Monitor status is invalid." on the web UI. Does this status take a while to be updated?

edit - In terms of why this happened - I regularly get "Java Heap has exceeded error level" errors which are likely caused by too many extenders running. Perhaps that caused something to abort. But I haven't seen this issue before and these errors happen all the time.

Slugger 11-08-2015 09:49 PM

That status is checked only once a day, so within 24 hours or when the game starts, whichever comes first, the status will update itself.

Slugger 11-08-2015 09:59 PM

Quote:

Originally Posted by wayner (Post 580189)
edit - In terms of why this happened - I regularly get "Java Heap has exceeded error level" errors which are likely caused by too many extenders running. Perhaps that caused something to abort. But I haven't seen this issue before and these errors happen all the time.

Once this happens in a JVM, all bets are off. A lack of heap could cause problems creating new timer task objects, launching threads, etc. All things SRE needs to do. What does the JVM do when a timer can't invoke a new thread? Cancel itself would be my guess, which could explain the scenario, too. But at least restarting the plugin gets you back and running. I've never seen the issue myself so though I'd call it a bug in my code (should better handle the case where the timer gets unexpectedly cancelled), it's a rare enough occurrence that I wouldn't be too worried about fixing it if I were skiingwiz (the current owner of this plugin in the repo).

skiingwiz 11-10-2015 09:01 PM

Quote:

Originally Posted by Slugger (Post 580191)
Once this happens in a JVM, all bets are off. A lack of heap could cause problems creating new timer task objects, launching threads, etc. All things SRE needs to do. What does the JVM do when a timer can't invoke a new thread? Cancel itself would be my guess, which could explain the scenario, too. But at least restarting the plugin gets you back and running. I've never seen the issue myself so though I'd call it a bug in my code (should better handle the case where the timer gets unexpectedly cancelled), it's a rare enough occurrence that I wouldn't be too worried about fixing it if I were skiingwiz (the current owner of this plugin in the repo).

I noted it so that I don't lose track of it. If I happen to be in that code for something, I'll take a look at beefing-up the error handling.

wayner 11-10-2015 09:33 PM

My NBA game tonight did appear to be monitored, but other games coming up over the next two weeks show the red exclamation mark so maybe the site doesn't have data for the NBA until the game is on the current day. My hockey games all have green check marks.

Slugger 11-11-2015 01:35 PM

No sports, other than NHL and MLB, have future schedules available (only today & maybe tomorrow, but only today for sure; this is a limitation of the source I'm using for most sports). So you'll have the red marks for future games of those sports until game day. And even on game day, depending on the timing, it might stay red until the recording starts, but at the start of the recording it does a check and will find the game data then and start monitoring.

wayner 11-11-2015 01:39 PM

Ok, thanks Slugger - I never noticed that before.

Slugger 11-11-2015 01:45 PM

I used to have access to sources with full future schedules for all sports and so in the past you'd have the green marks for future games. Many web sites are cracking down on scraping -- well making it harder and requiring more time to keep ahead of than I'm willing to put into it. So I've moved to different sources for a lot of these sports. The source is much easier to parse, much less likely to change very often, but the downside is that it only provides "today's" games for those sports. Hence, the red marks for future days. But we still get monitoring and I don't have to fix my monitoring code every week. :)

wayner 11-11-2015 01:47 PM

So there is no access to sports schedule/live scoring type of data in a structured format like XML or JSON? Or is that only available at high cost?

Slugger 11-11-2015 04:11 PM

Some sites make json feeds available, probably unknowingly or unintentionally. These are the easiest to parse. And it's what I'm using for most sports today. The drawback of this feed is it's a "today" only kind of feed.

For MLB I use MLB's own json feed, which has full schedule look ahead. I don't think it's meant for public consumption, but they also haven't stopped people from using it so I continue to do so.

For NHL, I use a semi-private feed for which I have an api key. This is a pure json feed with full schedule look ahead.

There are "official" json feeds with all this data and for way more sports & leagues readily available but the costs are astronomical. The holy grail of such feeds would be Stats Inc. and their fees start in the $30K/month range last time I researched it (quite a few years back now). Other sites exist and the cheapest I could ever find was around $1200/month, but the quality of that data, from what I recall, was sketchy at best and it was still $1200 per month. Even if it were excellent quality data, at $1200 per month that's $1200 more than the amount of revenue the livepvrdata web service generates. :) I always said I'd invest a few bucks a month of my own money for clean, reliable data, but $1200 is way over that limit. :D

mgpaulus 11-11-2015 08:52 PM

So, does this now only work with Sporting Events? I could swear that the first Republican Debate went long and SRE adjusted the recording so I captured all of it. However, last night's debate also went long, but it didn't extend. Not sure if it was the Channel (Fox Business) or the non-sporting aspect, or what....

Slugger 11-12-2015 11:14 AM

Has always been sports only. Not because it has to be sports, but because those are the only monitors I've ever written and because they're easiest to produce. For non-sporting events, you'd have to find a web source that reports, in near real time, that the event is over.

Slugger 01-03-2016 11:45 AM

Web Service EOL
 
Hate to start the new year with bad news, but I figure it's best to give as much warning as possible so here it is.

The web service that backs the SRE plugin will be EOL'd (end of life) as of May 10, 2016. This is when the domain name expires and I will not be renewing it.

I'm completing my second consecutive season of streaming NFL via GamePass and am in the middle of my first season of streaming NHL via GameCentre Live and have no (major) complaints with either and will be moving to MLB.tv in the spring. With the success of streaming my sports, we actually cut the cord with satellite 3 weeks ago and so far haven't missed it (I knew I wouldn't as long as I had access to my sports, the rest of the house has basically become addicted to Netflix/tablet streaming over the last year and had mostly stopped using Sage anyway). Basically I haven't used the SRE plugin since baseball ended and with my move to MLB.tv this spring, I just won't be using it anymore.

Here are the options I see for current users:

First, the domain name is expiring, but the web service will remain online indefinitely. The SRE plugin will just need to be updated to point to the Google Apps URL instead, which is:

http://livepvrdata-hrd.appspot.com

With this simple change, the existing web service will continue to work beyond the domain name expiration. I do not own the SRE plugin in the repo anymore and so I can't make this change. This change can be made immediately.

In theory, the existing monitors I've written will continue to work indefinitely. All existing monitors that are active are based on various json feeds and json feeds tend not to change much, if ever. The only threat to these monitors is that the source sites just cut off access to them altogether. As long as that doesn't happen then modifying SRE to point to the URL above should give users monitors for quite some time going forward.

I can and will continue to enable/disable monitors during offseasons, but if a monitor breaks at this point, I won't be fixing/replacing it. Because of this, I highly recommend someone in the community replace the existing web service with something new that will be maintained going forward.

I would simply shove the source code for the web service on github and hand it over to whomever, but unfortunately that's just not possible. There is code I inherited that I simply can't open source as it's not mine to do so. Instead, a new service would need to be written. If someone decides to take this on, I could then contribute any monitors I've personally written (which would be all current ones in use). I'd even probably be interested in helping with the implementation of a new web service to replace the existing one. If someone's interested in heading down that road, let me know.

Ghildebr 01-03-2016 02:37 PM

Web Service EOL
 
I do use this plugin. When I right click on the "Sage Recording Extender (SRE)" plugin and click on "Configure Plugin", I do not see an option to change this location. I do see if I click on "View Plugin Details", I show to have the web site of "http://sagetv-addons.googlecode.com". How do I make this change?

Slugger, thanks for all you do in this Community.

Slugger 01-03-2016 03:26 PM

Unfortunately, the change needs to be made in the plugin code itself and a new version built and released to the repository. The web service URL was never made a configurable option. (If someone fixes it and does a new release, making the service URL a config option would probably be a good idea as well).

wayner 01-03-2016 03:33 PM

Quote:

Originally Posted by Slugger (Post 582362)
I'm completing my second consecutive season of streaming NFL via GamePass and am in the middle of my first season of streaming NHL via GameCentre Live and have no (major) complaints with either and will be moving to MLB.tv in the spring. With the success of streaming my sports, we actually cut the cord with satellite 3 weeks ago and so far haven't missed it (I knew I wouldn't as long as I had access to my sports, the rest of the house has basically become addicted to Netflix/tablet streaming over the last year and had mostly stopped using Sage anyway). Basically I haven't used the SRE plugin since baseball ended and with my move to MLB.tv this spring, I just won't be using it anymore.

@Slugger - with these streaming services how does it work if you want to watch a game a half hour after it starts? The last time I tried on GCL you were out of luck - you had to watch it live or else wait until about an hour after the game was over to watch it in PVR mode. Is that still the case or can you start watching a game from the beginning at any time, including while it is still taking place. Or does this differ depending on the sport?

p.s. Thanks for all of your plugins as I still use most (all?) on a daily basis including SJQ, SRE, SageAlert, Sage Web, etc.

p.p.s I guess TiVo on the Cogeco box wasn't worth the cash or were there issues with it?


All times are GMT -6. The time now is 04:24 AM.

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