NOTE: this is a legacy post ported from the old blog platform for archiving purposes
Woo hoo! I finally managed, after several months of attempts, to get this old laptop I had lying around to output video to my TV screen! This was the trigger, this is where it all started, this is where I thought: what potential does this have?
I was googling around for things I could put on this machine but, due to the age and little power it has, my options were limited. The laptop is a “Mitac 7521P”, whatever that is, with a 1GHz Pentium III (Coppermine), 256MB RAM and 20GB HDD. The interesting thing is that almost every piece of hardware in this laptop is made by SiS, which is pretty handy if you’re Googling for information because it’s all in one place.
I had a pretty good idea what I wanted this machine to do: play videos, music and possibly TV, what I had to find out is how. Some might say it’s not your ideal media centre, and I’ve yet to conclude, but I thought it was rather handy that an old laptop with the worst specs I could imagine (ok, let’s not get silly here) could have a S-VIDEO output socket.
I decided to start writing this half-way through the process of making this Media Centre so some of the verb tenses will be mixed up, my appologies.
Driver in, TV out
If you’ve come across this page from Google, you may even be wondering how I got this laptop to output to the TV :) Well I had to pay for it! Literally. In Windows, you need to use the SiS630/730 drivers that they _used_ to provide. Yes, that’s right, the new version of the driver won’t work, and the only way I could find one that did was to buy it from DriverGuide. You can download it for free email me if you want it.
So I made it work, I could watch things happen on a big screen… or could I? Here lay the next brick wall: in Windows, the SiS630′s TV-out function (PAL) leaves a black border around the image about one inch wide, at least on my 22″ TV. Well that’s about as useful as watching things on the laptop’s screen! Switching the BIOS TV-out setting to NTSC makes the black border smaller, but doesn’t eliminate it, plus the image loses colour (greyscale).
I searched for this video card’s compatibility with Linux and the results were quite surprising. There’s an X11 driver for it which supports TV-out! Knowing this I decided to use Linux since, the output couldn’t possibly be any worse than it is on Windows.
Which software?
I researched several software options:
- LinuxMCE: This is a complete operating system. It seems to rely on having a new machine on which to be installed cleanly because it’s still a relatively young project. I was thrown back by the screenshots and videos, but reading the wiki and other docs seems to leave me blank – I couldn’t easily find supported hardware/software/options. It also appears to be aimed towards a “complete-house multimedia solution” with a central backend machine whereas I just need one machine. So I gave this a miss
- freevo: A python-based media centre application that relies on external applications for playback (mplayer, xine) and other tasks (don’t ask, I didn’t explore enough). I thought this was a great idea since those applications will have been tried and tested, however, these applications will need their own configuration in their own configuration format, and that’s if the external application was designed and developed for that specific feature one wants!
- MythTV: You will probably have heard of this application (and if you haven’t, why are you reading this?!). A lot of blogs and comments say that this is a “very mature” project, but I personally think otherwise: 1) the menus are all over the place, 2) it’s really heavy on the processor and HDD and 3) the configuration is hell (see 1). Saying this, it gets the job done.
I attempted to install MythDora as an easy option but it refused. It just wouldn’t do it. So I moved on. Hmph.
I installed Gentoo for several reasons:
- I know Gentoo well: several years administering Gentoo machines and it’s still my favourite
- I needed an optimised system (with as little autodetection and surplus packages as possible)
- Portage rocks
Configuring sisctrl
This is a surprisingly well formed piece of kit! I can’t say anything bad about it! One starts up X, then, as root starts up sisctrl, et voila, it’s almost like being in Windows where everything just “works”. Here’s my xorg device section:
Section “Device”
Identifier “video”
Driver “sis”
Option “EnableSisCtrl” “yes”
Option “ForceCRT1Type” “NONE”
Option “ForceCRT2Type” “TV”
Option “TVStandard” “PAL”
Option “CHTVOverscan” “on”
Option “CHTVSuperOverscan” “off”
Option “CHTVContrast” “14″
Option “TVXPosOffset” “3″
Option “TVYPosOffset” “-4″
Option “XvDefaultContrast” “4″
Option “XvDefaultBrightness” “10″
EndSection
You may notice the overscan feature is turned on. With this, the black border diminishes considerably, just as it would in NTSC without overscan. Super overscan however makes the image too large and many precious pixels get clipped :( I don’t think this feature is available in the Windows driver!
Edit: I later opt for the SuperOverscan option, once everything is configured, and use MythTV to resize the viewable area to what is actually visible on the telly.
The only complaint I have, which is nothing to do with sisctrl, is the poor quality of my TV-out viewing. Please read on, though. The TV to which this media centre is connected is a 22” Daewoo CRT, nothing special, only supports PAL. While viewing in PAL (colour) anything white becomes multicolour, don’t ask me how or why. While viewing in NTSC (greyscale) the image is perfect.
However, I hooked up my (again nothing special) ALBA 14” TFT TV and, lo and behold the image was perfect in both PAL and NTSC (both colour).
I’m currently experimenting with solutions… solutions other than getting a new TV.
Edit: The Mitac laptop has a S-VIDEO out socket. By using a £2 S-VIDEO to composite video converter that I found on eBay the image is now perfect. I love these weird quirks!
Can I has a TV stream plz?
Living in London, I watch Freeview. I already have several set top boxes for regular viewing which work quite well, I must say that Freeview is a real achievement, adding many channels and additional information free of charge throughout the UK. For those who don’t know, Freeview is the UK’s friendly name for nationwide DVB-T – the whole country gets the same channels (subject to signal reception).
For a DVB-T tuner I searched far and wide. The Mitac 7521P laptop, being a laptop, doesn’t have PCI slots… so the only option would be a USB stick, but the two ports on the laptop are USB1.1. Wahey! Luckily it has two PCMCIA (PC Card) slots, so I bought a PCMCIA to USB2.0 adapter (£8.50 delivered). That sorted, I could resume my search for a Linux-compatible DVB-T tuner.
I settled for a Leadtek WinFast DTV Dongle (£27.60 delivered). There are actually two USB DVB-T sticks with this name, both Linux-compatible, and I ended up with the one based on DiB7700 and MT2060 (whatever they are). Remember to compile i2c support aswell as the relative modules in drivers/media/dvb.
If you’ve never used a DVB device before, testing it is quite different to your average Linux device, for one simple reason: all (most?) DVB devices are very similar in the way they work. This means that your DVB tuner will very probably have several devices in /dev/dvb/adapter0. Applications using a DVB tuner will need very little configuration with regard to where/why/what to do:
- mplayer-1.0_rc2 (not older versions): needs a channels.conf file and to be executed like so: mplayer “dvb://BBC ONE”
- MythTV: compiled with USE flag “dvb”, change card type to “DVB DTV capture card” then specify its ID (0 if you only have one card)
So yeah, you get the idea – all DVB cards are the same. What a breeze :)
At this point I’ve managed to stream BBC 1 manually through mplayer. But wait… where are the rest of the channels? Doh! I could only watch BBC1 and BBC2, any other channel just wouldn’t lock! For some reason, the aerial in my loft works brilliant with the set top box but not with the Leadtek WinFast DTV Dongle, which seems to get better reception from the aerial that came in the box, allbeit for just two channels. So I went and bought an indoor aerial with signal booster from Tesco (£10 in store). I can now lock on the following channels:
BBC 1
BBC 2
ITV1
Channel 4
Five
ITV2
BBC 3
BBC 4
ITV3
SKY THREE
Channel 4+1
More4
ITV4
E4
E4+1
Five US
Five Life
BBC News 24
Sky News
Sky Sports News
There are a few missing like QVC, bid.tv and the radio channels but, most importantly, Film4, Dave and Virgin1. It’s a shame I can’t get a lock on these channels and I wonder if it’s worth getting a different DVB-T tuner to see if that changes.
Edit: Turns out the channels.conf configuration I had was wrong. I didn’t have the right frequency for the multiplex that holds Film4, Dave and Virgin1, once I changed this I could lock on these channels without a problem.
MythTV
Installing MythTV was somewhat tedious but trivial. It just took some time to figure out exactly how it likes things done as it’s quite picky.
Watching live television on MythTV was impossible. I found this strange because mplayer could do it fine and, I briefly delved into freevo to see if that was a viable alternative. Luckily I decided to give MythTV another go. The problem was that MythTV uses the HDD for live TV rewinding/pausing/etc, and the Mitac 7521P’s HDD is very, very slow:
# hdparm -t /dev/hda
Timing buffered disk reads: 12 MB in 3.58 seconds = 3.35 MB/sec
That’s even with Alfonso Martone’s optimal hdparm settings.
Luckily I have a fast local network and a powerful server which I used to host a samba network filesystem, then configured MythTV’s recording directory to be inside this. I’m now able to actually watch some TV.
My next hurdle was the TV listings, which I grab from the EIT data (over the air) instead of what appears to be the all-so-popular XMLTV standard (over the Internet). MythTV automatically grabs EIT listings and associates them with channels correctly, but all the programmes were offset by one hour. It just so happens they were offset by one hour until the clocks changed back to GMT (from daylight saving BST), so the obvious solution would be to use the option named “Time offset for EIT listings” to correct it…. wrong, apparently.
I’ve still not solved this problem.
IR SIR FIR? RF!
Having changed time to GMT, the listings are OK for half a year, so I delved into the available options for a remote control.
LIRC seems to be the obvious option here and there seem to be a lot of success (or apparent success) stories on Google. However, I’m not experienced with infrared transceivers/receivers and my attempts, which rendered parts of my HDD contents corrupt (in loading a kernel module that crashed the system), did not succeed.
The Mitac 7521P carries an IrDA device which I can’t identify. The Linux kernel identifies it as a serial port:
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a NS16550A
And the BIOS has a DMA setting for the FIR mode (something along those lines?). Alfonso Martone’s Asus laptop carries what he calls a “kn133” which led me to no results. This is the port I’ve been attempting to use.
The Leadtek WinFast DTV Dongle also carries an IR receiver and comes with a remote, but the LIRC docs say that USB IR receivers are an impossibility under Linux (and then contradict themselves).
I’ve not given up on this route – I’d still like to have an infrared remote because that’s what they’re designed for, but I have chosen a temporary alternative route.
The alternative is a wireless USB numpad (£15 delivered), it came with a wireless mouse but that’s stored away. The keys are black with white symbols, which I covered with black marker pen and I’ve marked white symbols for what the keys actually do with a white marker pen. Gotta love these quick fix jobs.
Due to the short range (around one metre) of this device, I decided to take the device apart and see what I could do. On the USB receiver I found a small spring which acted as the antenna. I made a hole (cut half the plastic off the end) in the dongle and used a long telephone wire to increase the range. This telephone wire runs under the two sofas (where the remote will be used most often) in the living room. On the wireless numpad itself I found that the aerial was just a printed circuit track running around the outside of the board, so I soldered a thin insulated wire to this to give it a bit of umph. The wire hangs out the top end of the device just like they do on the controls you get for RC toys.
The keys on this numpad are really easy to configure. I needed not load any modules, as I already had the USB keyboard stuff, and MythTV recognises the keypresses as it would any keyboard – all I had to do is map the keys to their functions in MythTV.
Long pause…
I’ve ignored this entry (and any other posting on my blog) for a long time now. I’ll write a quick update on this post and send it on its way. Even though it’s not going to be complete, I really want to get this on the net to help others :)
New TV Tuner
I decided that the Mitac laptop wasn’t powerful enough to run the whole shebang, plus, it would be more convenient to have a central backend on my previously mentioned server. I faced a problem: the powerful server (Compaq ProLiant DL380 G2) only has PCI-X slots, which would be problematic to some of the more experienced Googlers. PCI-X is basically 3.3v PCI. There is a certain notch in PCI cards which tells whether it’s 3.3v or 5v, and I had to find a card with that notch.
Saviour! The Hauppauge WinTV-Nova-T500 is 3.3v is the perfect solution, you can even see on their product page on the picture that there is a notch to define it as 3.3v (I bought it based on this! Luckily it was…). More info on the Nova-T500: if you’re scared about the TD version, I got mine from eBuyer.
This tuner has a much better sensitivity than the USB stick, it locks onto many more channels with a simple stick antenna. However, I connected it up to the loft aerial for improved watchability.
New Remote Control
The RF numpad was useless – it had two feet range, on good days… which seemed to be chosen randomly: I had a thin wire running under the sofas in the living room to pick up the signal but even that wasn’t good enough!
As recommended by a MythTV-user friend, I bought a remote+receiver USB bundle. This thing just plugs in and sends keyboard events. Perfect. There is a slight problem in that a lot of the keys don’t work because they go through a different device, but I have plenty of keys so I didn’t bother configuring these extra ones.
Done
There are a lot of things I haven’t mentioned here, mainly because this project went on a lot longer than I planned so the blog post got set aside while I tried to speed it all up (at least, that’s the excuse I’m telling you all!). MythTV installation is NOT easy at all, if you plan on making a mythtv box, be warned.
As far as the software goes, I have to say MythTV is a very mature project in that it has nearly all the options I need and could ever need, the problem is that they’re all over the place, ie. the menus to configure it and the manuals that explain them are encrypted and only readable by the eyes of those who have spent hours studying them.
As far as functionality, MythTV is brilliant. I love it, it’s made a big difference to how and when I watch TV. I think everyone else here enjoys it too, provided there is a backup (set top box) sitting nearby for when the thing goes down for whatever bizarre reason (usually my fault).
I enjoyed this project and I recommend it to anyone who likes getting stuck into geeky computery things :D