View: HTML | Text | PS | PDF | RTF | Wiki | DocBook | DocBook Inline | changelog | about this header Circle Jeff Boweron  
Installing MythTV

Installing MythTV

My AV system has evolved (devolved?) from a DirecTV system, to a FiOS TV system with DVR, to augmenting that by streaming from my PC to my XBox using DLNA, to a Logitech Revue Google TV solution, and now to a MythTV solution. I'm a cord cutter, a NetFlix subscriber, an Amazon Prime subscriber, and I have an extensive DVD collection on my server's hard drive. This is my story.


Table of Contents
1. Services
2. MythTV vs. Google TV
3. Hardware
4. Configuration
4.1. HDMI Audio
4.2. Custom Main Menu
4.3. Add Chrome/Chromium to the Menu
4.4. Hulu Desktop
4.5. NetFlix
4.6. Foscam IP Cameras
4.7. SiliconDust HD HomeRun Dual
4.7.1. Troubleshooting
4.7.2. Using VLC to Watch TV
4.8. Screensaver
4.9. IR Input
4.10. To Do List
A. NetFlix DVD Costing
B. About Me

1. Services

I'm a cord-cutter. One of those people the cable companies like to pretend don't exist. I pay exactly $0 a month for traditional TV services because I've found that my previous bill in excess of $100/month tended to be wasted on channels I don't watch. A pay-per-show solution was a much better fit for me, and this is a list of the services I've found to be useful.

Some shows I get to watch in near realtime on Hulu. I appreciate Hulu enough that I was going to be a Hulu Plus customer, even when I heard the interesting decision to supply older content to the Hulu Plus customers rather than delaying the new stuff for free customers. Still, extra content is nice and the ability to discover a new series and watch it from the beginning is a good thing. However, they're not just charging for content. They're charging for what you watch your content on. The idea of restricting mobile viewing to Plus customers is repugnant - I refuse to support this sort of behavior. Ironically, if they simply made the content available on any system, effectively removing value from the Plus service, I would likely subscribe. Despite wrongthink on device-specific viewing, with shows frequently showing up the day after they're aired Hulu is a nice way to see mostly up-to-date shows as a cloud-based DVR system.

NetFlix is another heavy hitter, mostly because of their near-ubiquitous apps. They're easy to navigate, not the best for browsing but I tend to populate my queue with what I want to watch from my PC. The downside here is that they not only don't have a Linux client, but they intentionally break clients that would work just fine on Linux (no, it's not a SilverLight issue - otherwise the Ubuntu-based ChromeOS wouldn't have a plugin and the myriad of embedded devices wouldn't work). I have absolutely no desire to steal content I can stream, in fact if I were of the mindset to steal content their DVD library is a much easier target. Still, given the size of their library and how well-designed their apps are they are a hard one to give up. NetFlix is also easy to navigate on most devices and their queue allows you to add movies before they're in theaters so you don't have to worry about when they're released on DVD. However, they don't have a good notification method like Hulu does. If they'd add a "subscription" method to things like series so I can get an email when there are new episodes on Instant View things would be much nicer.

I'm also an Amazon Prime customer. Their business model is interesting, get people hooked on their free library and they're much more willing to spend money on their non-free rentals/purchases. Two things hold me back: 1) their free library doesn't have a lot of what I want and 2) they have no apps which makes navigation from a couch very difficult. These two combined make me lean towards NetFlix more than I'd like, but Amazon has the benefit of running perfectly fine in a Linux browser. Or on Android or Google TV's browser for that matter.

I have a fairly large DVD collection. Many moons ago I used DVDFab to convert them to WMV format, WMV being the only format my XBox 360 can play with 5.1 audio. Since then I've used MakeMKV to rip my latest acquisitions to MKV format. This has the benefit of being higher quality, having subtitles, and I'm no longer limited by the 360's limited codec support. These files sit on a server in my basement backed up across two hard drives. Non-location-specific storage is critical for me even with a one-TV household - I don't want to have to rearchitect everything to allow for playing my content on a second TV or other device.

I'll give an honorable mention to PlayOn. They have a decent solution for streaming your media to any device you want, but there are limitations. PlayOn has a frontend plugin for Hulu, Amazon VOD, NetFlix and a slew of other Internet video as well as the ability to stream from a local filesystem. They then transcode this into a common video format and stream it to various devices. They use DLNA as a base solution which buys them a lot of compatibility, but also limits the scope of their project. This means that fast-forward and rewind are a bit restrictive and subtitle support is pretty much nil, and browsing is more like navigating a directory tree than a set of cover art tiles. What really hurts them in my setup is that they're Windows-only - my one Windows XP VM takes up more resources than the three Linux VMs. Worse, the fact that it's a VM means I can't use GPU acceleration effectively. All that we can fight with more server-side horsepower or even a dedicated native Windows machine. However, Hulu support stopped working for me some time back and I haven't had the time to troubleshoot it. Their DLNA server also doesn't have codecs that my Google TV likes nor does their Google TV solution (go to http://g.playon.tv/ via the web browser) doesn't support keypress navigation (you can't use the arrow keys to select anything, you need to pull out a touchpad or mouse). Despite the limitations, it's still worth a look - especially if you've got a spare Windows box to run it on. PlayOn was the application that allowed me to cut the cord, I've saved several thousand dollars because of it.


2. MythTV vs. Google TV

I wanted to love Google TV. I really did. I'm a big Android fan, I thought Google TV was a natural evolution from the horrid Yahoo! widgets, and as a cord cutter I'm a prime candidate for everything Internet video has to offer. But I just couldn't get into it. Part of the problem is that when my TV died the only Google TV games in town were Sony (who I refuse to purchase anything from for a variety of reasons) and Logitech. The Revue seemed like it could be the "Nexus of Google TV" since it was a standalone box whose sole purpose is to provide Google TV services. But I forgot, Logitech viewed the box as a means to sell accessories like cameras and keyboards. So the Revue was destined to be a second class product, unable to live up to Logitech's dreams.

There are a lot of things it does really well. The idea that you can search for a show and it will tell you it found it and then show you options to view on NetFlix, Amazon, or other sites is great. The browser works well with the keyboard/touchpad combo. The idea that some apps on my phone can run on my TV is also fantastic. And, of course, setting it up is as simple as plugging in power and HDMI and you're off and running. Even setting up the Android-powered remote software just popped up a Bluetooth-style PIN entry on the TV and it worked just fine.

I think the focus on search is also their downfall for me. I rarely browse for video, I want to find a TV show or movie rather than click through dozens of YouTube videos. Google TV makes it easy to find things that are out there, but that's all wasted on me since all I need is to be told that there's a new episode available for me.

Google TV handles some of my services well. NetFlix runs on pretty much anything known to man, except for the previously mentioned NetFlix War on Linux, and their UI on Google TV works fine. It's admittedly tough to browse, but I usually use my PC to actually search for video - which reminds me to check out Amazon's selection as well so I can watch it on Linux. Speaking of Amazon, the Revue plays that admirably as well despite Amazon's lack of an app.

Hulu is a bit more troublesome due to Hulu's device restrictions. I'm sure the Hulu Plus app works fine, but I refuse to subsidize a service that requires it. Hard to blame Google TV for this. PlayOn is an option for this, but they have a mouse-driven interface which doesn't work well on a TV since I need to pull out a big keyboard or switch my phone to a touchpad mode instead of the precision of big up/down buttons and preset play/pause keys rather than scrolling to a VCR button pop-up.

It's the live media that's the real disappointment. I couldn't find a good DLNA client that supported the output of the DLNA servers I've tried (or there have been other issues with transcoding servers. I also couldn't find a way to implement the preferred solution of directly mounting a shared drive (hopefully with SSHFS, but NFS or installing Samba are possibilities). Again, PlayOn works but PlayOn is designed for "live" transcoding, not to browse the video library on my server. Add to that the clumsy mouse-driven UI and using it for my local media doesn't work well. And even if I could get the filesystem mounted I wouldn't be able to play my MKV files (the tests I did had audio, but no video) and I'd be curious about the older WMVs with the 5.1 audio support (less of a concern, I'd just re-rip as MKV as needed). I'd probably need to hack VLC into the system if the codec support isn't there.

Really it's the lack of clean ways to do two of the things that I do most, play video files on my server and watch Hulu, that made me look to augment my Google TV solution. Now with MythTV I've certainly got the flexibility for watching my own videos. Hulu Desktop, while mostly deprecated, works and a browser would work just as well. The biggest drawback is NetFlix. Again, this is a strictly NetFlix issue and it certainly comes into play every time I consider whether I can leave NetFlix entirely for Amazon's superior VOD service with an inferior set of apps.

For me, MythTV is a good project and has nearly infinite flexibility and features. For my mother, Google TV is hands down the winner. Google TV wins on price and ease of use - especially around Internet-hosted video. MythTV wins on customizations and getting obscure things done.


3. Hardware

Some people seem to stress out about the hardware for a MythTV installation, I was running it on an Compaq nc6000 which could almost do the job. I will admit that I see no need to waste the hard drive space for BluRays so I tend to rip at DVD quality. On the small TV I own there really isn't that much difference.

I used a barebones SHUTTLE SH67H3 with an Intel G620 2.6 GHz processor and 8GB of RAM. I also scavenged a 750GB SATA hard drive and have a Logitech wireless keyboard/trackpad combo. The system itself is pretty simple, and even if you need your own hard drive it'll probably run much less than $500. The best part is that the SHUTTLE has an HDMI output, no adapters needed.

Coincidentally, just after I ordered this PC Woot! had a deal on a SiliconDust HomeRun Dual network tuner. With advertised MythTV support I couldn't refuse even though I don't really watch live TV.


4. Configuration

For the most part, there was nothing to the configuration of the box. I used Mythbuntu as a base OS since MythTV is pretty much the choice in HTPC operating systems for Linux and I use Ubuntu at work and on my home systems. The fact that the latest LTS version was just released is an added bonus.

Fearing some 64-bit compatibility issues around Flash I downloaded a 32-bit ISO, stuck in a USB thumb drive (which came up on /dev/sdg) and ran dd if=~/Downloads/mythbuntu-12.04-desktop-i386.iso of=/dev/sdg bs=1M to burn the image to the drive. Booting off that allowed me to install the system to the hard drive, remember to partition the /home directory as a dedicated partition so if you need to wipe the boot partition you can save your data easily.

I did all of this from my TV with the HDMI port connected and the wireless keyboard/trackpad plugged in - no drivers needed. However, the system doesn't like to be booted without an HDMI signal, make sure your TV is on first.


4.1. HDMI Audio

Issue number one, there was no audio out of the HDMI port. For my setup this was fairly serious, everything else uses HDMI audio so I'd need to have another solution for MythTV - perhaps one that I wasn't willing to invest in for a one-off.

Luckily, Google has not failed me. On this page I found that by running aplay -l I could get a list of the audio output devices. Sure enough, I was able to find the HDMI output:


$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC888-VD Analog [ALC888-VD Analog]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC888-VD Digital [ALC888-VD Digital]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
 Subdevices: 1/1
 Subdevice #0: subdevice #0

All I needed to do was to configure ~/.asoundrc to include the following:


pcm.!default {
     type hw
     card 0
     device 3
}

Potential flaw number one averted, with zero extra hardware expense.


4.2. Custom Main Menu

The menu information is all stored in /usr/share/mythtv/themes/defaultmenu/. This is a great place for it, except when you need to reformat your system. Luckily you can copy the files you need to edit into ~/.mythtv/ which has an added benefit of not needing root permission to edit them (which can, of course, be added back if you want to add some more security).


4.3. Add Chrome/Chromium to the Menu

I figure I have a choice. I can have 300 different menu items for each form of video I want to watch, or I can just be realistic and put an entry for the browser in the mainmenu.xml file. My philosophy is that without a proper application most video is probably better off on my browser catch-all.

I'd prefer to run Chrome in full-screen or kiosk mode, however Chrome doesn't seem to like to let you enter URLs in that mode so I'll settle for full screen mode. I've also decided for now to stick with Chromium, the Open Source version of Chrome. This isn't a bold statement on open vs. closed, it's simply curiosity and laziness. Chromium is the default browser for MythTV and I'd like to know if I can tell the difference.


   <button>
       <text>Chromium</text>
       <action>EXEC /usr/bin/chromium-browser -start-maximized</action>
   </button>

4.4. Hulu Desktop

Hulu is a walking set of internal conflicts. I have faith that the Hulu team wants to do the right thing, but their hands are tied by the content providers who are also their primary stakeholders. Despite efforts to restrict mobile and TV-based viewing they have a Hulu Desktop product that, while seemingly deprecated, provides a near-ideal interface for MythTV and other HTPC applications. Without needing Hulu Plus.

It's important to note that the Hulu Desktop solution is no longer the preferred solution in MythTV land, but they prefer MythNetvision. You can play with this by simply running sudo apt-get install mythnetvision on Mythbuntu, it shows up under the Media Library link and the Hulu config is described here. I'll stick with Hulu Desktop for now because the MythNetvision plugin seems a little limited. I can't figure out how to view my queue at first glance, but more critically the player looks like a web browser while Hulu Desktop automatically goes to full screen mode.

First download the appropriate version for your system (in my case, Ubuntu 32-bit). You should be able to install it using dpkg -i. Make sure you have Flash installed (sudo apt-get install flashplugin-installer) and try to run huludesktop from a terminal window. If it loads, fantastic and you can skip the next paragraph. Otherwise, read on.

Modern versions of Flash seem to have issues (note that Hulu Desktop was compiled on Karmic in 2009. If the first line of your output looks like an issue with libvdpau_nvidia.so you may need to use an archived Flash version. The recommended version according to one Hulu support ticket is 10.3.183.10 which seems to work well for me. Remember, old Flash is insecure Flash. Heck, new Flash is insecure Flash. Unzip this archive in a temporary directory and descend the directory tree (you probably don't want the debug version). Running tar -vxzf *linux.tar.gz should yield a bunch of files including libflashplayer.so. Put this someplace safe, I used ~/lib/. Now edit ~/.huludesktop and edit the flash_location variable like this:


[flash]
flash_location = /home/myth/lib/libflashplayer.so

Now you should be able to run huludesktop and log in. It's not the best of interfaces (I'd present the queue front and center, for example), but it hopefully works. If so, now it's time to edit mainmenu.xml to add these lines:


   <button>
       <text>Hulu Desktop</text>
       <action>EXEC /usr/bin/huludesktop</action>
   </button>

Finally, if you have issues with the mouse cursor hanging around you can run sudo apt-get install unclutter.


4.5. NetFlix

The easiest way to watch NetFlix on a Linux-based Mythbuntu box natively is to get a screen capture program for Windows or even a VGA recording box, save a DRM-free version of the file, and watch it on Linux. Of course, an easier way to steal higher-quality content is through their DVD offering. Of course, both of these are not very legally sound, but they are easy.

Another potentially viable solution is to use a built-in app. I plug my MythTV box into my Revue which goes into a Vizio TV. Both the Revue and the Vizio have Netflix apps, as does the XBox 360 next to them and the Android phone I can plug in if needed. Any of these is likely a better solution, but not nearly as much fun. That said, I will likely simply use the Google TV NetFlix app to view things in my queue but use the solution below for browsing and searching.

I went the Virtual Machine route. For a hypervisor I played with kvm for a bit, while I like it for a headless server I had issues getting the video to the right resolution and getting the sound card working. Rather than continuing, I went with VirtualBox. I've been using it since 2009 both in a desktop and headless server environment, it outperforms Citrix and VMWare and is only a tad slower than KVM for most things. It's got a user-friendly GUI and a robust set of command line options. Rather than just downloading it, I'd recommend adding the repo. The commands are in the Linux download page, or you can run this one monster command:


sudo echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -a | \
 tail -n1 | awk '{print $2}') contrib" >> /etc/apt/sources.lst && \
 wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | \
 sudo apt-key add - && sudo apt-get update && \
 sudo apt-get install virtualbox-4.1

I won't go through the details of working with VirtualBox, especially since you may be running something other than XP. I called my virtual machine "netflix" and gave it a single CPU with 1GB of RAM and the default hard drive size.

I went with XP as a guest OS because I have some leftover licenses and this didn't seem worth wasting a Win7 activation on. Also consider a Hackintosh, just to annoy Steve Jobs' corpse.

Once it's installed, I loaded Chrome (why bother with IE), MS Security Essentials just to avoid the pop-up, and ran through a few series of updates. You'll also want to go to your NetFlix account, log in, and play a movie (which will prompt the SilverLight install). I then created netflix.bat.


@echo off
"C:Documents and SettingsmythLocal SettingsApplication DataGoogleChromeApplicationchrome.exe" --kiosk www.netflix.com
shutdown -s -t 0

Once things are working, switch the VM to full screen mode and put netflix.bat into your Startup Folder. This should make it so you automatically load the NetFlix website and when you close down the browser Windows will automatically shut down. Now you're ready for the mainmenu.xml entry:


  <button>
       <text>NetFlix</text>
       <action>EXEC /usr/bin/VBoxManage startvm netflix</action>
   </button>

You can probably trim down the OS a bit to make the bootup faster (expect a few more XP customization tricks here soon), but this messy solution works. The biggest downside is you're dealing with a browser-based UI which means mouse control instead of keyboard. This doesn't bode well for remote use.


4.6. Foscam IP Cameras

Some of you may know that I have some Foscam IP cameras that I use to monitor my garage and as a baby monitor. With MythTV it's fairly trivial to show them on the TV.

I have two cameras now, I expect more in the future and I may want to explore with some public webcams. Rather than two entries now, I've decided to create a submenu. This is easy enough, just edit mainmenu.xml to include these lines:


   <button>
       <text>Webcams</text>
       <action>MENU cams.xml</action>
   </button>

Now we need to create ~/.mythtv/cams.xml. I used library.xml as a baseline document and edited as I needed. My cams.xml file is here (with the good bits edited out):


<?xml version="1.0" encoding="UTF-8" ?>
<mythmenu name="CAMS">

   <button>
       <text>Baby Monitor</text>
       <action>EXEC vlc http://username:password@ip_address/videostream.asf --fullscreen</action>
   </button>

   <button>
       <text>Garage</text>
       <action>EXEC vlc http://username:password@ip_address/videostream.asf --fullscreen</action>
   </button>

</mythmenu>

Obviously you'll want to use your own username/password and IP address. Note that this file is stored in plaintext on your hard drive. You should not use your bank username/password on these cameras at all since they use unencrypted HTTP traffic. By storing this file, anyone who can gain access to your Mythbuntu system can figure out the password you used. By using the cameras anyone who's on your WiFi network can snoop the username/password. In short, this is nothing but the most barebones security mechanism. With an encrypted WiFi network and only allowing access to the cameras via a strongly secure SSH tunnel I'm fairly well-protected against snooping, but even if someone does break into my Mythbuntu system and steal the password, it's a throwaway password that won't buy them access to any other account.

When you select one of these entries it will pull up a VLC session in full screen mode. To exit just press <alt>-F4 to close the window and return to the Myth frontend interface.


4.7. SiliconDust HD HomeRun Dual

This is actually a powerful little device. Native Linux support works, but only in a "compile-it-yourself" fashion as near as I can tell (it's not like I looked very hard for a PPA or binary download). However, MythTV support seems to be pretty transparent.

First, consider placement. I keep my electronics in a cabinet by my TV, but it's a little cramped in there and there are a lot of cables and power wall-warts. It's on the ground floor and on the West side of the house while many of my broadcast stations come from the East. The only worse place for reception is in the basement. SiliconDust box has Ethernet out - it doesn't care how far away from my TV it is. I have a room above my garage with an Ethernet run for an IP camera that allows me to place the antenna in a small attic. Moving the tuner from the TV area to this attic got me an extra 4 channels and many of the ones I had before went from unwatchable buffering to smooth running. IMHO this Ethernet out is probably the best feature of the little box, and that's not considering the idea of remote access.

Setup of the box is stupid easy. Plug stuff into it. I have an RCA amplified OTA antenna that I plugged into the coax input, plug an Ethernet cable into it (hardwire only, the WiFi gods cringe at the idea of two HDTV streams running over a WiFi network), and then plug in the power. No real switches or buttons to deal with, just make sure the light turns green. It's useful to find the IP address of the box. The downloaded drivers will do this for you, or you can look for a MAC address starting with 00:1F:16 in your router's DHCP table or your own ARP cache (see uping if you want a utility to fill your ARP cache).

Setup of MythTV is a bit more complicated than it needs to be, MythTV has a few workflows designed by developers rather than users, so instead of a nice setup wizard to add a new card you're manually populating tables for a capture card, video source, input definitions, etc. Open up the MythTV Backend Setup and we'll get started.

First is the Capture Card. Select "(New Capture Card)" and set the card type to "HDHomeRun DTV tuner box." Under "Available devices:" you should see a random hex number followed by "-0" and "-1". These represent the two tuners. Select the "-0" and then repeat this process with the "-1". There aren't many options and the default will probably work fine, so click Finish and you're done with this step.

Now we move on to Video Sources off the main menu. Select "New Video Source", give it a name at the top (I just use Tuner1 and Tuner2). I haven't been able to get the listings grabber to work, I left North America (Data Direct) (xmltv) selected, but only really had luck with the "Perform EIT scan" checked (xmltv would look for an XML file in ~/.mythtv that I wasn't ever able to find). Again, feel free to play with the other options but the defaults should work for you.

Now we move on to Input Connections. For each of the tuners we'll need to edit the Input Connection entry. Give it a name (why so many names? I have no idea). Associate the input connection to the appropriate tuner as a Video Source, and then you can scan for channels using the default settings. Insert the found channels, then click Next/Finish to complete.

Finally, you can hit the channel editor to change the channel names, or download icons. As a warning, the icon auto download is pretty stupid, often if you have WABC-TV it won't find the icon but searching for WABC would pull up the right one. Also, the PBS station by me has about a billion variants labeled helpful things like "Create" or "Kids" - no indication of the PBS call letters.

Now you can finish out, exit the Backend config app, and rerun the database update when prompted. Hopefully your Watch TV option now works fine. Note that the default behavior for channel surfing is to just surf the listing until you actually hit Enter.


4.7.1. Troubleshooting

If the picture freezes a lot, you probably just have a poor signal. Try adjusting your antenna. A nice app to help you with this is Hdhomerun Signal Meter, unfortunately I haven't been able to get it to work with my Galaxy Nexus - but the reviews seem to indicate it works well so I'll keep playing.

I ran into an issue with picture, but no sound. It turns out I had told MythTV that my system supported a bunch of sound formats it really didn't. This one was frustrating because apparently Windows doesn't include AC3 codecs so all of the information I was able to find was around this rather than Linux related issues.


4.7.2. Using VLC to Watch TV

I may play with a frontend to make this a little cleaner, but you can stream your HD HomeRun to your Linux box (or any other box) using VLC. Here's the sequence of commands (originally found here):


# Initialize the HD HomeRun box if it was just powered on
hdhomerun_config [ip_address] set /tuner0/channelmap us-bcast
# Tune to the proper channel
hdhomerun_config [ip_address] set /tuner0/channel 19
# Tune to the proper program
hdhomerun_config [ip_address] set /tuner0/program 3
# Set up a multicast stream
hdhomerun_config [ip_address] set /tuner0/target rtp://239.255.1.1:59001 ttl=64

Now you can open VLC on your PC by opening a Network stream to rdp://239.255.1.1/ and port 59001.


4.8. Screensaver

Mythbuntu comes with xscreensaver installed. The first thing you'll want to do is extend the timeout on the screensaver to three hours or just disable it outright. You don't want the screen to blank in the middle of a movie.

If you're like me, you may be a little nostalgic for the myriad of choices you get with xscreensaver. You can install more screensavers with sudo apt-get install xscreensaver-data-extra xscreensaver-gl-extra. I have mine set to randomize every minute to a new screensaver with nearly all of them selected.

But with a short timeout you end up starting the screensaver in the middle of a viewing. With a long timeout you have to wait forever. So you can add a menu item to mainmenu.xml:


   <button>
       <text>Start Screensaver</text>
       <description>Start the Screensaver</description>
       <action>EXEC xscreensaver-command -activate</action>
   </button>

4.9. IR Input

I have a Harmony remote and I figured it would be nice to be able to control my MythTV with it. I ended up buying a cheap remote that actually ended up being just a keyboard from a driver perspective. This wasn't bad, and I'm eternally grateful to "C. Watson" for letting me know it's a Chinavision CVSB-983.

This works well enough for most things, but for some I do need to fallback onto the keyboard. Essentially now I need the trackpad for Netflix like with the Google TV I had to use it for my local media.

Unfortunately, the players want to use things like "p" for play/pause instead of the keyboard media control keys the remote sends. I may end up just replacing it with a MythTV-supported remote or splurging on a CommandIR Mini which can let MythTV control my TV and other IR devices. Fortunately, there is a workaround.

The Harmony software lets you remap keys however you want, and so does Linux. You can run a command called xev (X event) which will allow you to capture keystrokes. Run this and push a button on the remote to see what pops up. I found plenty of non-standard buttons that offer a single keycode, for example, the following is the output from a PreviousTrack keypress:


KeyPress event, serial 35, synthetic NO, window 0x3200001,
   root 0xab, subw 0x0, time 677598, (-589,-239), root:(282,234),
   state 0x0, keycode 173 (keysym 0x71, q), same_screen YES,
   XKeysymToKeycode returns keycode: 24
   XLookupString gives 1 bytes: (71) q
   XmbLookupString gives 1 bytes: (71) q
   XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x3200001,
   root 0xab, subw 0x0, time 677606, (-589,-239), root:(282,234),
   state 0x0, keycode 173 (keysym 0x71, q), same_screen YES,
   XKeysymToKeycode returns keycode: 24
   XLookupString gives 1 bytes: (71) q
   XFilterEvent returns: False

Now I can remap the key for PreviousTrack to a space which will put a bookmark in a movie I'm playing back. Similarly, the left and right arrows get mapped to rewind and fast forward, respectively (I do this part in the remote itself). More importantly, I map the Play button to p which is the play/pause toggle in Myth. I do this by creating a .xmodmaprc file:


! stop
keycode 174 = p
! play
keycode 172 = p
! Previous track - bookmark
keycode 173 = space

Lines beginning with ! are comments. The syntax of each line is the the keycode value from the xev command we ran followed by the key I want to swap it with. Note I've done something wasteful and used both Play and Stop as p - technically I could have put Stop as <ALT>-F4 but instead I just have it mimic the Play and Pause buttons. I made this choice after I programmed my remote and I was too lazy to just map the Stop button to the Play command. Code 173 is also mapped to a softkey labeled "Bookmark" which is what the spacebar does in the standard player.

To enable these commands, just run xmodmap ~/.xmodmaprc -display :0 (some of these parameters aren't necessary, but you may be SSHing into your box). This file will probably change as time goes on and I figure out which functionality I need.


4.10. To Do List

Left on my to do list are to get an Android remote working, come up with a cheap solution to support IR out so I can ditch my Harmony if I want to but still control my TV volume, work out some bugs in playing DVDs directly, and try to play BluRay discs (one item where a faster CPU may have helped me).


A. NetFlix DVD Costing

I don't watch too much TV, with a full work schedule, a young child, and writing these documents I just don't have the time. So I have NetFlix's one DVD at a time plan. This generally means that I can get 8 DVDs a month, this comes out to be $1 a DVD. But this is at maximum velocity, watch the DVD the day you get it and return it the next day. Losing Saturday delivery from the USPS will further complicate things.

For movies this tends to be worthwhile, a recent release movie is $4 for a 24-hour rental from Amazon or Google Play. It's still worth a look, sometimes you can get them for 99, TV shows are also often worthwhile with 3-4 episodes per disc, but that last disc may not have a full compliment of shows or it may be bonus information you may not care about.

In short, NetFlix DVD is still a decent deal if you have a quick turnaround time, but if you can rent it for a dollar you can save money by watching from another source.


B. About Me

My name is Jeff Bower, I'm a technology professional with more years of experience in the telecommunications industry than I'd care to admit. I tend to post with the username jdbower on various forums. Writing these documents is a hobby of mine, I hope you find them useful and feel free to browse more at https://www.ebower.com/docs.

If you've got any questions or feedback please feel free to email me at docs@ebower.com or follow me on Google+ or Twitter.