Make LIRC work in Ubuntu 18.04, so that you can use your infrared remote in Kodi

Quoting from the article of this title:

If you are a Kodi user and have recently tried to upgrade your system to Ubuntu 18.04, and then tried to install and use LIRC to make your infrared remote control work the way it should, you may have discovered that it doesn’t work.

Believe me, I searched long and hard for a solution for this problem, now I finally found it here!
Make LIRC work in Ubuntu 18.04, so that you can use your infrared remote in Kodi (from the Two ”Sort Of” Tech Guys blog)


Installing Kodi using Ubuntu based systems

I found this article online and thought I’d post a link to it here. This shows the correct way to install Kodi an any Ubuntu-based system:

Installing Kodi using Ubuntu based systems

Just two comments: The article briefly mentions the existence of third-party addons. If I were you I’d avoid those like the plague, because if they don’t come from the official Kodi addon repository they may be using illegal methods to get content, which could cause you to get in trouble with your Internet Service Provider or, in a worst case example, see you on the wrong end of a lawsuit for copyright violations. Also, they can break Kodi, or even put some kind of malware on your system.

The other thing is that after installing Kodi, if you are using any kind of PVR backend software such as Tvheaded, you’ll want to go to System | Add-ons | My add-ons | PYR clients and enable the PVR client that corresponds to the backend software you are using, for example the “Tvheadend HTSP client” if you are using Tvheadend, or the “MediaPortal PVR client” if you are using MediaPortal, etc.

Kodi itself is pretty easy to set up, provided you don’t fall into the trap of using the instructions on some unknown third-party site. My reason for posting the above link was because it shows the correct, “official” way to do it using Ubuntu. If you use some other operating system, you may be able to find an installer and/or instructions for installation on the Kodi downloads page.

When you want to send data from a dish to a backend, but all you have available is some random type of wire…

The world is going digital, yet in many cases we still use LNB’s that send their signals down a coaxial cable to our satellite backends. The obvious problem with that is that coaxial cable is lossy, and it’s also prone to getting waterlogged if it’s buried underground and there are any breaks in the insulating jacket. And there are a few newer LNB’s that can send a digital signal, but require a network connection. Maybe you want to use some kind of equipment that requires a network connection at your dish, but you don’t trust your coaxial cable anymore (if you did, you could just use a MoCA Network Adapter, assuming you had a suitable weatherproof enclosure and power at your dish).

Now, my preference when running digital cable at a distance is always to use fiber optic cable, because it doesn’t carry electrical current of any kind. But one pitfall with using either MoCA or fiber optic equipment is that you need to run power out to the remote equipment. If you have a dish that’s several hundred feet away, that could get expensive in a big hurry.

Many older dishes have a multi-pair cable running to them that is intended to control the positioner motor, and in addition they have a three conductor cable (or maybe four conductor if the original installer got a deal on phone wire) cable that’s intended to control the servo motor. But if you are replacing the LNB with a digital model, more than likely you won’t be using that servo motor anymore. And of course there is always the original coax. Presumably some or maybe even all of these wire may potentially be available for reuse, but none of them are data cables, or were in any way intended for use with data connections. These cables aren’t Cat 6, Cat 5, or even Cat 3 (multi-pair phone wire), they are Cat-nothing because hardly anyone was doing home networking when they were installed. Does that mean they are useless? Maybe not!

It turns out that Patton Electronics has come out with a new device, their Patton CopperLink 1101E Industrial Grade Power over Ethernet Extender. The feature list is as follows:

  • Ethernet Extension—Extends 10/100Base-TX Ethernet over 3,300 feet (1005 meters) using 2-wire, 24-AWG twisted-pair, Cat 3, Cat 5e/6/7, or coaxial cable.
  • Delivers PoE—PowerPlus technology powers up both the remote CopperLink extender and the PoE enabled device connected to it. No power is required at the remote location.
  • Transparent LAN Bridging—Will pass higher layer industrial Ethernet protocols such as BACnetIP, EtherCAT and Modbus TCP.
  • Plug and Play—Modems need no configuration to operate, Ethernet ports are auto-sensing 10/100, full or half-duplex.
  • Overvoltage Protection—Overvoltage protection on Line and Ethernet ports prevents damage from ESD (electrostatic discharge), CDE (cable discharge events), and lightning.
  • Made in the USA—This Patton equipment is designed by Patton engineers and built in our Gaithersburg, Maryland facility. Patton’s American-made manufacturing process delivers high-quality networking solutions with reliability you can trust.

In case you missed it, there are two main advantages here: First, it can use types of wire that might otherwise be considered unsuitable for data, even down to a plain old single-pair wire, at a distance of up to 3300 feet (which is about ten times the maximum distance of a normal Ethernet connection). And second, power for the device at the far end AND any PoE equipment connected to it is carried over the same wires, so you may not need to run a separate power line out to your weatherproof enclosure.

Hookup diagram for Patton CopperLink 1101E Industrial Grade Power over Ethernet Extender

In the above diagram, you could imagine an ethernet connected LNB in place of a HVAC controller or IoT gateway.

Obviously, making a connection to a dish at some distance isn’t the only possible application. As Patton’s overview of this product notes:

Ethernet, however, presents a few drawbacks that may overshadow the benefits by creating escalating infrastructure costs and system downtime. The Ethernet standard specifies a distance limitation of 328 ft (100 m), which restricts location options for device installation. Standard Ethernet also requires Cat 5 cabling or better, which often leads to installing new cabling infrastructure—involving tearing into walls, ceilings, pavement, and worse.

The CopperLink 1101E kit from Patton enables Ethernet connectivity over previously installed copper infrastructure. The solution breathes new life into circuits previously deployed for such traditional non-IP applications as RS232/485 HVAC and building automation controls, alarms, CCTV, analog phones, intercom speakers, and others.

I will note that there are actually at least three varieties of this device, the standard model CL1101 which is probably sufficient for most indoor applications, and the CL1101E industrial grade model that I have shown here. And then there is also the CopperLink 1101E/IP67 model that is designed for outdoor operation, and therefore would not require a separate weatherproof enclosure (here’s a press release on that model). This same company has an entire line of Ethernet Extenders so if one of these models doesn’t meet your needs, wander around their site and you might discover a more suitable device.

I have mentioned this particular device because of their claim that it has Overvoltage protection that “prevents damage from ESD (electrostatic discharge), CDE (cable discharge events), and lightning.” Since lightning protection would be a big consideration for any wiring running outside, that seems to be a very desirable feature. Please note that I am neither an electrician nor a lawyer, and that your local electrical or building codes may require additional lightning protection. I have never tested nor personally used this product, so I cannot guarantee that it will be suitable for your specific application.

Two things that I am not certain about are the connection speed, and the price. They seem to go out of their way to not mention a specific connection speed, and I suppose that’s because it varies depending on the wire used and the length of that wire. It seems obvious that you wouldn’t get the same throughput on an old, long, small-gauge two wire connection that you would using a few dozen feet of Cat6 underground wire, but will the throughput be adequate to carry satellite video? I would certainly hope so, but can’t guess with any certainty until some reviews are in. As for the price, that depends on which model you choose, and whether you buy one or a pair (obviously you are probably going to need a pair!). Let’s just say that if you have the option of running fiber optic cable, or using MoCA network adapters with the existing coax, you may find those are less expensive options (depending on whether there are any labor costs involved in running new cable). These devices are just another possible tool in the toolbelt, so to speak.

As a side note, the indoor units definitely seem like they could be problem solvers in cases where you don’t want to use WiFi or it doesn’t work well, but the only available wiring is old telephone, intercom, or alarm system wiring. Many homes built in the 80’s, 90’s, and the first part of the 00’s were pre-wired for telephone service, and while newer installs may have used Cat 5 or Cat 5e wire that’s already suitable for Ethernet (if you are lucky), older installations may have used Cat 3 (twisted pair phone wire) or even the older quad-style wiring (red, green, yellow, and black untwisted wires). For some homeowners, it may be worth spending a few hundred dollars to utilize that existing wiring rather that having to run new Ethernet cable, but on the other hand you can buy a whole lot of Spackle and paint (to repair temporary holes in drywall made while fishing new wire) for that same amount of money, so you need to look at the cost and difficulty of running new wire as opposed to the cost of using equipment such as these extenders, that can apparently use existing wiring for networking.

Useful tool to make burying cable easier

The thing I have always hated most about installing a satellite dish is having to dig a trench for the cable. Digging is boring, plus it will probably be a couple years before the lawn looks right again. But you can overcome both those issues in many soil types with this tool (no, I do not get any commission on this thing, just saw it mentioned in another forum and thought it interesting):

This won’t work in all soil types, and it doesn’t dig deep enough for high voltage wiring (110/220 volts, which by code in most cases must be buried at least two feet below ground level in the U.S.A.) but for low voltage wiring and coaxial cable it would be great. Personally, I’d make the top of the trench a little wider and push in 1″ (or slightly larger if you have several cables) black irrigation tubing (the type you buy on 100 foot coils in the home improvement stores) and run the cables through that; it will offer some protection for your cables if you forget exactly where they are and have to dig in the area for some other reason, as long as you don’t mistake the irrigation tubing for a tree root and start trying to chop it with a shovel (not mentioning anyone that might have done that, but will just say that although the irrigation tubing was a bit worse for wear the cables inside were fine). 😉

The commenters on YouTube seem to want to point out that there are some types of difficult soil for which this isn’t suitable, but that would be pretty much a given with any tool; even a shovel won’t dig through solid rock. And if you are passing near trees you might still need to dig underneath aby large tree roots that are near the surface, so definitely still bring your trenching shovel and hatchet for those situations.

P.S.: If you do buy irrigation tubing for your cables, 1″ tubing is adequate for one or two coaxial cables, maybe even three, but for anything above that I’d suggest going slightly larger. It’s a real pain trying to pull cables through too-small tubing, and could even damage the cables. If you do find that the tubing is a little crowded and the cable is pulling hard, go to your nearest electrical supply store or the electrical department of a home improvement store and pick up a container of wire pulling lubricant, and use that liberally to reduce friction during the pull. Also, note that while irrigation tubing is fine for protecting low voltage wiring, it may not meet code in your area for use with high voltage electrical wiring (110/220 Volts); consult a licensed electrician if you are contemplating any such use. Disclaimer: I am not an electrician, so do not rely on any statements in this article as accurate regrading electrical codes; when in doubt, consult an electrician or the national and local codes in your area.

Electronic Frontier Foundation: The patent on Dolby Digital (AC-3) has just expired

To quote from an Electronic Frontier Foundation (EFF) page,

What is Dolby Digital (AC-3)?

AC-3 is a compressed digital audio format like MP3. It made its public debut in 1992. AC-3 has become the most common format for audio in film and television.

  • For digital television, AC-3 is a mandatory part of the ATSC standard (North America), DVB standards (Europe), and others.
  • For home video, AC-3 is a mandatory part of the DVD and Blu-ray standards.
  • For Internet streaming, AC-3 is supported in HTTP Live Streaming on many devices.

AC-3 supports up to 5.1 surround sound.

This is the format used to deliver 5.1 surround sound on many North American free-to-air TV channels. What this means is that satellite receiver manufacturers have one less patent to worry about.

This ought to put an end to some of the whining that occasionally appears in the satellite TV forums about cheap imported receivers that (in the opinion of the authors of the messages) violate patent laws, because the manufacturers allegedly did not purchase legitimate Dolby Digital licenses, yet included an AC-3 decoder in their receivers. Usually it is satellite equipment dealers that overbought on more expensive digital satellite receivers, and are sitting on old stock they’d like to sell, that complain about such things because they hate the competition (some dealers that have their own forums even censor discussion about such receivers, which strikes me as incredibly petty and self-serving, but it’s their forums). They fume that (in their opinion) such receivers enter the country illegally, and are sold more inexpensively than they should be, because the (usually Asian) manufacturer never cared about such things as paying patent license fees for their Dolby Digital decorder. Well as of today (March 20, 2017), payment is no longer required, according to this EFF article.

Manufacturers probably should avoid using trademarks such as “Dolby Digital” on their equipment, packaging, description of their product, in on-screen menus, etc. and instead stick to the non-trademarked “AC-3” designation, in order to stay on the right side of trademark law. And, as the article explains, this patent expiration only applies to AC-3 format. It does not apply to EAC-3 (“Dolby Digital Plus”), MLP, or TrueHD, which are still covered by several patents.

I am not a lawyer, and am only reporting what the EFF has to say about this, so if this matters to you, please consult your own lawyer for legal advice. Again, the article is here: At midnight on March 20, 2017, Dolby’s last relevant patent on Dolby Digital expired.

By the way, for anyone that’s ever had an argument with a friend or family member about whether a channel is carrying 5.1 audio (especially when Kodi claims it’s 2 channel, yet your ears tell you otherwise), note this article states that “AC-3 supports up to 5.1 surround sound”, and then further down, it also mentions AAC, DTS, and Opus as examples of other multichannel formats. So if Kodi shows the audio source as AAC or AC3, yes, it still might actually contain some form of 5.1 audio.

Linux users: Missed your favorite show? There may still be a way to view it, without annoyances

One of the nice things about free-to-air satellite is that if you try to record the eastern time zone feed of a show and the recording is no good for some reason, you can often find a later time zone feed to watch or record. However, if a channel suddenly “goes dark” with no warning, or if you don’t realize your recording is bad until after any refeeds have already aired, what can you do then?

Many networks put their shows online, on their web sites, so obviously that would be the first place to check. The problem with that is that many of those sites are a pain in the posterior to use. In some cases you have to have a cable company or commercial satellite provider login in order to watch a show, and in any case the stream will most likely be interrupted by annoyances (commercials, and promos for other shows). And, it may require that you have Adobe Flash installed on your system, and fewer systems come with Flash these days because Flash is a dying technology (none too soon, in my opinion). Over a year ago, Adobe itself started telling people to stop using Flash, but apparently many online video sources haven’t heard the message yet. You can still install Flash, but why would you want to? And I don’t know about you, but I find watching a show in a Web browser a less than spectacular experience.

But if you have access to a Linux-based system, there may be a way to avoid many of the annoyances. I will refer you to this article, which tells you how to install a program that will let you download videos from YouTube “and few more similar sites”, but don’t let the word “few” fool you. I am not going to expound on how understated that statement is. What I will say is this, install the program on your favorite Linux-based system (using the instructions in that article, preferably using the curl or wget methods, since you can then use the program’s -U option for updates), and then run it with the --help option and actually read the output. Many of the options won’t make much sense to you at first, but you may see a few that are rather enlightening. If you find a section that makes you think “Wait a minute, it can do that?”, well yes, it probably can.

So here is the procedure to get a missed show. Open up the web page for the network of the show you missed, and if they have a specific link for “full episodes” or something similar, follow that. When you find the thumbnail or link to the episode you missed, right-click on it and copy the link location.

Now run the program, giving that link as the final option on the line. More than likely it will give you one of several responses. If you are lucky, after a small delay it will start downloading the show. When it is finished, you can move the downloaded file to your Videos directory and watch it using whatever software you normally use to watch TV shows (such as Kodi, Plex, or VLC). This is just like watching it in your web browser, except you now also have the option to watch it on your TV. Actually, some would consider it a better experience (often better audio and video quality, and fewer “annoyances”).

If you are not lucky, it will either complain that something about the link isn’t valid, or that it needs you to install additional software, or it will tell you that the video can’t be accessed without a supported provider login. In the latter case, if you do not have a provider login you are out of luck. If you have a provider login (maybe you are visiting your rich uncle that still subscribes to cable, and he’ll let you use his login and password while you’re visiting), again, use the --help option and read everything (particularly the “Authentication Options” section, and the section below it).

If something about the link isn’t valid, it may be that you didn’t copy the correct link from the page, or in rare cases you may need to view the page’s source code to try to find the correct link, which admittedly can be a challenge if you don’t know how to do that. Also, it could be that the site you are trying to access is unsupported. There is support for quite a few sites built in, but not for every single video site out there. The source code for the program is freely available, and it’s written in Python, so if you are a Python programmer maybe you could modify the software to support a particular site of interest.

If it complains that you don’t have ffmpeg or avconf installed, I suggest you install ffmpeg, since it works better with this program. Probably the easiest way to install ffmpeg is to use the FFmpeg Static Build that is appropriate for your operating system and CPU type. Copy the program files (ffmpeg, ffmpeg-10bit, ffprobe, ffserver, and qt-faststart) from the archive into a subdirectory that’s in your system path (/usr/local/sbin is a good choice on most systems), and make them executable. Then try running ffmpeg --help from the Linux command prompt, and if you get the message “Illegal instruction” then you probably installed the wrong version for your system (particularly if it’s running on a Raspberry Pi – on some models you apparently need to use the armel build, and on others the armhf build). If you downloaded the wrong one, just delete the ffmpeg files from wherever you copied them, and start over with the other build.

If, when running the main program it appears as if it is going to work, but then fails with an error message similar to “Failed to resolve hostname” and indicates that the error came from ffmpeg, you probably need to install nscd (the readme.txt file in the FFmpeg static build archive notes that “A limitation of statically linking glibc is the loss of DNS resolution. Installing nscd through your package manager will fix this…”). To do that under Debian, Raspbian, Ubuntu, or similar distributions just do

sudo apt-get install nscd

If you are a Linux command line hater, and are running Ubuntu 16.04 or newer, this article explains how you can install a front-end GUI for the program.

When running the program, if you use one of the subtitle downloading options such as --all-subs, the subtitles will be downloaded in a separate file. In Kodi, if the subtitles file has a .srt extension and the exact same name as the video file except for the extension, Kodi will find and use it. Unfortunately, the subtitles obtained by this program are often in a different format that Kodi doesn’t understand (most I have seen have a .tt extension). You can convert most other subtitle formats to .srt files using a python script named pycaption. Download it and install it using the included script. The usage is:

pycaption original_subtitles_file.ext --srt >

An alternative PHP script that will download video from a few sites not supported by the program mentioned above is described on this page. However, that script is a bit more difficult to use, especially the first time.

Failing all of that, many show pages will provide links to places where you can buy an individual episode, often for a fairly low price. But if you are like me, it really burns you to pay for an episode that you would have been able to watch for free if the PVR software had worked correctly, or if a stupid local broadcaster hadn’t decided to pre-empt the network show you really wanted to see in favor of some crappy locally-produced content. So, I do tend to like to have alternatives, just in case something happens that causes my PVR software to not record a show. Also, if you subscribe to Netflix, Hulu, or a similar service, don’t forget to check them, since they may have the show you missed.

Now, someone is probably going to ask whether the software mentioned in the linked article is legal. Well, here is the thing, I am not a lawyer, and the laws vary throughout countries in North America. What might be unquestionably legal in one jurisdiction might be illegal in another. This is content that is made available on web sites, and if you just watch the show and delete the file afterwards then you are essentially doing more or less the same thing a browser does, just in a more manual manner, but that may or may not matter as far as the law is concerned. Or to put it another way, this software does exactly what a PVR does, except for some web-based content rather than over-the-air TV. But to repeat – I am not a lawyer, so if this is something that concerns you, you should ask your lawyer. Just be aware that the use of this software may or may not be legal where you live, and I assume no responsibility whatsoever if you choose to use it without bothering to verify whether it’s legal to use where you live. That said, it is NOT peer-to-peer software, so the likelihood that you will get in any trouble for using it is probably rather small.

One other thing you need to be aware of is that many videos are huge – some may be multiple gigabytes, which if you have a usage cap on your ISP connection could be bad news for you (although, keep in mind that you are probably downloading fewer “annoyances” than if you watched it in your web browser, so there’s that). Be aware of the size of the files you are watching! Don’t go hog wild and pull in everything you can think of (this also applies to video you watch in your web browser, by the way – quite a bit of it is more data-intensive than you think, particularly if it’s HD content). It’s always better to record a show direct from a satellite or over-the-air channel when possible, because those shows will not impact your ISP usage cap. Software like this should be used only as a last resort, when other options aren’t available.

And, one drawback of this type of software is that, as far as I am aware, there is no way to schedule shows in advance and have new episodes downloaded automatically when they appear. I am sure that the programmers in the crowd could probably write some kind of script for a specific channel that would find the link for the most recent show on a page and download it, if it’s not been previously downloaded, but that’s not something that’s built into this software.

Article points out several coding errors in MediaPortal 2

I’m not a big fan of using Windows for anything unless you absolutely need to, but for those who do, one of the more widely used Windows-based PVR backend and frontend software packages is MediaPortal 2. I ran the original MediaPortal briefly, early on in my attempts to set up a satellite backend, and had a lot of issues with it, but I will say they had the best developer and community support I have seen anywhere (no crabby developers that felt the need to insult or demean a hapless user from time to time, as I too often see in Linux-based software forums). Were it not for the need to use Windows I might have stayed with it, but I just really hated having to use Windows for a server, and it didn’t play that well with my satellite tuner cards, so I wound up switching to TVHeadend running under Linux.

Anyway, now I realize one reason I might have had some issues with it. According to this article, their code is rather buggy:

Brief analysis of Media Portal 2 bugs

Now, it appears that the code was analyzed using a commercial product called PVS-Studio which, as best I can figure out from that page, is program used to analyze programs written in the C language and some of its variants. So in essence, it would appear that the purpose of the article is primarily to demonstrate how their software can find bugs in other people’s software. If you ran that program against any other software written in C, it would probably yield a similar list of what it considers to be problems in the code. In other words, viewed one way this article is in part a thinly-veiled advertisement for their product. Still, one would hope that the MediaPortal 2 developers would at least fix the problems noted in that article.

So, if any of you are using MediaPortal 2, you might want to bring this article to the attention of the developers, if they haven’t already seen it. As for the PVS-Studio software, I will just pass along this text from the article:

So, let’s take a look at the most interesting bugs we found; the project authors can do a more detailed review of the bugs by doing the project check themselves, or by making a request for a temporary license. Also, dear readers, if you are non-commercial or individual developers, I suggest using the free version of our static analyzer. Its functional abilities are absolutely identical to the paid version and so, it is the perfect fit for students, individual developers, and teams of enthusiasts.

I can think of at least once piece of software I’d like to see analyzed by something like this, but I don’t know if any part of it is written in C. Not mentioning any names, but it rhymes with toady, or grody.