Saturday, September 24, 2005

I did a bit browsing, and my mate was playing some sounds from The Family Guy.

I had a couple on my laptop, which I'd got from a couple of pages on ytmnd.com, I think here, and here.

I decided to go looking for more good ytmnd pages. The only issue, which I found before, is that the pages have the background sounds as some "object" tag crap, which seems to be some IE crud, so it doesn't work in any other browser.

The workaround I came up with before, was to view the source, find the line with the object tag, and download the wav file with wget, and play it.

This is a real pain, so I decided to write a script to do it.

Here's the script.

#!/bin/sh
#
# downloads sound files from background of ytmnd pages, and plays them
# needed while they use that object= rubbish, instead of valid HTML
#
# usage: pass the URL as a parameter

cd /tmp
wget $1 -O -| while read LINE; do
WAV=`echo "$LINE"|grep object|cut -f2 -d " "|cut -f2 -d"\""`
if [ -n "$WAV" ]; then
wget $WAV -O sound.wav
break
fi
done

mplayer sound.wav

I originally wrote it for downloading wav files, and this all worked fine, until I found a couple of pages using mp3 files in the background, so my script wasn't seeing them (looking for .wav).

I changed this to look for the object line instead, which works, but now the mp3 versions will get saved as .wav. I didn't find this to be an issue though, because mplayer looks at the content of the file to work out what it is, rather than the extension (so maybe I could just get rid of the extension on the downloaded file altogether).

If you don't have mplayer, you could substitute the command with totem, or some other player that will handle wav and mp3 files.

After that, I went to find the lego version of the Monty Python Camelot scene from Holy Grail, I found it, downloaded it, and went to play it.

My laptop had a horrible time trying to play it. It would lag, so the video and audio got out of sync (way out of sync, and after only just starting to play the video).

I tried running it fullscreen, this was a joke. I decided to see if I could bypass X, and play it with the vesa output driver onto the console.

I tried this, but it was flicking from left to right, annoying, because other than that, it was working, and keeping in sync.

I tried to play it using the vesa driver while in X, because X runs in vesa mode, and this looked like it was going to work for a few seconds, until X crashed, and gdm restarted it.

Oops.

I gave up on that, and decided to play Doom for a while, well, prboom, since that's the version I have installed. This works pretty well, even though X is running in vesa mode.

I decided to see if I could get Quake going after that, because I used to enjoy playing Quake.

I found this page. (From the web archive, because the original and linuxquake.com is gone).

I downloaded the x11 binary of quake, tried running it, which resulted in a "no such file or directory" error immediately.

I assumed this was because I didn't have the pak file for Quake on my laptop. I downloaded the shareware installer, and tried to work out how to extract the pak file.

I tried to use wine to run deice.exe, but this didn't work. It just sat there for ages, with the CPU pegged, but not doing anything.

I looked around the web again, and found the pak files, extracted, so I downloaded them, and put them in place.

I tried running Quake again, but got the same error. I decided to look what the binary was trying to do.

I opened it up with a hexeditor, and saw a reference to "ld-linux.so.1" in the first few lines, which I didn't have on my laptop.

I checked the debian packages, and found that I needed "ldso", so I installed that.

When I tried to run it now, it just errored "can't load library 'libm.so.5'". I checked the debian packages, and installed "libc5".

This got me a step closer, now it was erroring "can't load library 'libX11.so.6'".

This is a part of "libx11-6", but when I tried to install it, I already had it. Hmm.

I wondered if the path to it was wrong, because I've moved a bit of stuff around on my laptop, because the partitioning job is a bit crap, and I keep running out of space.

I tried putting in a couplee of symlinks, so the file appeared in the correct location, but that didn't fix it.

I decided to strace the binary, and saw that it was looking in /usr/lib for the files, and not in the X11 libraries, where the files were.

I setup a couple of symlinks:

sudo ln -s /usr/X11R6/lib/libX11.so.6 /usr/lib/libX11.so.6
sudo ln -s /usr/X11R6/lib/libXext.so.6 /usr/lib

(Obviously the second came from linking the first, and repeating the strace, finding the next file missing, and adding in the link).

While looking at the strace output, I realised I had the pak file in the wrong place too, I had to put it in id1/, so I moved that.

Now I was getting a crash after it said "console initialised".

I googled a bit, and tried running it with the -nosound -nocdaudio switches, but this made no difference.

I found something related to networking, and when I ran it with "-noudp", it would get further.

Now the crash was after it would say:
PackFile: ./id1/pak0.pak : gfx/colormap.lmp

The output from strace just before the crash, was:

open("/home/squigley/.Xauthority", O_RDONLY) = 5

So it looks like it's having an issue connecting to X or something. I tried doing an "xhost +", not expecting it to fix it, and it didn't.

I decided to try squake, the SVGA version, but it didn't work either (and needed the "-noudp" switch too).

So, I gave up. Something's changed, and now Quake doesn't run anymore. I'm not really surprised, since the binaries are from about 10 years ago, it just annoys me that it's sort of got lost.

Perhaps I could find the source of the binaries, and try compiling them against more modern libraries.

I while later, while reading this page, I found that the deice.exe is just a copy of lha.

I installed lha on my laptop, and used it to extract the contents of the resource.1 file, in case the pak file I was trying to use was the issue, but after replacing it, with the one I extracted, it made no difference.

Oh well, no Quake.

0 Comments:

Post a Comment

<< Home