Monday, December 22, 2008

TV Out working with a cheap ATI X1050 card

I got TV out working on my cheap $20 ATI X1050 PCIE graphics card under Linux. It worked first time after following these instructions. I had to modify it slightly so there was only one display (the TV). I even got it to work with x11vnc which meant I could do most of my setup remotely and not have to have the TV on.

However after following some XBMC instructions I noticed I was running the Mesa GL library and not the ATI hardware one.
DISPLAY=:0.0 glxinfo | fgrep direct
was reporting direct rendering: No
DISPLAY=:0.0 fglrxinfo
was showing Mesa.

Even though I was getting pretty impressive frame rate with Mesa I upgraded to the downloadable (from ATI) driver and that screwed everything up. Even though it was now reporting direct rendering the performance was sucky. I also noticed that as soon as I killed the first X Client, X windows would exit too. not too sure what that's about. I uninstalled the downloaded drivers and went back to the gflrx drivers from ubuntu and that gave me direct rendering and pretty good frame rates. Sadly x11vnc no longer works, even though I downloaded the most recent version and compiled it myself. It keeps getting ShMem errors.
With downloaded ATI drivers
# fgl_glxgears
Using GLX_SGIX_pbuffer
1423 frames in 5.0 seconds = 284.600 FPS
1780 frames in 5.0 seconds = 356.000 FPS
1741 frames in 5.0 seconds = 348.200 FPS
# glxgears
1837 frames in 5.0 seconds = 366.721 FPS
1927 frames in 5.0 seconds = 385.396 FPS
1904 frames in 5.0 seconds = 380.799 FPS

With ubuntu fglrx drivers
# fgl_glxgears
Using GLX_SGIX_pbuffer
2568 frames in 5.0 seconds = 513.600 FPS
3032 frames in 5.0 seconds = 606.400 FPS
3009 frames in 5.0 seconds = 601.800 FPS
# glxgears
12657 frames in 5.0 seconds = 2531.301 FPS
12632 frames in 5.0 seconds = 2526.393 FPS
12531 frames in 5.0 seconds = 2506.009 FPS

Once I had video set up Audio was a doddle, installed alsa and alsamixer and alsaplayer and immediately sound came out! I still need to spend some time to get digital optical audio out, but I'll leave that for some other day.

XBMC has screen resolution and calibration tools built in. I also used [aticonfig --tv-info] and [aticonfig --tv-geometry=40x90+0+2] before I found the calibration menu and got my screen size set up.

Controlling XBMC is still a problem. I'm using the web ui (turn on in settings), synergy from a laptop, the iPhone web ui is too limited (Couldn't find any transport controls), But the $3 iPhone App seems workable for now. I had hoped to be able to use my really old X10 MouseRemote but it appears to have died. I tried it with two different serial ports and neither got any data out of it. The little LED didn't flash when I pressed buttons. So I looked up some remotes online and ended up ordering a Mediagate MCE Remote which should work just fine. I'll keep you posted on that.

Lastly I fear that my current home automation controller. A Destiny Networks D3K is close to it's end of life. The company's gone bust so I don't get any updates anymore. The control software only runs under Windows and my last machine that had it installed died. I'm trying to muddle along with what I have set up right now, so to get the HTPC/XBMC you need to press VCR and there's no way to get to VCR now (unless you go in and press buttons (the horror!).
Perhaps with this new remote I'll be able to control some stuff. Seems relays and IR emitters are expensive (at least from Global Cache, so I might have to work in some arduino boards or something. That's a long time in the future though.

Sooner than that I'm going to get a 1.5TB drive (or two) and put more of my movies on it. And I need to work out how to Rip some of these Disney DVD's...

Saturday, December 20, 2008

zoneminder, bt878 based video capture card and ubuntu hardy

I use zoneminder for my security cameras and with the new server (and new OS) I had to set up zoneminder again. I have a bt878 based card which worked great in the old setup.

Here's some tips to get things going:
xawtv -hwscan
Should be able to find your hardware, if not you're not going anywhere.
xawtv -device /dev/video0
or whatever hwscan told you, should show images, if not you need to look into that.

Once you have that all working the secret sauce is to add the user that runs your apache cgi scripts to the video group, so they can access /dev/video0
usermod  -a -G video www-data
now zoneminder should show your cameras.

My cameras are 320x240 NTSC

Other useful stuff:
lsmod | fgrep bt

bt878 11992 0
bttv 176180 2 bt878
ir_common 36100 1 bttv
compat_ioctl32 2304 1 bttv
i2c_algo_bit 7300 1 bttv
videobuf_dma_sg 15108 1 bttv
videobuf_core 18820 2 bttv,videobuf_dma_sg
btcx_risc 5896 1 bttv
tveeprom 16528 1 bttv
i2c_core 24832 4 bttv,i2c_algo_bit,i2c_piix4,tveeprom
videodev 29312 2 bttv
v4l2_common 18304 2 bttv,videodev
v4l1_compat 15492 2 bttv,videodev
My card was $20 from geeks.com, It has 4 inputs and I'm really happy with it.

Tuesday, December 09, 2008

another new server

The old new server didn't work out at all. It had a weird glitch that when the memory usage went up to 100% and it started to want to try and use the swap the machine would lock up. Sometimes I could preempt this with rebooting, but other times it was stuck until I got home to hard power cycle it. Luckily I got it from someone at work and after we had tried different memory modules he took it back. It was lucky really since I'd been looking around and really wanted something a little better and was more into the idea of actually having a Home Theater PC (HTPC) in the rack. Especially since my daughter is starting to want to watch movies with us and I don't want to mess around with opening DVD's and stuff.

I did a little research and with some help from the egg heads at work came up with this:
Pretty sweet for under $200! When it arrived I started pulling apart my old 4u case to put this new stuff in and while I was halfway through, I thought, you know... I really should just smoke test this new stuff before installing it. I dismantled more stuff while that thought was still nagging in my head and finally stopped and set it up on the bench. Sure enough it didn't work! I tried lots of things and couldn't get it to work. Filed a support ticket with the board manufacturer and put my old server back together. The next day I bought a new motherboard and power supply from Frys to test some theories. When I got them home they too didn't work and I finally hit jackpot when I tried each of the memory modules separately. One was bad! I ordered a whole new set and will mail one set back once I find two that work and then took the other stuff back to Frys.

Now my server was working!

This motherboard had so many awesome ports I was delighted, especially with the optical audio out, external SATA and the hdmi connector. I was sad it didn't have svideo and didn't have a com port either (I have an old X10 remote that has a serial port and also a weather station I plan to hook up at some point). However graphics cards with svideo are available for $20 (ATI X1050) and you can get usb to serial port adapters for under $10 so that's not a big deal. Once I read the manual I found out there were lots of headers for more ports so I got another 4 USB, 1 firewire and more audio ports for a $15 floppy disk sized header and ordered the official com port header (I thought about making my own, but it was just too much trouble).

Another thing that pleased me was that I could adjust the bios settings over the DVI port, which means I can mess with my system in the den, rather than dragging it into the bedroom where the only VGA display in the house is. This allowed me to find the second easter egg. Even though every bios ever made has allowed you to set what happens when the power comes back on, my old motherboard didn't. I was delighted I could make my server come back on automatically after a power cut with the new board. Yipee. Of course once I put the X1050 graphics card in there I couldn't access the bios at all on either DVI port, but at least once the system booted I could see the Linux console on the X1050 DVI port. Good signs I'll be able to get svideo working at some point.

So now I'm setting up the new machine and I might make one or two posts about that as time goes on. I will leave you with this quick (and dirty) performance number. The old server reported just under 1,800 BogoMips and the new system with 2 core's clocks in at 10,800 (that's 5,400 per core). Now to find something to do with all that power.