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.

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.

OpenSG Browser Plugin

June 29, 2009

Well the summer has finally arrived, and I’ve finally got around to publishing this on the research groups website.  It is a small application making use of the Qt4 browser-plugin API to provide an OpenSG canvas within a web browser.  It wouldn’t take much effort to make it easily installable for users.  (Just statically link the whole thing into a single binary I’m guessing)

The advantage of using OpenSG rather than OpenGL as a canvas for web3d graphics is that you can build upon the scenegraph, take all of it’s functioanltiy, rather than you worrying about creating file loaders etc.  The URL for the plugin is http://novellab.brighton.ac.uk/?q=projects/opensgplugin

P.S. If anyone is able to help me solve https://bugs.launchpad.net/ubuntu/+source/qt4-x11/+bug/389441 it’ll be great.

gsoap and fedora

August 6, 2008

Here is a quick tutorial on how to access the SOAP interface for a fedora repositary.  (For more info about fedora see here.)

We need the gsoap package for Ubuntu 8.04 Hardy. So:

  sudo apt-get install gsoap

Once installed we use some tools called wsdl2h and soapcpp2 to create stubs for us.  So:

 wsdl2h -c -o fedora-a.h http://www.fedora.info/definitions/1/0/api/Fedora-API-A.wsdl

 (You can use -r <proxy> in the wsdl2h command if your behind a web proxy)

 soapcpp2 fedora-a.h

Then open soapClient.c in your favorite editor and replace all occurrences of localhost with the hostname/ip address of your server.

We need a simple application which allows us to make use of these stubs.  This can be found here.  You’ll need to change the username and password to match what you have configured on the server.

The application then needs compiling which is easily done with the following command.

 g++ simple-client.cpp soapC.c soapClient.c /usr/include/gsoap/stdsoap2.c \
 -o simple-soap-client

This applications should then be able to connect to your fedora server and print out the information describing your repository.

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).