MythTV and a TBS HDTV (DVB-T2) Card

HDTV cards with Linux support are fairly few and far between. Although TBS support Linux, you have to compile the driver yourself.

(and again every time you update your kernel).

I Use mine in a MythTV server, running Mythbuntu 14.04

Quad core AMD 5350 Kabini processor, Asus  AM1-A miniITX motherboard, 4GB RAM, and a TBS 6280 HDTV PCIe Dual DVB-T2 tuner card.

I found that to get smooth 1080p video on the device’s screen, , the proprietary AMD drivers were necessary.

MythTV works well, I am using Kodi (XBMC) on devices around the house for streaming.

Downloading and compiling TBS HDTV card drivers

First you need to add the tools: Zip, GCC and headers:

sudo apt-get install p7zip-full unzip build-essential linux-headers-generic-$(uname -r)

TBS driver downloads:
latest one:
http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v150525.zip
or paste this into a terminal:
wget http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v150525.zip

Some people have reported problems with the latest driver, here is where to get an earlier version:
http://www.tbsdtv.com/download…
or paste this into a terminal:
wget http://www.tbsdtv.com/download…

In terminal (assuming you are in your home directory, and you downloaded the TBS driver into Downloads)
mkdir tvdrivers
cd Downloads
for the latest version:
cp tbs-linux-drivers_v150525.zip /home/tvdrivers

cd /home/tvdrivers
unzip tbs-linux-drivers_v150525.zip
tar xjvf linux-tbs-drivers.tar.bz2
cd linux-tbs-drivers

for version 141019:
cp
tbs-linux-drivers_v141019.zip /home/tvdrivers

cd /home/tvdrivers
unzip tbs-linux-drivers_v141019.zip
tar xjvf linux-tbs-drivers.tar.bz2
cd linux-tbs-drivers

for both versions:
check for version (32bit or 64bit)
uname -a
for 32 bit:
sudo ./v4l/tbs-x86_r3.sh
for 64 bit:
sudo ./v4l/tbs-x86_64.sh
You should see “TBS drivers configured for (32bit or 64 bit) platform”
sudo make

go and make a cuppa
once complete :
sudo make install
and when complete, reboot.

v4l files are stored at:
/lib/modules/(your kernel version)/kernel/drivers/media
If you have problems, it may be worth clearing this directory before compiling.
You can find out your kernel version with the command:
uname -r
You can make sure you have the correct kernel headers with the command:
sudo apt-get install linux-headers-$(uname -r)

More info and links here:
http://linuxtv.org/wiki/index….

Advertisements

An alternative to LIRC for MythTV remotes

What I don’t understand is why nobody else has come up with this and posted it.
MythTV has been both a bane and a joy over the years, the main bane being getting the remote to work properly. The most annoying and recurring symptom is that most of the keys work, but for some reason, the most important, the “OK” key never does.
The latest kernel now has ir keymaps built in, unfortunately this means that my carefully crafted LIRC configuration for my Hauppuage remote no longer works, and the default keymap settings are as useless as ever, Basically, the 1-9 keys, volume controls, up, down, left and right work, but nothing else.
There must be some well hidden documentation about this somewhere, but after much use of Google and reading webpages, I came to the conclusion that to get the best results without using LIRC as a “bridge” I would need to configure my remote as a keyboard.

To do this, I basically ignored all of the internet posts and guides, apart from the ones that gave me the clues to where the keymap files were kept.
First I installed the ir-keytable package from the repositories.
This also installs a selection of ir keymaps in /lib/udev/rc_keymaps

Using the ir-keytable, command,  you can find out which drivers are in use and which keymaps they use.

on my system, it returns:

Found /sys/class/rc/rc1/ (/dev/input/event7) with:
Driver (null), table rc-dib0700-rc5
Supported protocols: NEC RC-5 RC-6
Enabled protocols: RC-5

I started by looking at the relevant keymap (dib0700_rc5) in /lib/udev/rc_keymaps, and tested the remote to see what buttons actually worked.
Then I ran ir_keytable -t > ~/devtest.txt, pressed every key on the remote in sequence from left to right descending in rows. This gave me a text file with the scancodes and their key attributes.
I then saved a copy of the dib0700_rc5 keymap, and edited it.

The first entry that I tried changing was KEY_OK.

I changed this to KEY_ENTER, rebooted, and lo! The OK key worked! I could now select items in the menus!
So basically, I edited the dib0700_rc5 keymap so that every key corresponds with a key on the keyboard, then going through the key setup in MythTV’s frontend creating links where necessary.

Unfortunately, there are a lot of keys already mapped to functions in MythTV, so this last bit was a little hit and miss, as some symbols or combinations such as CTRL+P don’t seem to work, but finally I can use every key on my Hauppuage remote. I have an MCE remote as well, but I haven’t bothered to do that one yet.
My Keymap is here

Yes I know that using devinput with LIRC as a bridge is more elegant for applications that support LIRC, but I only use a remote with MythTV, and the LIRC solution seems just too convoluted and unreliable to be worthwhile, too many links in the chain.

Note: you need to cold boot, i.e.shut down the PC and then restart it, for the new keymap to be read. I found that the remote would not work after a warm reboot, not sure why.