Style Cleanup Required
Candidate for Deletion
Getting my Nova-T working under Ubuntu
This took me a long time to get working, so you will need some patience before starting. I don't think the problems were the fault of any particular element of the packages/patches required, rather that I didn't read the instructions properly. And thereby hangs a tale. As far as I can tell there isn't really any "proper" documentation on how to get these cards working under linux. There are lots of bits of documentation, a lot of which are very out of date, and some websites you might expect to be packed with help offer little to the end user.
Hopefully this will get you going.
Please, please please update this page as necessary, either by correcting my mistakes, suggesting better ways of doing things, or just adding comments to say if this has worked or not.
Part 1. Pre-requisites
As the Ubuntu kernel stands at the moment I don't think is possible to use the Nova T. As far as I can tell various kernel patches must be applied before the Nova T will function properly, and these patches cannot be applied against the Ubuntu kernel source because of the patches the Ubuntu developers have already applied. (I would imagine this will be resolved fairly soon). So, you're going to need to download a plain vanilla kernel in order to apply the patches correctly (all this is described below).
If you're a newbie, you might be rightly worried. Have a quick read of this: https://www.ubuntulinux.org/wiki/KernelHowto
Don't do any of what it says, just read it, to get you familiar with some of the terms. Compiling a kernel is actually pretty easy. Once you've done it 3 or 4 times it will start to become fun!
You'll probably also want to install mplayer. See this page: RestrictedFormats. Personally I compiled it from source as none of the other options worked for me (surprise!). If you choose this route and get stuck, let me know, I might be able to help.
We also assume that you know how to work with linux at the shell prompt (or 'command line'), for things like moving files.
All the commands you'll need to type are listed, and will appear like this:
this is a command you should type
Part 2. The Procedure
You'll need to install a few packages before you can compile your kernel, so do this:
sudo apt-get install build-essential fakeroot kernel-package
Download the kernel source: http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.10.tar.bz2
At the time of writing the latest official kernel is 2.6.10. If there is a newer version listed you need to make sure you download the correct patches (see below).
In these examples it is assume you save it to ~/software/kernel/source/2.6.10/
Download the patches:
This file is contains the DVB patches for the 2.6.10 kernel version. If you are downloading a different kernel source check on the bytesex website for newer patches. The 2.6.12-rc4 kernel doesn't need to be patched, it works fine without the patches from bytesex.org.
Save this file to somewhere like ~/software/kernel/patches/dvb
Now we need to uncompress the patches. Change to the directory where you saved them
tar xvzf All-2.6.10.diff.gz
Now (move or) copy the kernel source to the /usr/src directory. Change to the directory where you saved the kernel source to, in our case:
Move (or copy) the bz2 (compressed) file to /usr/src
mv linux-2.6.10.tar.bz2 /usr/src
Change to that directory
and then uncompress the kernel source
tar xvjf linux-2.6.10.tar.bz2
Make sure you don't have a directory called 'linux' already (if you have delete it, or rename it) then:
ln -s linux-2.6.10 linux
to create a virtual directory called linux (the default location for the kernel source. Lots of things assume this is where the source will be)
Change in to the linux directory
and patch it with the bytesex All 2.6.10-3 patch
patch -p1 < ~/software/kernel/patches/All-2.6.10.diff
There should be no errors. If there are make sure your using an unmodified source for linux, e.g. not the pre-patched ubuntu ones. (That is, you really do need to download the kernel source from the location above, apt-get installing the source probably won't work)
Copy the stock Ubuntu config file to get the default Ubuntu kernel settings. (Which drivers etc, to build)
cp /boot/config-2.6.10-3-686 .config
to use them.
Now, we're nearly ready to compile a custom kernel! I prefer to use a good old-fashioned text front end when I'm configure the kernel, you might like to use gconfig, or xconfig instead of menuconfig.
Now things get a little complicated. You need to ensure that your IDE (assuming you have IDE controlled hard disks. If you use SCSI or SATA then adapt this accordingly) driver are compiled in to the kernel, not as modules. In menuconfig that means that the modules need to have a * next to them, not an M.
You also need to ensure that your file-system stuff is in the kernel, not as modules (e.g. Ext2, Ext3, RiserFS etc).
If you're brave use this chance to remove any stuff from the kernel you don't need (e.g. PCMCIA, ISDN it will speed up the compile slightly). See the note below about what a bad idea this is.
EXAMPLE: How to include IDE Drivers in to the kernel.
In menuconfig, browse through the menus thus....
Device Drivers - ATA/ATAPI Y to ATA/ATAPI Support Y to Enhanced ATA/ATAPI Y to Include IDE/ATAPI... Y to IDE/ATAPI CDROM Y to IDE/ATAPI Floppy Y to generic/default IDE... Y to Generic PCI IDE... Y to Your IDE Controller
(if you don't know what your IDE chipset is type dmesg|less, and look at the top for something like this:
ACPI: (supports S0 S1 S4 S5) RAMDISK: cramfs filesystem found at block 0 RAMDISK: Loading 4528KiB [1 disk] into ram disk... done. VFS: Mounted root (cramfs filesystem) readonly. Freeing unused kernel memory: 164k freed NET: Registered protocol family 1 Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx SIS5513: IDE controller at PCI slot 0000:00:02.5
Here you can see I have an SIS5513 IDE Controller, so I compile this in to the kernel NOT as a module).
The important bits to make sure you build (as modules) in to the kernel to get your Nova T working are found here:
Device Drivers Multimedia Devices Video For Linux Conexant 2388x (bt878 successor) support DVB Support for cx2388x based TV cards Digital Video Broadcasting Devices DVB Core Support DVB Frontend - Conexant CX22702 based
You can build support for these things into the kernel but if you build the "DVB Support for cx2388x based TV cards" statically linked into the kernel (not as a module) then udev may fail to create the /dev node for dvb support. There is a workaround, you can use a script like this to create the /dev nodes but it has to be run as a bootscript every time you reboot as udev deletes everything when you power down. It also removes the /dev/dvb folder so that script needs to be altered slightly to work properly. Near the top add the line mkdir /dev/dvb
More about udev later, back to the kernel.
If you've got big balls you might as well remove (i.e. say N) to all the other IDE controllers etc not installed in your system. This is very risky. You could get yourself in to a real mess doing this. If you don't know what you're doing, it is a much better idea to just leave it alone!
OK, Kiss your computer good bye. This could be the last time it ever works again! (I really am serious about not playing with your kernel, if you don't know what you're doing!)
From here on in, the instructions get a little less verbose. I'd just finished editing this whole thing when my computer threw a piston or something and I lost the whole lot. I'm not going to redo all that, I can't be bothered.
Maybe one day I'll tidy it up, or maybe you'll do it for me?
Right, it's time to start compiling your kernel:
fakeroot make-kpkg --append-to-version=.ck001 kernel_image
What this does is: fakeroot makes the root environment that make-kpkg expects in order to work properly. make-kpkg does the actual compile of the source in to the kernel image. --append-to-version= gives your kernel a unique identifier (in my case Custom Kernel 001) and kernel_image tells make-kpkg that it's making a kernel image.
Depending on how much you've removed/left in this could take a long time. Make a cup of tea, take the dog for a walk, but don't just sit there and watch. You should also drink your weak lemon drink NOW. There may not be time later.
While that's compiling, I thought I'd have a little moan...
Now, don't get me wrong, I think that the linuxtv guys have done an amazing job in getting these drivers written (especially when you consider how little help hardware manufactures give linux driver-writers), BUT.. it's taken me since 11am this morning to get this far. It's now half past 10 at night and I still haven't got close to getting this card working. I've tried compiled about half a dozen kernels now, and I still haven't got one to patch and compile correctly, and I don't know if what I've done so far is even going to work or not. I've got my fingers crossed. Why the bloody hell isn't this easier?!?!
I suppose the quick answer is because no one has bothered to write a decent howto. If they have I can't find it. What I've worked out here has been hacked together from various little out-dated clues I've found scattered across the million corners of the internet. I would have thought the ideal place for some useful docs would be the linux tv website. But it's not. The site contains a million broken links, the mailing list archive seems to have moved without telling google, the basic documentation is non-existent, OK, if you want the API details your in luck. There's a sodding great PDF full very in-depth data. Great if you're a programmer, no use if your me (nor, I assume since your reading this, you).
While your waiting for that, you might as well download the DVB utils.
Download this: http://linuxtv.org/downloads/linuxtv-dvb-apps-1.1.0.tar.bz2
tar xvjf linuxtv-dvb-apps-1.1.0.tar.bz2
go in to the directory created when you untar the file and type:
that bits very easy!
Once the kernel compile has finished:
cd .. sudo dpkg -i your_kernel_name.deb
This will install it ready for booting from and update grub.
Before you reboot you need to do the following to make sure udev creates the dvb devices for you. Edit /etc/udev/udev.rules:
gksudo gedit /etc/udev/udev.rules
put these lines in it
# DVB Support KERNEL="dvb*", PROGRAM="/etc/udev/dvb.sh %k", GROUP="video", name="%c"
Now create the /etc/udev/dvb.sh script
sudo nano -w /etc/udev/dvb.sh
put the following in it:
/bin/echo $1 | /bin/sed -e 's,dvb\([0-9]\)\.\([^0-9]*\)\([0-9]\),dvb/adapter\1/\2\3,'
This script should enable the dvb devices in /dev by creating a /dev/dvb/adapter0/dvr0 directory at bootup. You need to make the file executable by all users:
sudo chmod a+x /etc/udev/dvb.sh
OK, Show Time! Reboot. When you see the grub bit appear hit escape and you will see a menu. In this list should be your new kernel. Choose it, it enter and hold on tight.
If you get to the login screen, Taaaa daaaaa! You've done well.
Mine is sort of working at this point. How do I know?
In the linuxtv-dvb-apps-1.1.0/util/scan directory, run:
./scan dvb-t/uk-SandyHeath -v -v -5 channels.conf
obviously change uk-SandyHeath to your transmitter. Have a look in the dvb-t folder, hopefully you'll find your transmitter in there. If not, http://www.bbc.co.uk/reception/transmitters/tv_trans/index.shtml
Hopefully, if all of the above stuff has worked, you should now start to see some familiar names whizzing up the screen.
If not. Check your ariel, then check it again. I guess that the inside of the computer is very noisy (electrical noise) so you're going to need a good signal in the first place. I live about 20 miles from Sandy Heath, and I'm struggling to get a lock on an Ariel that works perfectly on the set top box downstairs.
If the scan worked it will have spat out a channels.conf. This needs putting here:
mkdir ~/.tzap cp channels.conf ~/.tzap/
Now we can try tuning (or zapping) to one of the channels, and nearly watch a bit of TV. From the linux-dvb-apps-1.1.0/util/szap directory you'll need to run the tzap program. You might want to move this somewhere a little more convenient, like somewhere on your path.
So, let's tune to BBC ONE (or BBC ONE Scot if you're in Scotland), since that's normally got a good signal.
./tzap "BBC ONE"
tzap uses the channels.conf file you've just copied to ~/.tzap/ by default.
After a few seconds you should see "FE_HAS_LOCK" scrolling up the screen. Once this has appeared, you're very nearly in business. This means that the Nova-T has locked on to the signal and is receiving the broadcast.
Now we need to de-mux the stream to extract the BBC ONE stream, then we can pipe it through mplayer to look at it.
Download and make the dvbstream program (which has got many other good uses, like pipeing your TV feed over your network, cool huh?) like this: create yourself a dvbstream directory, and change in to it, then:
cvs -d:pserver:firstname.lastname@example.org:/cvsroot/dvbtools login
(just hit enter when asked for a password)
To download the source:
cvs -z3 -d:pserver:email@example.com:/cvsroot/dvbtools co -P dvbstream
If you're in the UK, type make, if not you'll need to look at "dvb_defaults.h"
Edit your ~/.tzap/channels.conf file and find the BBC ONE entry. It should look like this:
Look at the end of that line, you'll see some numbers:
The first two are the "location" of the video and audio streams for BBC one within the whole group of signals (mux). Also, note the QAM number, in this case 16:
And the FEC numbers:
With this information you can get dvbstream to extract the bits you want from the mux, and this signal can be passed to mplayer (or ffplay or xine) to decode and display.
./dvbstream -o -ps 600 601 -qam 16 -cr 3_4 | mplayer -cache 4096 -autosync 30 -
If this doesn't work another solution is to use tzap. Tzap has a switch "-r" that when used redirects the stream to /dev/dvb/adapter0/dvr0. So I do a tzap -r your_channel in one console and a mplayer /dev/dvb/adapter0/dvr0 in another, it will work.
./tzap -r BBC ONE mplayer /dev/dvb/adapter0/dvr0
If this doesn't work another thing to try is:
./tzap -r BBC ONE xine stdin://mpeg2 < /dev/dvb/adapter0/dvr0
If you find you don't have a /dev/dvb/adapter0/dvr0 directory then it means the dvb.sh that we created earlier didn't work. The solution is to run a script called "make_extra_nodes.sh" which you can find using google.
To record the stream, send it to a file. In one terminal do ./tzap "BBC ONE", wait for the lock and then in another terminal do:
./dvbstream -o -ps 600 601 -qam 16 -cr 3_4 > test.mpg
You can watch the recording as it's playing (which many PVR's call "chase play"). In a 3rd terminal do:
ffplay stdin://mpeg2 test.mpg
Note: Without the "stdin://mpeg2" part, I don't get any audio.
If it works, well done. You're there.
Well, you're on your own now. Maybe one day I'll come back and finish this properly.
There are also radio channels you can listen to. You'll need to install mpg123 (if you haven't got it already) and you'll need to compile ts2es from the libdvb package http://www.metzlerbros.org/dvb/index.html Download the libdvb tarball, make it then copy dvb-mpegtools/dvb-mpegtools_main to /usr/bin and make a symbolic link pointing at it called ts2es
tar xzf libdvb-0.5.5.1.tar.gz cd libdvb-0.5.5.1 make sudo install -m 755 dvb-mpegtools/dvb-mpegtools_main /usr/bin ln -s dvb-mpegtools_main /usr/bin/ts2es
Now get a copy of the tune-radio perlscript http://www.doc.ic.ac.uk/~jak97/dvbstream/tune-radio
Put it in /usr/bin and make it executable
sudo install -m 755 tune-radio /usr/bin
Then you should be able to listen to the radio with a command like
tune-radio "BBC Radio 1"
You can get the names of the radio stations available from ~/.tzap/channels.conf
For complete instructions on installing MythTV, IVTV, and LIRC (used with remote controls) on Ubuntu 5.10, see InstallMythOnUbuntu.
Setting up a PVR on your computer can be a huge plus - as Freevo does not currently work under Hoary (Note: Problem is wrong version of python, more info here: http://ubuntuforums.org/archive/index.php/t-17217.html), the main candidate is Myth-TV which is available in the Multiverse repos (version 0.17.x at time of writing). It was very fiddly to install and I adapted the howto from http://www.slash32.com/ubuntu-myth.html . Go there and follow the entire phase 1 then return here for the rest of the installation.
If you like in the UK (and basically all non-US countries), you should install xmltv:
sudo apt-get install xmltv xmltv-util
OK - so you should have mysql running, a different root password for the mysql database and all that. Well now let's install mythtv. IIRC just selecting the mythtv package in synaptic should install the basic setup (I don't use the extra plugins as MythTV is running on my normal box but if you want the extras select them).
You will be asked for the MySQL adminstrator's password so enter the one you just set up with phpmyadmin a few minutes ago. When it's finished, open a terminal and set the mythtv user's password. This is up to you of course:
sudo passwd mythtv
I also found I had to allow mythtv access to the X server but for some reason it wouldn't allow me to limit it to only him (bugs I think) this is risky so remember to reverse it _immediately_ after you've finished using it with a xhost -. Do this at your own risk!
sudo xhost +
Now remember getting this earlier on?
BBC ONE:634167000:INVERSION_AUTO:BANDWIDTH_8_MHZ: FEC_3_4:FEC_3_4:QAM_16:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE: 600:601:4173
Well write what *you* found down on a piece of paper - I mean everything (bar the final three numbers). the first number is the frequency which is crucial in the setup of mythtv. The rest will also be useful as despite setting them to auto, mythtv is not that good at detecting the settings automagically.
After this change to the mythtv user and run the setup program
su mythtv mythtv-setup
This bit is relatively easy. Go through all of it sequentially - section 1 is up to you, in section 2, you'll want to select a DVB card for the Nova-t, section 3 is a little trickier. If you're in the US, you will need the Zap2it account (detailed in the other howto) but in the UK, you just select the UK option then switch to the console (Alt+Tab) and tell the program what channels you want. A bit of a pain but I don't know of any other option... It will appear stuck so be sure to check the console (and this is why you shouldn't run it without a console).
section 4 - basically tie up the Nova-T card with the source.
Section 5 - this is the difficult bit...Select scan for channels and keep on selecting what you think is right for your setting (shouldn't be too complicate) until you have to give them the frequency. That's on the piece of paper you have:
BBC ONE:641833330:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_3_4:QAM_16:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE: 600:601:4173
Basically fill out all the options based on the above string (*Remember* your string is most likely very different from mine and of course it doesn't have to be BBC - whatever is a 24 hour mainstream channel should do the trick). So scan it and it should find all the Digital terrestrial TV channels around. If it doesn't (usually that's characterised by a no lock signal), recheck the setting and check the file for another frequency to test.
OK that's it for the setup - I found that the scan wasn't that great. I got lots of dupes and ghost stations but I couldn't delete them there. I did that via PHPmyAdmin. Do that at your own risk but if you know what you're doing it should be fine...
I've found that the setup of MySQL doesn't always work so I have to clear things out with this (this may not be necessary but won't do any harm):
mysql -u root mysql -p <Enter Password> mysql> UPDATE user SET Password=PASSWORD('mythtv') WHERE user='mythtv'; mysql> FLUSH PRIVILEGES; mysql> quit
Now let's clean things up a little to get test if it's working. Do the following as your normal user (i.e. not mythtv):
cp /home/mythtv/.mythtv/ant.xmltv ~/.mythtv/ sudo chown -R <normal user> ~/.mythtv sudo chmod -R 755 ~/.mythtv sudo mythbackend & sudo mythfilldatabase mythfrontend
And it should be working fine.
Other things to watch out for
evms will not be patched with the ubuntu patches. As such you might have trouble mounting your secondary disk drives. I fixed this by moving the hotplug to S22 and changing my fstab to mount /dev/evms/hdb1 instead of /dev/hdb1.
If you run the NVidia drivers, they will no longer work out of the box and X will not startup with the new kernel. The solution is to compile your own drivers with the latest NVidia drivers but I still have to recompile them after each reboot. No solution found yet!
It is possible to tune to the radio stations. I've sort of got it working, but not properly.
This will need to be compiled against the new kernel source. I haven't tried it yet. Anyone got it working?
"sudo xhost +" do you try "sudo xhost + mythtv:local" ?? i always use sudo xhost + root:local