MythTV DVB udev rules

April 1, 2014

Recently my tuner cards have been swapping the IDs assigned to them by udev which has caused MythTV to miss some recordings (it was attempting to record HD content on an SD card)  This is easy to solve using udev rules to create symlinked adapaters that I could use in MythTV instead.  Info on how to do this can be found at http://www.mythtv.org/wiki/Device_Filenames_and_udev#Example_DVB_udev_Rules_file

 

My udev file is repeated below, I have a Nova-T SD tuner card and a TBS 6280 Dual Freeview HD, for some reason it would not work with and underscore between adapater and tbs1 in /dev/dvb/adapter-tbs1/

 
# /etc/udev/rules.d/10-dvb.rules
#
# To Identify serial nos etc for a Device call
# udevadm info -a -p $(udevadm info -q path -n /dev/dvb/adapter0/frontend0)
#
# use the following to test
#
# udevadm control --log-priority="debug-verbose"
# udevadm test /class/dvb/dvb0.frontend0
#
# http://www.mythtv.org/wiki/Device_Filenames_and_udev
# Create a symlink for single tuner Nova T device
SUBSYSTEM=="dvb", ATTRS{vendor}=="0x14f1", ATTRS{device}=="0x8802", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter_nova-t1/%%s $${K#*.}'", SYMLINK+="%c"
# Create a symlinks for both tuners of TBS device
SUBSYSTEM=="dvb", ATTRS{vendor}=="0x1131", ATTRS{device}=="0x7160", PROGRAM="/bin/sh -c 'set -xv ; K=%k; K=$${K#dvb}; N=$${K#*.}; if [ ! -e /dev/dvb/adapter-tbs1/$N ] ; then printf dvb/adapter-tbs1/%%s $${K#*.}; else printf dvb/adapter-tbs2/%%s $${K#*.}; fi ; exit 0'", SYMLINK+="%c"

During the summer I took the opportunity to play with the Sonos music system in a local hi-fi store.  I was very impressed with the idea of been able to play back my collection of digital music in various rooms of my house, either synchronized together in a ‘Party’ mode, or simply different music in different rooms.  Added to this the ability to connect to Napster, Spotify, Internet radio and it’s simple interface which I felt non technical users would easily be at home with.

However I was struck with two concerns.

1.)    Why do I need yet another remote sitting around at home when I could pick up a small tablet or use my phone as the remote. (Sonos have since released an Andorid controller alongside the existing IOS version)

2.)    Since I already make use of MythTV I already have a computer that is always turned on in the lounge, can’t I just make use of that instead?

So I set about seeing if there was a software client for the Sonos system and drew a blank.  They don’t provide one for any OS and expect you to buy hardware for each room at ~£280 for a standalone box to feed into an amp.

So the next task was to look into other products which had a similar functionality set where I came across the Logitech squeezebox system.  This works by running a Squeeze server on your NAS (with support from NAS providers) which your various clients connect to.  These clients can either be hardware clients or software clients.  Softsqueeze is an open source java client which I have been using for a couple of months on my MythTV frontend without a problem.  Logitech have also provide free of charge an Android controller which is able to control the various clients located on your network.

Whereas the Sonos appears to be aimed at the audiophiles, the squeezebox system appeals to the more general consumer, and thus has a lower price point of ~£100 for a standalone box (Logitech Squeezebox Duet wireless media receiver).  In addition they also sell hardware which consists of a built in digital amp coupled with speakers (Boom and Radio).

After using the two software clients in my house I am very impressed with the functionality and ease of use of the product, it fills the various requirements I had of been able to make use of my digital collection around the house and been an easy to use solution. I’m currently unable to comment on the hardware available from Logitech however I fully intend on purchasing the Boom or Radio for use within my kitchen.

Android remote for Banshee

August 19, 2011

Ever since I got my Android phone I’ve been looking at ways for it to control my Ubuntu based HTPC and my Yamaha AV reciever.  My current setup uses Mythtv on Ubuntu, however I have issues with Mythmusic so have been using Rhythmbox.  Controlling MythTV is nice and simple using MythRemote and it works without any problems for MythTV features, however what I was missing was an easy way to select music without the TV turned on.

After a few hours searching and playing with a few applications I settled on using Banshee as my music player and making use of Banshee Remote along with a small extension for Banshee to allow it to be controlled.  Initial use has been positive, the features are a bit limited at the moment in that it doesn’t support Internet radio and playlists for instance but lets see if I can find some time to improve it a bit.

RMS Talk

March 8, 2011

I went to the Richard Stallman talk tonight on `Copyright vs Community in the Age of Computer Networks’ which was held at Sussex University.   I must say I was impress, I was entertained for the 2hr duration and questions afterwards.

After a brief introduction on what is free and non-free software, part of which how he introduced the concept of the 4 software freedom rules, and then how things such DVD and Blu-Ray take away these freedoms from us.  Following this he discussed the history of copyright and how it used to be applied when it was invented and through the ages to today.  Proposed his own solutions to how long copyright should last for as well as how to provide funding for entertainment.

If you catch a chance to see him I would really recommend it.

UPDATE:

More in depth review and audio recording here – https://www.martineve.com/2011/03/09/richard-stallman-at-the-university-of-sussex/

Just sharing a one line I’ve used to change the domain for my email address throughout the various source code files I’ve contributed to at work.

First of all I get a list of all the files which match my old email address, which I then strip of svn specific files and binaries.

grep -HR "<david.morris@greenacre.no-ip.com>" * | grep -v Binary | grep -v .svn

Then for every result I grab the filename with

cut -f1 -d:

For every filename I use sed to replace the email domain, which I then redirect to a temp file.

sed 's/greenacre.no-ip.com/code-fish.co.uk/g' "$file" > "$file".new

Then we need to move the new file over the old file with

mv "$file".new "$file"

So all combined and in a for loop it looks like

for file in `grep -HR "<david.morris@greenacre.no-ip.com>" * | grep -v Binary |
grep -v .svn | cut -f1 -d:`; do sed 's/greenacre.no-ip.com/code-fish.co.uk/g'
"$file" > "$file".new; mv "$file".new "$file"; done

sussex@mailman.lug.org.uk

So I finally made the mistake which happens when your playing around with sudo and manually deleting development libraries, I manged to delete the entire contents of /usr/lib

Luckily a co-worker was running the same system and I had a couple of terminals open so I was able to restore the key libs for me to restore basic functionality.  Now I have the problem of fixing the packages which are broken, without knowing what are broken.

Does anyone know of a nice simple way to get everything reinstalled?

I noticed that a new feature had been added to qemu-img which allowed for copying a snapshot out of a qcow2 image to become it’s own qcow2 image.  This would allow me to make live snapshots of my running KVM instances and archive them off to another machine.  I got around to testing it this morning and it appears to work fine, streaming back “Big Buck Bunny” whilst archiving off my test machine resulted in only a couple of slight (0.5 sec maybe) pauses.

I’ve produced a small script which allows me to make a backup of the current image, it’s available here, note since I’ve had to compile head of qemu-img I’ve chosen not to overwrite my Lucid version, and have instead called it qemu-img2.

I had a need at home to convert some out VHS movies to digital so I purchased myself a WinTV-PVR-150 MCE.  This would enable me to play video from a VCR, outputting via a SCART cable which split into composite video and audio.  Hardware encoding of the analogue signal enabled the captured input to easily be transfered to a digital file (mpeg2).  As usual from Hauppauge linux support is excellent with the card fully supported out of the box with Hardy.

To take the input from the card and save it into a file I simply needed to do:

     cat /dev/video /path/to/file

To switch between the various inputs on the card I need to use the following commands (v4l2-ctl is available in the ivtv-utils package):

     v4l2-ctl -i 0    for the tuner
     v4l2-ctl -i 1    for svideo
     v4l2-ctl -i 2    for composite

All in all I found the card very easy to use for my purpose, and will now be looking to use it within my Mythbuntu installation.

I’ve mentioned OpenSG on this blog.  It is a scene-graph based API I use at work for rendering of 3D scenes.  As part of these scenes you can create textures on these objects, which are basically pictures.  Well my co-worker, Karina, has produced some code for displaying video on these textures, which is really cool.

We’ve been playing around with video playing over our tiled wall cluster both playing just a video, or wrapping the video around an object such as a sphere.  We’ll be releasing the source code for it soon on our website along with some other cool things we’ve been producing.  But before hand I’d just like to show you a picture of it running the Big Buck Bunny video (which is cool project as well).

The OpenSG packages within Ubuntu Hardy don’t contain any of the contrib directory functionality been built.  These aren’t prebuilt due to them been work in progress or licensing issues.  The ply contribution is restricted due to it’s license to non commercial work only, so it needs to be built outside of the packages distributed.

Normally this would be built and stored within the libOSGSystem.so library, requiring the the library to be built again, which takes a while 🙂  So instead I’ll show you how to build it as a separate library for you to link against in your applications.

Within the directory containing the source code, the following command will build it as a shared library called libOSGPly.so.

g++ OSGply.cpp  OSGPLYSceneFileType.cpp -I/usr/include/OpenSG/ `pkg-config OSGSystem
 --libs --cflags` -shared -fPIC -o libOSGPly.so

This then needs to be copied to your system path so the linker can find it, so:

sudo cp libOSGPly.so /usr/lib/.

The header files then require installation, so:

sudo cp *.h /usr/include/OpenSG/.

Now all you need to do is add -lOSGPly to your linker options to use the library.

I’m sure the same trick can be used with the other contrib features if you wish to enable them easily.