Monday, January 12, 2009

battling fglrx

There were new dns exploits around and when I ran apt-get dist-upgrade it had some bind and ssl packages in the list so I thought it would be important to do the upgrade. It also upgraded my kernel which I think is where the problems started.

Then my xbmc started being really slow. Like 1 frame a second slow. Of course vlc was just fine. fglrxinfo reported the Mesa drivers which meant I wasn't getting hardware video acceleration like I should be. What followed was a long list of frustration and I'm going to document what's working in the hope that when this happens again I'll be able to get it working quicker. Let it be known. I barely understand what half of these commands do but in the end I got it working.
$dpkg -l '*fglrx*'
# then remove all of them
$rmmod fglrx intel_agp agpgart
$depmod -a
$ls -l /usr/lib/dri/fglrx_dri.so
# remove it if it's there
$apt-get install build-essential cdbs fakeroot dh-make debhelper debconf libstdc++5 dkms linux-headers-$(uname -r)
$apt-get install xorg-driver-fglrx-envy
$Xorg
$glxinfo | fgrep -i dir
direct rendering: Yes
$fglrxinfo
display: :0.0 screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: Radeon X300/X550/X1050 Series
OpenGL version string: 2.1.7659 Release
$glxgears
7921 frames in 5.0 seconds = 1584.096 FPS
7855 frames in 5.0 seconds = 1570.389 FPS
7796 frames in 5.0 seconds = 1559.176 FPS
$fgl_glxgears
Using GLX_SGIX_pbuffer
1871 frames in 5.0 seconds = 374.200 FPS
1971 frames in 5.0 seconds = 394.200 FPS
2018 frames in 5.0 seconds = 403.600 FPS
2005 frames in 5.0 seconds = 401.000 FPS
I also found out that my mceusb2 lirc remote receiver can look for more than one remote at a time. I found the TIVO_Series_1 worked great and now I can move on to stage 2 of my control. I plan to have a small python script looking at the output of irw and when it detects the xbmc remote it will switch the receiver on and change inputs on the video switch. When it sees the tivo remote it'll switch everything back. I need to work out the secret url's to hit to control the destiny networks d3k (which controls the receiver and video switch) so I'll have to fire up a windows machine to do that (it's internet explorer only). If I get the lirc dongle to emit IR then I can avoid much of the d3k which will suit me just fine.

I also got spdif out working so now I have dolby surround sound in the movies I watch. I was expecting trouble, but it really was as easy as connecting the cable and changing audio output to be digital. Awesome! We're really close to a pretty good working system. After all that, Mame is next on the list!

Tuesday, January 06, 2009

Filling up a 1.5 TB hard drive

My 1.5TB drive arrived and I threw it into the server. Then I had to fill it up. I have two external 750 gig drives filled with the raw video_ts files from all my DVD's that I ripped myself. It took under about 18 hours to copy all the data over, with a gap in the middle while I was sleeping and then switched over the drives. I'm pretty happy with rsync but wished I'd used the -h flag to report the sizes in a human readable form. Since I'm running some system status software I have a nice graph of the hard drive filling up:


Things are going pretty well with the xbmc setup. I got my Mediagate GP-IR02BK remote and that appeared to work first time with lirc and when I restarted xbmc it was controlled by the remote! One problem was that the DVD Menu button didn't appear to show the DVD Menu which is kind of critical.

I've worked around it for now by adding this to ~/.xbmc/userdata/Lircmap.xml
<hash>DVD</hash>
and also adding this ~/.xbmc/userdata/Keymap.xml
<keymap>
<FullScreenVideo>
<remote>
<hash>ShowVideoMenu</hash>
</remote>
</FullScreenVideo>
</keymap>
Notice how that's Keymap.xml not keymap.xml the xbmc documentation is obviously written by windows developers who don't care about the Case of FiLeNaMEs. I'm also irked by the camel casing in entity names in their xml too and their non-consistent use of different cases for file names (like Keymap.xml and advancedsettings.xml)

I also found that the log output to xbmc is in /var/tmp/$LOGNAME-xbmc.log

Since I was changing config files a lot I ran xbmc like this:
while true; do echo "Starting XBMC"; xbmc; sleep 1; done
This allowed me to hit control-C in the window it's launched from and it would restart.
I couldn't find a way to get it to restart and to also tail -f the log file (since it starts a new log file every time it starts). I guess I could pkill tail but that seemed a bit drastic.

Other things I learned and wouldn't mind remembering: mkfs -t ext3 /dev/sdb1
and to remove a file that starts with a - sign: rm -r ./-Funky\ Filename