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.

I’ve a small problem with my mythtv-backend in that it will crash once or twice a week without giving a clue as to the problem, even when running it through gdb.  When restarting, it would work fine again therefore there was the need to detect a crash and restart when it happens.

This is currently been worked on for the next version of Mythbuntu through the use of upstart scripts, however I was needing a soultion before then.  This lead to the development of the script below, which checks to see if it’s running, and restart it if it’s not.

The script is limited in that you need to manually start it after the machine has booted.  I run the script within a screen console (so I can detatch it) using watch to run the script every 60 seconds.

So in screen:

sudo watch -n 60 ./keep-myth-server-alive.sh

The script:

#!/bin/bash

# Copyright (C) 2008
#       David Morris (david.morris@greenacre.no-ip.com)
#
# This program is free software; you can
# redistribute it and/or modify it under the terms
# of the GNU General Public License as published by
# the Free Software Foundation, version 2 or later.
#

if [  `ps -ef | grep -c mythbackend` == '1' ];
then
sudo /etc/init.d/mythtv-backend start

fi

The way which I was originally shown to build new nodes for OpenSG involved using the existing OpenSG build system. It usually existed of these steps

  • Putting your node code into the source dir (I can’t remember which one)
  • Re-running configure for it to be copyied to the build dir
  • Use make and sudo make install to rebuild OpenSG and re install it all

Of course if your installing binaries from the repo’s you don’t want to be doing this. Instead you’ll need something like the following to build and link against the binaries. (with the -dev packages installed)

g++ -I`pwd` -I/usr/include/OpenSG `pkg-config OSGBase --cflags --libs` `pkg-config OSGSystem --cflags --libs` -shared -fPIC *.cpp -o libOSG<nodename>

Of course you’ll need to link against other libraries if you need them.

The compiled library can then just be copied into /usr/lib and you can start using it. The above build command can easily be broken down to work with autotools as well, allowing your new node to built on other distros which make use of pkg-config and have installed to different paths.

Well I’ve cut my first teeth now with regard to Ubuntu packaging and had my 1st package accepted into the hardy release :)

The package I used was cpptest which is a portable and powerful, yet simple, unit testing framework for handling automated tests in C++. I used this testing framework for my Masters work and decided to simplify the tool chain for others to build and use my work.

It’s great after around 3 -4 weeks of learning around my job to have it accepted and I’m looking forward to getting my other two packages in the queue accepted for hardy. I’d like to thanks the MOTU’s which have helped me get this package done through reviewing it namely sistpoty, persia, apachelogger and norsetto.

Remote Wonder 2 in Mythbuntu

December 10, 2007

I’ve had a few searches for this hitting my blog and seen people having problems with it as well. I just redid mine on Ubuntu Gutsy and this should work the same. Here is what I did

sudo dpkg-reconfigure lirc

I then chose the userspace driver

sudo nano /etc/modprobe.d/lirc

Here I commented out blacklisting of the `lirc_atiusb’ module.

Once this is done you can load it with

sudo modprobe lirc_atiusb

You’ll then need to install the lircrc file to /home/<myth user>/.mythtv/lircrc

Restart and it should all work fine. I’ve attached my config files for you to check against as well. If you need more help post here or find me (davemorris) on irc.freenode.net

irw is a great little program to run in a terminal to see what buttons your pressing and tsee what they are mapped to.
/etc/modprobe.d/lirc

/etc/lirc/lircd.conf

/home/<mythtv user>/.mythtv/lircrc

I noticed the other day that Ashley Highfield rolled out some figures for the number of Linux users who visit bbc.co.uk which can be found here.

“We have 17.1 million users of bbc.co.uk in the UK and, as far as our server logs can make out, 5 per cent of those [use Macs] and around 400 to 600 are Linux users.”

When compared to the W3C statistics (EDIT it’s been pointed out to me that these are stats from visitors to w3schools.com) for OS which shows Mac and Linux usage to be within 0.5% you have to wonder why there is such a big gap between the pair for the BBC’s stats. In Ashley’s blog posting over here, he blames this low figure on the reporting system they use. Clearly this figure is wrong! An analysis of this by a former employee of Ashley can be found here.

In the mean time there is a facebook group for people who use Linux and visit the bbc.co.uk domain which already has over 600 members and an online petition which has over 1100.

Mythbuntu is released!

October 22, 2007

The Mythbuntu team and myself are proud to present the first stable release of Mythbuntu. This release is based upon Ubuntu 7.10 (Gutsy Gibbon). We would like to thank everyone that has volunteered to help make Mythbuntu reach where it is today.

Please see the Release Notes for more information on improvements from the unstable releases this cycle.

Downloads & Upgrade instructions are available on the downloads page.

Features

  • Frontend can be run from the live CD
  • Complete installations(Backend, Frontend, Backend/Frontend, etc)
  • Xfce4 Desktop Environment
  • Easily upgrade from Ubuntu Gutsy to Mythbuntu
  • Custom Mythbuntu MythTV theme
  • GUI setup of LIRC
  • Setup MythTV optimizations through MCC

Digg it at http://digg.com/linux_unix/Mythbuntu_7_10_Release_Final

OpenSG Packages for Ubuntu

October 19, 2007

UPDATE: Opensg has been accepted for the hardy release cycle and backports will be forthcoming hopefully.

Using the personal package archives over on launchpad I’ve created feisty and gutsy packages for OpenSG. The packages which are built are:

  • libopensg-core1 – Base and System libraries for users
  • libopensg-core-dev – Base and System libraries for developers
  • libopensg-qt1 – WindowQT libraries for users
  • libopensg-qt-dev – WindowQT libraries for developers
  • libopensg-windowx1 – WindowX libraries for users
  • libopensg-windowx-dev – WindowX libraries for developers
  • libopensg-glut1 – WindowGLUT libraries for users
  • libopensg-glut-dev – WindowGLUT libraries for developers
  • opensg-tools – fcdEdit and actorEdit
  • libopensg-doc – User and developer docs

The scripts used to build it are in the source package so if you apt get them. A launchpad team has also been created to help manage the packages along with providing a team to assign bugs with the packages to when reporting them.

To install OpenSG you’ll first need to add the ppa your /etc/apt/sources.list file.

For Feisty Fawn :

deb http://ppa.launchpad.net/opensg/ubuntu feisty main restricted universe multiverse
deb-src http://ppa.launchpad.net/opensg/ubuntu feisty main restricted universe multiverse

For Gutsy Gibbon :

deb http://ppa.launchpad.net/opensg/ubuntu gutsy main restricted universe multiverse
deb-src http://ppa.launchpad.net/opensg/ubuntu gutsy main restricted universe multiverse