June 14, 2009

Linux media PC woes: Media application

At this point, I finally have a working X display on my TV. 1024x576 widescreen interlaced. Which flickers quite a bit on static desktop image, but isn't noticable when playing video or showing pictures.

I have tested MythTV earlier, and found that I didn't really like it much. Don't know why not, just wasn't complete enough I think. So this time I did a new search for linux media PC and came across the linux port of XBMC - the XBox Media Center. Apparently this was already in Gentoo Portage, just had to unmask it.

I had already tested this on the ATI adapter briefly, and new that it should work. So I was surprised to only see a segfault when trying it on the TV with the nVidia card. Rebuilding latest svn version didn't help either. Core dump on startup. Every time. I decided to attempt using the proprietary nvidia-drivers instead. Bingo! I had planned on testing those anyway to get vdpau support later, so this was okay for me.

So I finally got the media PC up and running, and except for the occassional hangups of xbmc, which I credit to the fact that I'm running a very fresh svn copy, it's working fine. The overscan adjustment feature saved me all the trouble of adjusting the X modeline overscan to fit the TV as well.

June 8, 2009

Linux Media PC woes: VGA-SCART cable

After deciding to attempt building a VGA out-Scart in cable, I set out to find the required components to build a prototype.

Since I already had a bunch of cables stowed away, finding the required cabling was not a problem. A bit of cutting, and taping later, I had this:

Not quite a monster cable, but quite monstrous still. The power input there is used to switch the TV to RGB and Widescreen. Note the nice 1kohm resistor there.

The moment arrives to connect this monstrosity to the associated hardware. VGA and audio cable connected, I switch the TV on before connecting the molex power. Upon connecting the power, the TV immediatly switches to Video view, and goes into widescreen mode. At least that bit works.

I can also spot the purple ascii-art gentoo logo of the login screen blurring past in the scrambled image of the text console. I take this as confirmation that the RGB-signals are properly connected, and continues to X configuration.

Hours (days really) later I give up. I'm not able to get the TV to sync to the X signal, and I seriously have no clue as to why. I (wrongly) decide that this must be due to a lack of a composite sync signal and decides it is time to build this thing properly, with a small circuit to create a composite sync. That would also release the ATI requirement, and allow me to change graphics adapter.

After a little shopping, I had the resistors required. Salvaged a generic transistor from an old C64 joystick autofire contraption. After a bit of soldering and I had the setup on the right. Didn't look too bad, so I decided to give it a try. Same result as my previous prototype. Blaming the transistor, and guessing I had connected it wrong, I desoldered it and tried another of the same type. Still just a flickering image.

So I decided to order a few transistors. Searching on Elfa.se I found a transistor with basically the same specs as the one in the circuit description I was following. Next time I'm ordering electronics, I will learn to check the size of the components. Surface mount transistors are tiny. Still, I didn't want to give up, and a bit of more soldering, I managed to connect it. Decided to redo the sync circuit at this point as well to clean up the mess from the previous attempts. Reconnect, retry. Same result.

Revelation

At this point I was pretty sure things should be correct, so I finally decided to look for other causes of the problem. After a few hours battling with X Modelines and the ATI driver, it finally dawned on me that the driver was simply ignoring my requests for a video clock that was slow enough to provide a PAL TV sync. The Modelines provided by the marvellous little app called lrmc should have worked, but didn't.

Well, out with the ATI adapter, and in with an old nVidia adapter. Compiled the nv driver, and voila. Image on the screen!

For reference, the working modeline for a widescreen PAL TV is:

Modeline "1024x576x25.00i" 19.750000 1024 1056 1152 1264 576 586 592 625 -HSync -VSync interlace

Next up, the media PC application.

Linux media PC woes

This is going to be short series of articles describing my struggles to get a Linux Media PC connected to an old Widescreen CRT TV set. I started writing this a while ago, but never got around to publish it.

The setup

I can't afford buying lots of new stuff just to get a simple home theater set, which is why I'm building this out of the parts I've already got. 

Computer: My old file server. It already has the media files and storage. The only thing needed is a graphics adapter and the right software. It is running Gentoo Linux as it has been doing for ages now, and I have no intention of changing this. Specs are Athlon 64, 2GB RAM. To use it for media PC purposes I plug in my retired ATI x1950 Pro card that was retired from my main computer in order to get an adapter capable of playing GTA IV.

Display: An old Philips 32" 50Hz Widescreen CRT TV. This is the only display on this computer, as I haven't needed a display on it until now. Available inputs on the TV are two SCART ports at the rear, and an S-Video port on the side.

Configuration

ATI and Linux is in itself a perpetual nightmare. The X.org drivers are generally late and without support for features beyond the immediate needs for a simple desktop, and the native binary drivers are prone to errors as well. After updating and rebuilding quite a bit of the system however, I was still not able to run the native drivers with the new X.org server. The X server simply core dumps while probing drivers. The open drivers however seems mature enough for the old X1950 now, so I decided to try my luck with those.

First attempt, TV-Out

The logical thig to do when connecting a computer to a TV is to use the TV-Out on the graphics adapter. Turns out of course that this is not quite supported yet on the X1950 with the radeon drivers. I seemed to almost get an output using an S-Video cable that I think came with the graphics adapter, but not quite. That is, I get an output on the TV when booting the machine and still have it until the X drivers kick in. After that, all black.

Second attempt, VGA to SCART

Since this computer only connects to the TV, I figured that it should be possible to connect VGA directly to the SCART input on the TV. After all, VGA provides RGB output, and SCART supports said input. Googling around a bit reveals a few different solutions for this. I decided to go for the simplest approach, since I was using an ATI adapter which should support a composite sync signal.

More about that later.