Showing posts with label media center. Show all posts
Showing posts with label media center. Show all posts

Sunday, January 21, 2018

Plex DVR - Not Quite There Yet

Plex is a media center application that I've had my eye on for some time as an option for live TV recording. It looks great and it's a whole lot less complex than my Kodi/MythTV DVR setup. I tried it out, and it's certainly easy to use, but just doesn't have enough functionality for me.
There are two major strengths to Plex, from my perspective. One: It's really easy to set up. Installation on my Linux box was extremely simple, there's a nice web user interface for configuring the system, and there's an app for my Fire TV. Even detection of my HDHomeRun TV tuner for the DVR functionality was seamless. Two: The interface is beautiful and very simple to use.

Sadly, all that simplicity means that there's a lack of functionality. In no particular order:

  • The program guide is extremely limited. There's no grid-style guide to browse. You can see what's currently on, and search for specific future shows. But if you want to browse to see what's coming up tonight, or tomorrow, or next week, you're out of luck.
  • No option for recording a specific time and channel. This means that if the program guide is wrong for some reason (which happens regularly when there's special programs like live sports or news specials), there's no way to record the program even if you know when it will air.
  • Playback on the Plex Fire TV app is inconsistent. Some shows play fine, others are extremely choppy. I looked at all the settings and did some web searching, but all I could find was something about needing to transcode the video. Which makes no sense considering that the shows are all being recorded by the same Plex TV backend, so they should all be in the same format. No reason that some would need transcoding and others would not.
  • Moving around within a recording is limited. You can skip ahead 30 seconds or back 10 seconds. I've tried hitting the skip ahead multiple times to go 3-4 minutes ahead, but it doesn't always work. There's also a delay on audio after you skip ahead.
  • There's a beta option for commercial skipping, but it doesn't work very well. Worse, it actually cuts the "commercial" that it identifies out of the video file, so if it makes a mistake and cuts some of the actual program, it's gone.

On top of the limited functionality, the DVR functionality requires that you subscribe to Plex Pass. It's $40/year, roughly double what I pay for my current setup. (MythTV and Kodi are free, but I pay for program guide updates.)

So for now, I'm sticking with Kodi and MythTV. It's more complicated to set up (but I've already done that) and has some issues of its own, but it works much better for my needs.

Wednesday, April 19, 2017

Updating to Kodi v17 "Krypton"

It's been a while since Kodi released their most recent major update: version 17 "Krypton". I finally got around to installing it on my Fire TV recently.
I waited a while to install v17 largely because I was pretty happy with the older version. Since I upgraded to v16 a bit over a year ago, I haven't had any significant issues. So there wasn't a lot of reason to change. Also, I wanted to allow plenty of time for the add-ons that I use to be updated for the new version. So when v17 was released in early February, I didn't jump right in. In March, v17.1 was released with some minor fixes and that's what I used for my upgrade.

The actual upgrade process went very smoothly. I downloaded the Android version from the Kodi site and installed it using adbLink. Started it up and was greeted by the new user interface featuring the Estuary skin. It's different, but I didn't have any trouble finding everything that I'm used to using.

Everything carried over fine from the previous version except for Trakt.tv scrobbling of MythTV shows. That's not much of a surprise, since my modifications to the Trakt.tv add-on required some pretty specific data from Kodi and the MythTV PVR add-on. This upgrade changed how that data was presented, and for the most part the changes are for the better. It's much easier now to get information about which TV show is being played (specifically, some of the Kodi InfoLabels are being populated by the MythTV add-on). Updating my code was fairly easy, and I submitted the modifications to the Trakt.tv add-on maintainer so other people will get the same changes. Only took a couple of hours for the whole process.

The only real problem I had after the upgrade has nothing to do with Kodi itself. Around the same time, Amazon also updated the Fire TV user interface. Kodi stopped showing up on the home screen of the Fire TV, which means I had to go through the Settings menu to start it. Back in the day I used an app called Firestarter to get around this, but that's no longer an option. Fortunately, there are solutions for this. I had to try several of the things in that list but eventually I got Kodi back onto the Fire TV home screen.

This latest version of Kodi is working out fine thus far. With luck, I'll have another year before it's time to change again.

Monday, November 21, 2016

Back to Netflix

Netflix is so needy. Leave it alone for a year or so, and it just comes crawling back. "Please, take me back, here's a free month!" Well, who am I to say no to a plea like that?
I tend to cycle through streaming services: a few months of Netflix, then some Crunchyroll, maybe some Amazon Prime Video, a bit of HBO Go. I can't watch enough different shows to make it worth while to have more than one at a time anyway, so why bother paying for more than one? It does mean that I rarely get to watch anything when it's first released, but that doesn't bother me much.

The latest Netflix free month has been an excuse to catch up on various stuff that has come out since the last time I had an active subscription. So far that's been Luke Cage and Jessica Jones, both of which are excellent. I've never actually read any of the Marvel Comics on which the characters are based, but I'm familiar with them from video games like Marvel Heroes. Luke in particular is one of my favorites, and I love what they did with his series. Jessica Jones was actually a bit better in terms of story, I thought, but I still enjoyed Luke Cage just as much.

I had a friend over the other night, and we were talking about old favorite shows, and it turns out that she'd never seen Firefly. Well, that's just wrong, and it happens that Netflix has the whole series online. So we watched the first couple of episodes, and now I can't stop myself from going back through the whole thing. For some odd reason, the Serenity movie isn't available to stream, but when I get there I'll rent it somewhere.

For the most part, my Amazon Fire TV works perfectly with Netflix. The navigation within the app is pretty terrible, but one thing it does well is show the list of shows that you saved to "My List" on the Netflix site. So I just find whatever I'm interested in on my PC and add it to that list. No need to wade through the masses of recommendations or use the terrible search function on the media center.

With the weather finally turning colder and baseball season over, I've got plenty of time and inclination to sit in front of a screen and vegetate. Perfect time to take Netflix back for a while.

Monday, August 29, 2016

Ubuntu Upgrades for MythTV Server

I recently upgraded LittleDell, my Ubuntu Linux box running MythTV, to the 16.04.1 "Xenial Xerus" LTS release.
When I first set up this machine, I used Ubuntu 14.04.5 LTS (server version). The LTS stands for Long Term Support, and is supported for 5 years. Using an LTS version minimizes the need for major upgrades, though it's still important to keep up with minor security patches regularly.

The initial version of 16.04 was released back in April, but I didn't see any need to upgrade right away. Why run the risk of problems? In July, 16.04.1 was released with some minor updates, and shortly thereafter I got a notification that the upgrade was available. I could have skipped this one as well, since 14.04.5 is supported until 2019. But at the same time, one of the hardware drivers used by my machine under 14.04.5 was also going out of support. I figured this was a good time to upgrade and avoid any potential driver issues, as well as getting onto the latest Ubuntu version.

The actual upgrade process is very simple: you log into the machine, and run "sudo do-release-upgrade" at the command prompt. I did it over an SSH connection, though that runs a minor risk since you might lose the connection in case of any problems. The installer is kind enough to set up a backup SSH port just in case, but fortunately I didn't need it. The process took a couple of hours, though most of that was just waiting, so I just left it running while I did other things.

The upgrade made extensive changes: according to the installer, it installed 252 new packages, upgraded 907 more, and removed 32. 695 MB of downloads were required. Most of that consists of behind-the-scenes system changes, of course. Everything it did was logged in /var/log/dist-upgrade, just in case I need to look back at it later.

The installer also told me that 13 packages were no longer supported. I went ahead and did the upgrade, but was curious afterward about those packages. After a bit of searching, I found the list in the installer log (grep "demoted" /var/log/dist-upgrade/main.log), but didn't recognize any of them. Several were related to perl, which I'm not using extensively anyway.

After the upgrade and a reboot, everything started up normally. But of course it couldn't be perfectly smooth - I ran into trouble with MythTV when I tried to access my recorded programs. The upgrade had caused two problems:
  1. The PHP-MySQL interface used by the MythWeb browser interface wasn't installed by the upgrade. Easily solved by "sudo apt-get install php-mysql" and a restart of the Apache server.
  2. MySQL changes from the upgrade caused an error when getting the list of recorded programs from the MythTV backend. I had to do some Google searching to resolve this one, and eventually found a solution. In the /etc/mysql/conf.d/mythtv.cnf file, add the line "sql_mode=NO_ENGINE_SUBSTITUTION", then restart MySQL and MythTV. Apparently that line is needed to force the upgraded MySQL to work more like the older version that MythTV was expecting.
At this point, everything seems to be working normally. Assuming no additional issues crop up, this machine shouldn't need a major upgrade for another few years.

Thursday, August 11, 2016

Playstation Vue

Playstation Vue is another streaming video option for non-cable-subscribers (similar to Sling TV, which I dropped a few months ago). I decided to try it out while the Olympics are on.
I'd not really considered Vue before, largely because I'm not a Playstation owner. (Well, technically I still have a PS2 someplace. But nothing recent.) I barely even knew it existed, to be honest. It showed up when I was searching for Olympics-watching options, though. Since it has a free week trial, I figured it was worth a try.

My first impression is that Vue has all the polish that Sling TV was lacking, back when I was using it. Signing up was very smooth, once I'd created a Sony Playstation Network account. There's an app for the Amazon Fire TV, which I had no trouble installing and found easy to navigate. I was prompted right away to set up DVR functionality for watching live TV. There's a straightforward guide grid to use for browsing what's on various channels. Things that required effort to get working in Sling were no problem in Vue.

I don't know yet how well the service will hold up as far as performance and quality, but the first few days have been great. I assume that usage is pretty heavy for the Olympics, so that bodes well for being able to actually watch big events (rather than looking at connection errors or stuttering video, as happened regularly with Sling).

Vue costs a bit more than Sling did, at $30/month for the basic tier. It includes more channels than the basic Sling tier, though. Most channels that I'd watch are in the list, particularly the sports networks, Cartoon Network, Comedy Central, and Syfy. The only notable exception is the local regional FOX Sports network - it's available for another $15, but I don't think it's worth that much.

I'll likely keep Vue for at least the next six months or so. That covers the rest of the Olympics, baseball playoffs, and the football season. Maybe longer, if I find other things to use it for.

Thursday, June 23, 2016

Kodi Add-On for Trakt.tv Update

I've been updating my customized version of the Kodi add-on for Trakt.tv fairly regularly. Each time the original add-on changes, I have to re-apply my modifications. I finally decided recently that it was time to try to get my changes included in the base add-on.
The first thing I wanted to do was make sure my modifications were completely optional. My updates provide two added features: attempt to scrobble MythTV PVR recordings, and do a Trakt text search by show name if the show can't be found on the first attempt (which was part of my original Crunchyroll integration changes). So I added two new options in the add-on configuration screen, under the Scrobbling section, one for each feature. By default, they'll be disabled. Thus when my additions get pushed out to the general public, nothing will change for anyone unless they specifically enable the new options.
Having tested and committed those changes, I submitted a request to pull my modifications into the base add-on. The maintainer had a few suggestions, which were easy to implement. He also asked me to rebase my changes, which basically means to consolidate all the different updates I've made, so that it looks like a single change from his perspective. That makes sense, so that it's simple to see everything that I'm asking to add in one place.

Unfortunately, this rebase process isn't as simple as it sounds. Git has a rebase command, and I tried to use it against the base add-on branch. But it kept giving me errors that no amount of Google searches explained, so clearly I was doing something wrong. In the end, I finally realized that I was able to simply ignore the error and override it with a forced push to the repository. Generally that's a very bad thing, since you can lose changes that way, but in this case it's what I wanted to do.

Once I got past the learning curve on the rebase command, the rest was fairly simple. The post-rebase changes were broken into two pieces, one for each new feature, and submitted as a pull request. Those features are now part of the main repository, listed as part of the version 3.1.8 update.

It's nice to have these features in the standard distribution for the Kodi add-on for Trakt.tv. I'll still have to make updates to it when something changes in the way Kodi and/or Trakt.tv works, but at least now unrelated changes to the add-on won't require me to re-apply my modifications.

Wednesday, June 1, 2016

A Month (or more) of HBO NOW

I've waited until June, when most of the broadcast TV show seasons are done. Time to see what HBO has done this season.
When I was using Sling TV last year, I subscribed to HBO for a couple of months through Sling. I've since cancelled the Sling service, but fortunately HBO has another option for us non-cable subscribers. HBO NOW is a Internet streaming service that skips the cable company entirely. Turns out that I actually get the first month free since I've not used HBO NOW before, which is a nice bonus.

Strangely, when you go to HBO's main website and click order HBO, there's a description of the HBO NOW streaming service, but no link. Once I did find the link (back on the main page, at the top), there was still no sign-up option, instead directing me to open the app. So I installed the HBO NOW app on my Amazon Fire TV, and signed up there. That process went fairly smoothly, linking the subscription to my Amazon account. Then I had to re-enter my email address, and go back to the website (where I was in the first place) to finish up. Not exactly an efficient process, but it worked.

My primary reason for doing this now is that Game of Thrones is in the middle of its sixth season. I can catch up with the season thus far, and watch the rest of the episodes as they air. There are also plenty of episodes of Last Week Tonight that I haven't watched, which are always amusing even if a bit outdated. And HBO has a bunch of movies that I've vaguely thought looked interesting but never bothered obtaining.

So there's plenty of entertainment for my free month. Like most of my streaming service subscriptions, I expect I'll cancel it after a month or two. But for now, there's plenty to keep me occupied.

Saturday, April 30, 2016

Less Uninterruptible

Woke up this morning to an unfamiliar beeping noise. My first thought was that it must be time to change a fire alarm battery, but those sound a bit different. Turns out it was the UPS behind my computer desk.
That's UPS as in uninterruptible power supply, not brown delivery trucks. I've had this one for years...maybe 8? 10? I don't remember exactly, and I'm too lazy to go look it up. A good long while, anyway. A decent UPS is a long-term device that you don't even notice is there, ideally. At least, until the power goes out. I had this one connected to just about all my media center electronics. The beeping was because the battery had finally given up the ghost and was no longer holding power.

Originally I got this UPS because the power in my condo would flicker on a fairly regular basis. Not every day, but probably once or twice a month. That doesn't sound like much, but if you've got electronics that are always on (particularly computers), that kind of inconsistency can really mess with the system. Fortunately, that problem has gone away as of a few years ago, when the local electric company upgraded the various power delivery systems in my area. I haven't seen a power flicker since, and full outages are rare as well.

The other major reason for having the UPS was that I would occasionally want to access my home system when I was traveling, and for that it needed to always be on. If there was a power outage, everything would turn off, and there was no one at home to turn it back on. With the UPS, as long as the power outage was a fairly short one (under a half hour or so), everything would keep running. Since I rarely do extended travel any more, this isn't really a concern any more either.

The UPS was also a surge protector, again a very important component for sensitive electronics. Especially during the summer, when thunderstorms are in the area. Everything important is plugged into power strips, though, with their own surge protector functions. Short of a direct lightning strike, which would fry anything regardless of surge protection, it should be pretty safe.

So I think I'll just do without a replacement UPS, at least until something changes that makes it necessary to have one again. I'll find a recycling center where I can take the old one - it's got a big, heavy battery so you don't want to just toss it in the garbage - and stick with basic power strips to power and surge protect my various electronic devices.

Tuesday, April 12, 2016

Miscellaneous Media Center Updates

A few minor changes have hit my media center in the last couple of weeks. Herein, a quick round-up.
Amazon released an update to the Fire TV operating system (5.0.5.1) which blocks the Firestarter application. Firestarter just disappeared overnight, with no explanation or warning messages, which was a very unfriendly-to-the-user action. I tried re-installing it, which silently failed, again with nothing to tell me why. Eventually I found an explanation on the Firestarter issues list, but it was a frustrating experience.

I kind of understand why Amazon would want to block Firestarter. It takes over the home screen of the Fire TV, which means I don't see Amazon's ads. Not that I pay attention to them anyway, of course, but I do understand why they'd care. But there's no good excuse for the terrible user experience that I had from this update. At the very least, they could have some kind of pop-up message, or send me an email, explaining what had happened.

That update wasn't all bad news, though. I was using Firestarter as an easy way to launch applications that didn't show up on the Fire TV main screen (mostly Kodi). The Fire TV is now showing those applications in the Recently Used application list. So I can get by without Firestarter, as long as Amazon doesn't change that behavior.

Another minor update applies to the Trakt.tv Kodi add-on. I had recently expanded the episode lookup code that I use with my MythTV DVR recordings. Part of that change involved making an API call to Trakt for every episode of a show, which is terribly inefficient. Thanks to an update by the maintainer of the trakt.py Python API module, I was able to replace that with a single API call to get all episodes at once. It's still not as good as a real search-by-show-and-episode-name function would be, but it's an improvement.

It'll take a little while for that change to work its way through the various levels of code maintenance. The main branch of the trakt.py module needs to be updated, then the script.module.trakt Kodi add-on package, plus my own modified version of the Trakt add-on. Eventually it'll all be in place.

Thursday, March 31, 2016

Another Tweak to the Trakt.tv Add-On for Kodi

My additions to the Trakt.tv add-on for Kodi have been working fairly well, but every once in while it'll still have issues. I decided to tackle one of those issues - the problem of common episode titles.
To quickly recap, the idea here is to watch TV shows that are recorded on my MythTV DVR via Kodi on my Fire TV, and to have Trakt.tv automatically update what I've watched. All the pieces already exist to make this happen, but they don't quite fit together. Specifically, the information that the Trakt.tv add-on requires (show ID, season number, episode number) isn't available from Kodi when I'm watching a MythTV DVR recording. All that Kodi knows is the show name and episode title.

I got around this problem by using the Trakt.tv web API to search for the episode title. It often returns more than one result, so I verify it by matching the result's show name (to the show name that Kodi provides). If they match, I tell Trakt.tv that we've got the right episode. But what if I get back a bunch of results from that search, but none of them match the show name? That's the problem of common episode titles - lots of shows use the same episode titles, and so a simple search for that title won't always get the right result.

An alternative approach to find the right episode is to search first for the show, then go through all the episodes of that show until I find the right one. The Trakt.tv web API is capable of this, but there's no efficient way to do it. You've got to make a whole lot of API calls: use the show name to get the show ID; look up the first episode; if that doesn't match, get the next episode; repeat until you find the right one. Horribly inefficient and slow, which is why I didn't use this method in the first place. But it does work even if the episode title is a very common one, used by dozens of TV shows.

So now the modified Trakt.tv add-on code has both options. It tries the episode title search first. If that works, we're done...no need for anything further. But if it doesn't work, then it tries to look up the show by name. If that's found, then it loops through every episode of that show until finding the right one. This way, the least efficient option is used only if the more efficient choice doesn't work.

Ideally, a future version of Kodi or Trakt.tv will make this whole thing unnecessary. If Kodi and/or the MythTV add-on can provide the season and episode number, then there will be no need to use the episode title at all. Or if the Trakt.tv web API had a method that can search on both show name and episode title, instead of just one or the other, then common episode titles won't be an issue. Until one or the other changes, I'm stuck with the inefficient method...but it does work.

Wednesday, March 23, 2016

Spotify

I own a lot of music that I've accumulated over the years via cassette, CD, and digital download. When Spotify first launched in the US, I wasn't very interested since I wasn't looking for more music. But recently I was looking into some new (to me) artists, and decided to give the streaming service a try.
This started after I went to the Nightwish concert a few weeks ago, and wanted to hear more from Delain (one of the opening acts). I bought a couple of their albums from Google Play Music, liked what I heard, and was considering getting more when I thought of Spotify. Pretty much all of Delain's stuff is available there, so I decided to give it a try.

To begin, I just downloaded the Windows Spotify client without subscribing. You get advertisements after every few songs, but otherwise there's not much difference between the free and subscription version when listening on your PC. I could still access any song that I found, and play other people's playlists.

I also tried out the Android app for my phone, and Fire TV app for my media center. The Fire TV app is pretty bad, honestly, if you try to use it directly. Poor user interface and very limited features. However, you can link it to your phone (or PC) to control what is playing on the Fire TV, which is much easier to use. For the phone, there's the ability to download songs for play while offline, but only if you're a subscriber.

The selection of music is pretty massive on Spotify. Not everything is available - I've run across both missing artists and albums - but there's plenty out there. You can use the "radio" function to get a selection of music similar to a song/artist (similar to something like Pandora), but also play specific songs or entire albums (unlike Pandora). And people can build playlists to share, which is one of my favorite features. I've found several that were built by people with similar musical tastes.

Thanks in large part to those playlists, I've already found a good number of interesting artists that I'd never run across before. I've also found some that I haven't listened to in years (like Die Happy and Devlierance). Used to have all their stuff on cassettes, but never re-acquired it in the digital world. Nice to have it easily accessible again.

Between the offline music feature and the lack of ads, I think the $10/month is worthwhile for a Spotify subscription. For a while, at least. It's nice to have an easy way to discover and enjoy different music, and once you've found it, be able to listen to it on demand.

Friday, March 4, 2016

Another Kodi v16 "Jarvis" Upgrade

A few weeks ago, I updated Kodi on my Fire TV to version 16. At the time, the most recent version was a release candidate build. I've since updated to the release version.
Unlike last time, I did an in-place upgrade. Firestarter makes it easy with a Kodi section on the Updates screen. Just a matter of a few button selections, and a few minutes wait for the download to finish.

Like the last update, I found that my custom version of the Trakt.tv add-on had been overwritten by a newer version of the unmodified add-on. I had to jump through a few extra hoops to get it back up to speed: first GitHub decided not to work on my Windows machine and had to be fixed, then adbFire wouldn't connect to the Fire TV and had to be upgraded. Nothing related to Kodi, though. Once I got through those logistical issues, the updated add-on worked just fine.

I even fixed an extra bug while I was at it. The Trakt add-on had stopped displaying notifications, and it turns out the reason was an added attempt to set a non-existent episode ID in the scrobble code. I'm not sure why that addition was made in the newest version of the add-on, so I didn't want to remove it...maybe it actually works for some use case that I never run into. I put a simple error catching block around it, so it will still attempt the same action, but any errors won't cause further issues. Having done that, the notifications work again.

Mostly good news on the problems that I used to have in version 15. The crashes while watching MythTV recordings have not yet reappeared. Looks like the most recent updates to the MythTV add-on and base Kodi code have corrected those. The problem of Crunchyroll videos slowing down and skipping audio was still present in the release candidate build, but I haven't seen it yet in the final release version. It only happens when I've watched a few episodes in a row, and I can fix it by deleting the Kodi cache from the Fire TV's system menu and restarting. So it's not a major problem, even if it does come back, but with luck it's gone for good.

All things considered, the Jarvis version of Kodi is working out well. Now, if version 17 will just set the MythTV recording infolabels correctly, I'd be a very happy Kodi user.

Monday, February 15, 2016

Kodi and Pirates

Yesterday, the Kodi developers made a post on their blog calling for action against unscrupulous folks using the Kodi name to sell illegal and dangerous media center software. Today, their website is down, presumably from a denial of service attack. Unlikely to be a coincidence! (There's a copy of the blog post in this reddit thread, in case it's still down.)
As you may know if you've read my earlier media center posts, Kodi is a media center application. It's great at playing your various media files, mostly music and videos. Some examples: video files that you have stored locally, stuff on your MythTV server, and streaming services like Pandora or Crunchyroll.

Kodi is open source and copyrighted using the GPL. Basically, this means that anyone can download and use the software, and modify it for their own use. A lot of folks do this all the time, even me in my own small way. Some of those uses aren't entirely legal, mostly by using pirated sources for video streams. In itself, that's not a major issue for Kodi - those people are doing something illegal, but Kodi is just one of the tools that they're using. In the same way that it's not the fault of the car when the driver breaks the speed limit, the Kodi software isn't at fault with people use it to pirate media.

The problem that the Kodi developers have is that some unscrupulous folks are spreading their illegally modified software around, and using the Kodi name to do it. Some of these people sell some kind of cheap hardware with a modified version of Kodi pre-installed, advertising something along the lines of "Kodi lets you watch free TV and movies." Others use Kodi in videos that show people how to install Kodi add-ons that access pirate sites.

This means two things that are bad for Kodi: the customers come complaining to Kodi (not the original seller) when things stop working, and the world views Kodi as a source of pirated media. The former causes a whole lot of wasted time and effort by the Kodi developers. The latter makes it near impossible for Kodi to do legitimate business.

So the Kodi developers are trademarking the Kodi name and logo, and will be going after those using their name without permission by issuing takedown notices and possibly other legal action. People may still be doing the same things with the software, but they'll have to stop using the Kodi name to do it, or face legal consequences.

I support the Kodi developers on this, but I'm not sure how much it's going to help. Protecting the use of their own name makes sense, and I certainly hope they can stop the worst of the abuses. However, the public perception of the media platform as a support for piracy isn't likely to go away. No matter what name is used, the software is still open source and extensible, and people are going to write code that puts it to illegal use.

It might help if Kodi can find a way to push a positive image, as well as attacking the negative image problem. Kodi can be used for legitimate purposes, and there's a lot of potential currently untapped. There aren't Kodi add-ons for many of the most popular media services, and those that exist are unofficial and break often. (Even the Crunchyroll add-on that I use is unofficial, and that's a pretty minor service.) If Kodi had stable, supported connections to useful services that people want to use, I think that would go a long way toward changing perceptions from "Kodi is a pirating platform" to "Kodi is a legitimate media platform."

In any event, I wish the Kodi team the best with their efforts to change public perceptions of their project, and keep control of how their name is used. As well as good luck getting out from under whatever DDOS attack or hack is causing problems on their site.

Friday, January 29, 2016

Upgrading to Kodi v16 "Jarvis"

The Kodi developers just recently released their second release candidate for the next major version: 16, code-name Jarvis. I decided to upgrade my installation today, largely in the hope that it might fix a few annoyances I've noticed in version 15.
Version 15 actually works very well for me most of the time, but there are a few things that I'd like to get rid of. The worst of these is the occasional crash while watching TV recordings from my MythTV server, usually once or twice a week. I can't remember Kodi ever crashing outside of watching a MythTV recording, so I'm pretty sure it's something specific to that particular function. I've also seen some strange video behavior while watching Crunchyroll video streams, where the video will slow down and the audio will skip. That only lasts a few seconds, but it's certainly annoying.

Neither of those are major problems, so I wasn't willing to upgrade to version 16 while it was still in beta. Now that it's progressed to a second release candidate, I think it's likely that it will be stable, and unlikely to introduce new problems. I can't be sure it will fix the old ones, of course - only way to find out is to try. I'm hopeful, though: both the video playback on Android and the Kodi PVR interface have changes in Jarvis.

The basic installation went smoothly enough. I decided to completely wipe out my old Kodi install on my Fire TV and re-install the new version, rather than attempting an upgrade. Adds a few extra steps, such as reconfiguring the MythTV addon, but I think it's worth the hassle to avoid any problems related to old left-over files and settings. Only took about a half hour to download the new version, install it via ADBFire on the Fire TV, and configure the various settings and addons that I use.

Then came the difficult part - getting my custom version of the Trakt.tv addon to work properly with MythTV and Crunchyroll. I actually didn't need to do anything to the Crunchyroll part, as nothing had changed in version 16. But with the MythTV PVR addon, there are changes to way that Kodi provides information on which recording is being played. I spent a couple of hours debugging and modifying my fork of the addon code to adjust. It's still not a great hack, relying too much on the specific MythTV addon formatting and using the Trakt.tv episode text search function. But it works, which is good enough for now.

So now I'm up to date with the latest Kodi version. Over the next few days and weeks, I'll see if the issues I had in version 15 are fixed. With luck, version 16 won't have introduced any new ones!

Sunday, January 17, 2016

Dropping Sling TV

I've subscribed to Sling TV for about a year, since it became available in early 2015. It's been a bumpy ride, with technical problems and customer service issues, but for the most part I'm glad that I had it. Now, though, I've decided that it's not worth the monthly subscription fee to me.
Sling TV is basically like a cable TV subscription without the actual cable. You choose a package of channels for a monthly fee, and you can add other channels for an extra charge. You watch your shows via an app on your computer or phone or other media device. (In my case, a Fire TV.)

When I first subscribed in early 2015, the technical problems with Sling TV were legion. Sometimes I couldn't connect at all. Other times shows would stutter, or stop playing in the middle. The Fire TV app interface was terrible. I stuck it out, though, in large part because the baseball season was coming up and I knew there would be plenty of games on ESPN. By mid-summer, the technical problems were significantly reduced. There are still occasional problems, but now they're the exception, not the rule.

I also had some customer service troubles. I originally signed up with a two-week free trial offer that Sling TV was running through Amazon.com. When I decided to go ahead and subscribe after the trial, I kept getting errors. I had to call customer service several times, and eventually just close the account completely and set up a new one through Sling TV directly (with no Amazon involvement). It was just as difficult to add HBO to my subscription a few months later (at Game of Thrones time, of course). Again, things did improve. By the time I cancelled the HBO portion around the end of June, I was able to do so via the website without major difficulty.

So why am I dropping Sling TV now, if things are better? Mostly because I just don't use it enough to be worth the monthly fee. The only channels I really watch are for sports (EPSN, sometimes TBS). I watch a whole lot of video, as anyone reading this blog already knows, but the vast majority is either over-the-air channels or streaming services. If Sling TV had some other sports content, like FOX Sports (mainly for hockey) or the MLB/NFL/NHL Networks, then I might feel differently.

Another reason for dropping the subscription is the lack of DVR functions for the channels that I watch. There's no recording of shows to watch later, or even short-duration pause/rewind of live TV. Twenty years ago, that would have been fine, but now? That sort of functionality is pretty much the standard these days. I rarely watch any non-sports event live, and I make heavy use of pause/fast-forward/rewind even during live events. Lack of those features lowers the value of Sling TV significantly for me.

I might think about coming back around next fall, when football comes back on, since there's a whole lot of college football that's exclusive to ESPN, as well as Monday Night Football games. But until then, I have other sources for my hockey and baseball sports fix (mainly Internet radio) and nothing else that's worth paying a monthly subscription.

Tuesday, December 22, 2015

Update: Trakt.tv and Kodi add-on

I noticed recently that my hack to the Trakt.tv add-on for Kodi had stopped working. My TV shows were no longer updating on the Trakt.tv site. It didn't take a lot of effort to find out what had happened - I just had to look at the Trakt.tv add-on version number. It had been updated (from 3.0.4 to 3.0.5) and pushed out to the Kodi repository. My copy auto-updated to the new version, which of course means my changes were overwritten.

Fortunately this is a simple fix, made easy since the source is all on GitHub. All I had to do was go to my version of the repository, pull a local copy down to my machine, and then sync it to the master branch. Most of the changes were merged automatically. There was one conflict, where the updates from the master branch had touched the same file as my changes. When that happens, Git kindly puts both versions of the text into the affected file, so it's just a matter of opening it and manually putting the conflict in order.

To confirm that everything was working again, I installed Kodi locally on my Windows machine and tested out the add-on. (This is much easier than trying to debug on my FireTV, since it's a pain to read the debug log and change files on that device.) This was the first time I'd done this since my Windows 10 upgrade, and I'm happy to say it went smoothly. Other than fixing silly mistakes (typos, forgetting to copy a file) there were no problems.

Once I knew the change was done properly, the only thing left was to update the version on my Fire TV. Kodi on the Fire TV doesn't like it when you try to directly overwrite an existing add-on. Sometimes it works, but other times it ignores the changes; or worse, stops working altogether. So I uninstalled the Trakt.tv add-on, shut down Kodi, copied over the new add-on as a ZIP file, then restarted Kodi and installed the add-on again. That makes sure the updates are in place, and indeed everything worked again properly.

The reason that all this is necessary stems from my little hack being unofficial. I did submit it to the maintainer of the Trakt.tv add-on, but he didn't want to include it in the official version, and I don't blame him. The hack is very specific to viewing TV programs through the MythTV PVR add-on, and it's fragile in the sense that any change to how TV show titles are displayed are likely to break it. So for now, I'll just continue to merge updates manually. With luck, some future version of Kodi and/or the add-ons will allow a better solution.

Wednesday, November 4, 2015

Minor Hacking: MythTV, Kodi, Trakt.tv

I previously posted about getting Kodi, the Crunchyroll add-on, and the Trakt.tv add-on to play nicely together. In this post, I'm doing something similar with Kodi, the MythTV PVR add-on, and the Trakt.tv addon.
As I've mentioned before, I use MythTV to record over-the-air broadcast TV. I then use Kodi on my Fire TV to watch the recordings. My goal is to have my MythTV recordings that I watch in Kodi automatically update Trakt.tv.

The same basic principle applies as the last time I did this: Follow the data flow, track the information at each step, and fix whatever connections are missing. In this case, this is what ought to be happening:
  1. MythTV PVR add-on tells Kodi to play a recording
  2. Kodi notifies Trakt add-on that the video is playing
  3. Trakt add-on updates the Trakt.tv site
Looks very similar to the process from the Crunchyroll integration, which should make this pretty straightforward. Of course, there's always a hitch. In this case, that hitch is that the MythTV PVR add-on provides very little information about what is actually playing. All I could find was a single field called "label" of the form "Show Name - Episode Name." For example, "The Flash - The Darkness and the Light" for a recent Flash episode.

I spent a while poking around the MythTV PVR addon and the Kodi APIs looking for something more, but as far as I can tell, there's no other data about the recording available. The MythTV backend actually knows some more stuff, like the TVDB ID of the episode, which I know because it's accessible through MythWeb on my server. But the add-on doesn't seem to be translating that information through to Kodi. Trying to modify the add-on would be more than what I consider "minor hacking", I'm afraid - it's a large and complicated beast. (I did put in a request for the developer to consider adding more data about the recordings, though.)

So for now, we're stuck with the label as our only data source. I suppose it's possible that you might occasionally get lucky and the Trakt.tv search function would actually hit the right episode based on that label, but most of the time you'll get nothing. However, Trakt does provide an episode search function through the same text search API that I used in the Crunchyroll integration. Split that label into the show and episode name, and Trakt will be happy to search for just the episode name.

Turns out that Trakt is pretty good at fuzzy searching...too good. Searching for that example Flash episode "The Darkness and the Light" returns hundreds of episodes from all kinds of shows, using the words Darkness, Light, or both. I forced a stricter search by using quotation marks around the title, and that got things down to a more reasonable level. It's still likely that more than one show has episodes with the same title, so I also had to loop through all the results and compare the show names. Once I find a search result that also has a show name of "The Flash", I know I've got the right one.

Those search results conveniently include all kinds of information that Trakt knows about the episode, including the season number and episode number, and the internal Trakt ID for the show. That makes it easy to tell the scrobbler function which episode to update. Here's the code changes to implement this.

I'm not totally happy with this particular hack. It relies too heavily on that "label" field - if the MythTV PVR add-on changes the format, or stops setting it altogether, the whole thing falls apart. But it works for now, and if my request to the MythTV PVR add-on developer for more recording data comes through, I can change the Trakt.tv add-on accordingly.

Thursday, October 29, 2015

DVR with MythTV

I recently upgraded the computer that runs MythTV, the digital video recorder (DVR) software that I use for broadcast TV. Newegg had a sale on refurbished Dell PCs (just $99 when I got mine), which are underpowered for most uses, but just about perfect for dedicating to recording and playback of TV broadcasts. I had been using an even-lower-power Asus Eee Box (creatively named "eeebox" on my home network), which did the job but definitely had issues keeping up with demand at times. The new machine has double the processor speed and quadruple the RAM.
For receiving TV broadcasts, I use a HDHomeRun tuner, connected to my local Ethernet network. It's hooked up to a Leaf antenna for receiving over-the-air broadcasts. This all worked fine with the old machine, and there was no reason to change that part of the setup with the new one. (There's no reason you couldn't do this with a cable or satellite feed as well, as long as the tuner you use properly decodes the signal.)

Here's how I went from the fresh-out-of-the-box machine to a functioning DVR system:

  1. The new machine came with Windows pre-installed. I have no intention of running Windows on this system, but I went ahead and booted it up to make sure the hardware worked properly. Video output, mouse, keyboard, network connection...all good.
  2. My operating system of choice is Ubuntu Linux. Mostly just personal preference, as almost any major OS will work. I'm using the server version, since I don't need all the desktop applications that come with a desktop version. Downloaded the ISO install image, and put it on a USB stick for installation.
  3. Plugged the USB stick into the new machine and booted it up. In order to boot from the USB stick, you have to hold down a key (F12 in this case) to interrupt the boot-up process, and tell it to use the USB stick instead of the internal drives.
  4. Went through Ubuntu server install process. This guide is a pretty good overview. I chose to delete the existing partitions on my hard drive (they were just Windows, don't need that) and start fresh. I named the machine "LittleDell" for easy reference, and used the same user account name as on eeebox (just to make things simple). Near the end of the process, you need to choose software to install. I picked only the Base Server Software and OpenSSH options. I'll install anything else needed later on.
  5. After the reboot at the end of the install, LittleDell was up and running. Since I installed SSH, I could easily access it from my regular desktop. After copying over my .ssh directory from eeebox, enabling key-based login, access from one machine to another via SSH was a smooth process.
  6. Before installing MythTV, it's necessary to have a graphical environment, since the Myth setup process doesn't run in a terminal. I chose to install x2go server since I'm familiar with it. (Something like VNC would likely work just as well.) This nice tutorial shows how. With the x2go client on my regular desktop machine, I have access to the LittleDell desktop.
  7. It's also a good idea to shut down any existing MythTV installations on the local network before starting a new install, so I shut down the MythTV server on eeebox (including the MySQL server). If you leave it running, the new installation will helpfully try to connect to it...which we don't want.
  8. Finally, the MythTV installation itself, as documented here. Since I was using x2go, there was no need to use a remote desktop as that guide suggests; I just logged as the mythtb user and ran mythtv-setup directly:
    su -s -u mythtv
    cd ~
    /usr/bin/mythtv-setup

    Some notes for the setup process:
    • It's a good idea to manually turn off the Myth server before starting setup (sudo stop mythtv-backend). It will try to do this for you, but it doesn't always work right.
    • Change the IP address in the first General screen to the local LAN address (it should show up in the drop-down menu) rather than the default of 127.0.0.1. This lets external clients (for instance, Kodi on a FireTV) connect.
    • It's a good idea to schedule program listing updates to happen automatically. There's a screen for this in the General settings. I enable it, and leave the default values - that gives me once-a-day updates. You can always run it more often if needed, by running /usr/bin/mythfilldatabase manually as the mythtv user.
    • When setting up capture cards, the HDHomeRun tuners should show up in the drop-down menu. You'll want to create as many entries as there are tuners (mine has two), since that will let you record multiple shows at once.
    • I use Schedules Direct to get my TV listing data. This is configured in the Video Sources section of Myth setup.
    • You'll need to create one Input Connection for each capture card. They can all be linked to the same Video Source. You need to scan for channels on the first one, but not all the others.
    • When you're done, you'll be prompted to run mythfilldatabase and/or start up the Myth server. I recommend saying no to both, and instead doing it manually (still as the mythtv user):
      sudo start mythtv-backend
      /usr/bin/mythfilldatabase
      This way, if there's any problems, you'll be notified right away.
I also did a couple of additional optional steps:
  • Installed MythWeb as shown here, the remote web interface to the Myth server. This way I can schedule shows, see what recordings are available, view listings, etc from my computer, rather than going through Kodi. Much more user-friendly. 
  • Moved the mythtv data directories from /var/lib/mythtv to a different partition. Any disk partition with plenty of space will do, as long as it's separate from your root filesystem. (I used an external drive, thus the name /mnt/extdrive.) Shut down the Myth server, then do this:
    cp -rv /var/lib/mythtv /mnt/extdrive
    chown -R mythtv.mythtv /mnt/extdrive/mythtv
    sudo mv /var/lib/mythtv /var/lib/mythtv.orig
    sudo ln -s /mnt/extdrive/mythtv /var/lib

    Then you can restart the Myth server. Once you're sure that it's working, get rid of the original files with:
    sudo rm -rf /var/lib/mythtv.orig
    The reason for this is to make sure you have plenty of space for recordings. And if you do run out of space, it won't crash your system.
All told, 2-3 hours of work, of which about half was waiting on installers to finish. Not too bad for a functional DVR! 

Wednesday, October 28, 2015

Minor Hacking: Crunchyroll, Trakt.tv, Kodi

I've been using Trakt.tv lately to track movies and TV shows as I watch them. Not that keeping track of such things is of any great importance, but I like keeping a list and rating the things I watch. Trakt keeps a nice calendar of upcoming new episodes, and it looks a whole lot prettier than the Google docs spreadsheet that I used to use.

I was pleased to see that there's a Kodi add-on to automatically update the site when you watch something. This is known as "scrobbling," a term invented (as far as I know) by last.fm in relation to music. Using sites like Trakt (for videos) or last.fm (for music) is possible without the automatic updates you get with scrobbling, but it's kind of a pain, and easy to forget to update. So the scrobbler add-on is a great feature.

I watch a goodly amount of anime via Crunchyroll, which has its own website and app, but neither of those communicate with Trakt. Fortunately there's a Kodi add-on for Crunchyroll, too. In theory, watching a video in Kodi using the Crunchyroll add-on should be automatically logged to Trakt, via the Trakt add-on. Nothing is ever that simple, though! I got it all set up, and...nothing happened.

Well, I didn't spend 15 years as a system integrator without learning a few things about getting recalcitrant software packages to work nicely together. This isn't exactly a multi-million-dollar ERP system like the ones I worked on as an IT consultant and technical lead, but the principle is the same. Follow the data flow, track the information at each step, and fix whatever connections are missing. In this case, this is what ought to be happening:
  1. Crunchyroll add-on tells Kodi to play a video
  2. Kodi notifies Trakt add-on that the video is playing
  3. Trakt add-on updates the Trakt.tv site
First step, identify where the process is breaking down. Kodi has a log file which includes add-on messages, and they'll dump a lot of info if you enable debug mode. I was able to identify messages relating to the first two steps, but the third was missing. The Trakt add-on knew there was a video playing, but it never updated the Trakt.tv site. A little digging through the Trakt add-on code showed me why: it didn't have enough information. Specifically, the name of the video was missing (as well as season/episode numbers, for TV shows).

Now that we know what's missing, the next step is to backtrack through the process to find where that information should be coming from. The Crunchyroll add-on should be telling us what video it's playing (step 1 in the process). I poked around the add-on code until I found the spot where the video was being played, and saw that it was setting a field called Title. The Trakt add-on, however, was looking for a different field called TVShowTitle, plus season and episode fields. A bit of work in the Python script added those extra fields. (Here's the code, for anyone interested.)

With that update in place, the Trakt add-on was able to identify what was being played, and it did indeed scrobble...when I played a show through the Crunchyroll add-on, the Trakt.tv site showed it as played. Success!

Well, partial success. Turns out that this only worked for some shows. In other cases, the Trakt add-on would try to scrobble, but an error something like "method exists, but no record found" would show up in the log, and nothing on the site got updated. After a bit more research, I determined that this was happening because the show title on Crunchyroll and Trakt.tv were different. Trakt actually knows about alternative titles, including the ones that Crunchyroll uses, but the scrobble attempt wasn't looking at alternative titles.

This problem could be fixed at either end of the process: at step 1, by making the Crunchyroll add-on use the primary title; or at step 3, by looking at the alternative titles in Trakt. I decided to go with the change in Trakt, because this might affect more than just Crunchyroll. Other add-ons might have the same issue. If I changed the Trakt add-on code, then every add-on attempting to use an alternative show title should work.

This was a more complex update than the first one. In the Trakt.tv API, there's a scrobble method, which the add-on was using. But that method has no ability to recognize alternative titles. Fortunately the API also has a search method, which can find those alternative titles. The fix involved adding that search method call to the Trakt add-on, using it to search for the alternative title, taking the result and extracting the primary title, and finally calling the scrobble method using the primary title. (Here's the code.)

With both updates in place, all the shows I'm watching in Kodi via the Crunchyroll add-on are being updated on the Trakt.tv site. (At least, all of them thus far.) The code changes have been submitted to the add-on maintainers to be included in a future update, so other people will get the same functionality without having to re-invent this particular wheel.

Wednesday, October 21, 2015

Cord-Cutting

I haven't had cable TV for years. Outside of live sports, I found that there was almost nothing on that I actually cared about. At $60 a month for just basic channels, cable TV just wasn't worth it to me, and satellite costs are at least as high. So I cut the cord, and for the most part I haven't missed it. Here's what I've done:

  • I picked up a Leaf antenna for broadcast TV. Ever since broadcast channels switched over to digital, the quality of over-the-air broadcast has been just as good as anything you'd get from cable or satellite.
  • On the sports front, I was able to get the MLB radio broadcasts over the Internet easily enough via their At-Bat subscription. (As well as watch the occasional daily free game via MLB.TV.) Same for NHL hockey, but even better...for the most part, teams have free radio streaming on their web sites. NFL games are available on over-the-air network channels, except for Monday night. College football is as well, although there's so many of those that a good number do end up on cable. Even college and NBA basketball games are often on broadcast TV, though I don't watch them much. 
  • The few non-sports shows that I do care about seeing are mostly available via Internet streaming either shortly after airing, or a few months later after the season ends. Most things can be found on either Netflix or Hulu (and Amazon streaming, though I've not used that one). I tend to subscribe to Netflix, watch a bunch of stuff over a few months, then stop it for a year or so while I wait for new stuff that I'm interested in to be added. I never have subscribed to Hulu, mostly because they don't entirely get rid of ads (though that's gotten better recently), but also because of the way they only have a few of the most recent episodes for most shows.
  • In the last year or so, I've been trying out Sling TV, which provides access to several previously cable-only channels for $20 a month. I'm mostly interested in ESPN and TBS/TNT for their sports programming. I've enjoyed having access to baseball game broadcasts this summer, and college/NFL games in the past couple of months. When Sling is working, anyway. I've run into quite a few instances where the service just stopped working, sometimes right in the middle of a broadcast. It's gotten better in the past couple of months, so I'm hoping they've worked out their technical issues and reliability will be better moving forward.
  • I've also subscribed to Crunchyroll for access to anime. Most of what they have isn't available on cable anyway (at least, not basic cable) so it's not really part of cord-cutting, but it fits in the general theme of online media. Ten years ago, getting anime wasn't easy; for the most part, you had to buy expensive DVD sets. I rarely did it, because you never knew if you'd get something good, or a real waste of time. It's much better with Crunchyroll (and to a lesser extent, Netflix and Hulu) providing a wide range of options.

I realize that all of that sounds a lot more complicated than just getting a cable or satellite subscription. I kind of like messing around with way technical things work, so that's no hardship for me. The cost is a lot lower in my case, because I pick and choose which services I want. I don't mind spending the extra time and effort to set it up.

The old traditional cable/satellite subscription model is still alive, but it's on the way out. There's just too many options that don't lock you into paying for a bunch of channels that you don't want. Right now, those subscription models are still alive mostly because they're still the easiest and most reliable solution. If they don't make some major changes in the next decade or so, I expect that will no longer be true, and there will be a lot more folks taking the same path that I have.