Sunday, July 24, 2011

Too Much REM Sleep

I had a dream that Apple announced they were going back to the PowerPC architecture and I ran this video as the final post of this blog:



Oh, well. We can all dream, can't we?

Making ATI Cards Sing on Debian Linux

If you've installed Debian "Squeeze" on your laptop or desktop with an ATI card, you may have noticed that your graphics performance wasn't all that it could be, or more artfully, it's in the toilet. You may have investigated this problem by googling and peeking in numerous forums, always feeling you're so tantalizingly close to solving the problem that you could forgo posing a question to the grep nazis at the Debian forums for one more day, just one more day, and you'll have the answer. You pull your hair out and bang your keyboard. Soda cans and junk food wrappers pile up on your desk. You start bizarrely rocking back and forth in your chair thinking it can get you closer to your holy land. Well, before you go that far and embarrass yourself and, well, me frankly, take a look at this page.

Hint: install linux-firmware-nonfree.

I would like to take this opportunity to thank everyone for promulgating the above link so that anyone out there wouldn't waste hours of their time editing xorg.conf files and reading logs and mesa-utils outputs while the rest of you are no doubt sunning yourselves, making love, and biting grapes off from the stems like they did in those old Roman movies.

Thank you.

Monday, July 11, 2011

A Newish mplayer Build For PPC and Tiger

So you may still be having nightmares at my previous post on mplayer (I know, it was as rambling as a terrorist manifesto), and you may remember I was using an mplayer binary from 2006 and I threw in some big talk about how I was gonna compile my own to bring it up to date. Well, someone else saved me the trouble. Sort of. This site has made available a GUI wrapper for mplayer, and, well, I'll let them explain it:
This is simply the MPlayer binary wrapped inside a MacOS X application bundle, allowing for drag and drop, file association and opening videofiles directly from the Finder. It is based on the application bundle from MPlayerOSX and the mplayer binary compiled from SVN@mplaerhq.hu (09.09.2009):

svn co -r29662 svn://svn.mplayerhq.hu/mplayer/trunk mplayer

This adaptation allows simple functionality like drag and drop, "Open with", file associations and opening of the MPlayer program without a graphical user interface. The mplayer binary itself provides with 300 video codecs and 141 audio codecs, the ability to open a wide range of movie files, streaming protocols dvd disks. In addition to the usual mplayer keyboard commands, there is support for the Apple remote.
The application comes with a bunch of configuration files that you edit manually, but since that requires a learning curve of, oh, about 5 minutes and I already know how to use mplayer from the commandline, I just extracted the binary file from the app package and used it in the Terminal. So now I have an mplayer binary from September, 2009. Not 2011 current, but it does much better decoding newer AVC files the 2006 version choked on.

So download it and use the GUI wrapper or whatever. I think you'll be pleased with the performance.

Thursday, June 16, 2011

An ATI Radeon 9000 Upgrade on a Sawtooth

I'd long wondered how much of a speed boost a new graphics card would be on my Sawtooth over my old, decrepit Rage 128 Pro. Seriously, the thing was actually turning gray, and it wasn't just the dust covering it. So when thinking about a replacement, I'd mentally settled on an ATI 9000 with 64 MB of memory. Now there are reasons you wouldn't want a 9000 on a Sawtooth, namely the ADC port won't work. Unlike all later Power Macs, the motherboard doesn't supply the ADC port with power, so unless you have an (expensive) adapter for the DVI port, you can't use an ADC monitor. Also, dual monitors are a no-go. But since I don't have an ADC monitor and made this far through life never having the urge to have dual monitors, I figured the 9000 would be an ideal upgrade for me because of the modest cost and lack of a cooling fan. And if you've ever had a graphics card fan wear out on you, you know what I'm talking about. (One more note: Linux has quality drivers for ATI cards, not so much for Nvidia cards, so if I want to boot Linux on this machine I'm gonna want an ATI card.)

So after looking on and off for a few months, I saw a 9000 on ebay for $0.99 plus $8.00 shipping and won the auction as the lone bidder. I also had to get a DVI to VGA adapter since my monitor is VGA, and that was it's own kind of adventure. Long story shorter, you need a DVI-I adapter, not a DVI-D adapter, which are sometimes referred to as DVI(24+1) as opposed to the DVI-Is which are sometimes referred to as DVI(24+5). Got all that? Now back to the 9000.

So I got all the stuff in the mail and installed the new card and fired it up. So how was it? The first thing I noticed was the mouse cursor now had a subtle shadow around it that wasn't rendered with the Rage 128 Pro. Then I did some speed tests on tasks that involved graphics and video and was pleasantly surprised at the results.

First I tried out an abandonware flight sim I like called OSX Skyfighters 1945. On an 800 X 600 resolution, frame rates were about 15% faster. Not a huge deal, but on a 1024 X 768 resolution, frame rates improved by about 35%. Video playback on vlc and mplayer was about 15% faster, and frame rates in the astronomy sim Celestia were between two and three times faster. Also, and I didn't expect this, frame rates in games played in Classic Mode improved as well.

Probably the most striking difference was with MacTubes. With the Rage 128 Pro, the videos would skip frames when displayed at 200% and stuttered in full screen to the point of being not very watchable. Now with the 9000 that's all gone. There's no frame skipping, not even in fullscreen. So now I'm watching fullscreen youtube videos on an eleven year old computer and having the last laugh. You have not defeated me, youtube. You have not defeated me.

Unfortunately, though, and this was the only disappointment, flash playing in a web browser showed no improvement, and that was with Hardware Acceleration in the settings menu switched on and off. But flash is evil, so we'll ignore this.

So the lesson here? If you have an old Power Mac with a Rage 128 Pro or, god forbid, a GeForce 2MX, a graphics card might be a cheap and easy upgrade well worth your time. Now if you'll excuse me, I'm gonna go watch MacTubes and make the 21st Century my bitch.

Monday, June 6, 2011

A Tour Through TenFourFox's about:config

One of the coolest things about Firefox has been its about:config feature and its near endless array of preferences. You simply type about:config in the address bar, and it's like the keys to the kingdom. Turns out TenFourFox is no different and even has a few custom preferences of its own, so I thought I'd take a brief tour through some of the settings with an eye on speed enhancements.

First, type about:config in the address bar and make the obligatory promises not to break stuff. Then find the following preferences:

javascript.options.tracejit.chrome

This is set to false by default. Double click on false which changes it to true, and you might notice the interface seems a little snappier.

browser.download.manager.showWhenStarting

When true, this raises the download manager window when a download starts. However, on my Sawtooth I noticed that blue animated progress bar takes about 20%-25% of my CPU, so rather than keep closing the window after it pops up, I just have it not open at all. I already have MenuMeters in my menubar telling me my network activity, so I already know something's downloading.

browser.tabs.animate

Don't want animated tabs slowing you down? Set this to false.

Speaking of tabs, here are a couple more:

browser.tabs.tabClipWidth

This clips the width of your tabs when you have too many open, but it also eliminates the close tab button from all tabs except the one focused. The default value is 140 pixels. I switched mine to 80, and now the close button remains visible on all tabs.

browser.allTabs.previews

Set this to true and click on the list all tabs button at the right end of the tab bar.

And one more:

image.animation_mode

Change the value to once. Then animations will only play once and won't loop and slow down your browsing.

There are also a few settings that are unique to TenFourFox. Just type tenfourfox in the filter bar and you'll see there are three for now. They have to do with disabling certain troublesome plug-in features, and the developer has promised there will be more settings unique to TenFourFox in the future.

Saturday, May 21, 2011

HD On an Old Mac With mplayer

Probably the one thing, judging by people's statements in the many Mac forums, that makes people upgrade to Intel more than any other is HD video playback. They say their old Powerbook/Powermac is too slow, playback is choppy, or even [shiver] slideshow-esque. But in my extensive studies;) on this issue, I've found this isn't only a hardware question. There is a software component that many people aren't adequately exploring.

It should be noted right here, though, that if you're talking about flash video streamed in HD over the internet, you're most probably permanently out of luck. Flash is dead on PPC, and it was never any good when in active development, and HD video pushes it past the edge on everything except maybe a G5 quad.

But if you're talking about H.264 files like mp4's and mkv's, you may be in luck. By now you've probably tried Quicktime with the Perian plug-in or VLC and found the results lacking. Playback stutters, your computer's too slow, and you're back to square one. However, there's another player that's much more CPU efficient called mplayer, specifically, running the mplayer binary from the command line.

You can download a GUI version, MPlayer OSX, that's a bit long in the tooth here (UPDATE: a newer binary is available inside this app package). Maybe you've tried it before and didn't like it because the GUI was old. But the real strength of mplayer is the many parameters you can use from the command line. There are literally hundreds, too many to fit into a GUI, and a few of them greatly enhance playback on slower computers.

So the point of the above download is not to use the GUI, but to extract the binary by control-clicking on the app and choosing "Show Package Contents." Open Contents-->Resources-->External_Binaries and control-click on "mplayer_ppc.app" if you're on a G4 or "mplayer_noaltivec.app" if you're on a G3. Choose "Show Package Contents" again and open Contents-->MacOS and there's your binary. Duplicate "mplayer" and move it somewhere convenient like your desktop or applications folder. Other people say create a symlink to your /usr/local/bin, but my system doesn't have that folder, and now is not a good time for me to break my system so I'm gonna steer clear of that, thanks very much. I just put it in my applications folder and invoke it with /Applications/mplayer in Terminal.app. Luckily I don't have to type this out every time as I can hit the up arrow key to cycle through my previous commands.

Now let's fire up mplayer and experiment with its parameters. The simplest way is to enter /Applications/mplayer in the terminal, then add a space, then drag the file you want to play onto the terminal window. You will now notice the path to file has been printed after the final space like this:

/Applications/mplayer /Users/username/Desktop/themostgodawfultabooyoucanthinkof.mp4

Now press return and a window should arise playing the movie. And there are several keys to control playback, a listing of which is here. Arrow keys for moving backward and forward, f for fullscreen, q for quit, etc. No command-key necessary.

At this point, you'll say, "Great, but it's not that much different than VLC or Quicktime. It still stutters." That's because you're not using any parameters (slapping you upside the head). Now try this (all on one line):

/Applications/mplayer -really-quiet -framedrop /Path/To/File (no space between -really and -quiet)

(Incidentally, you can download a Star Trek trailer here that we can use as a common reference. It's a 720p mp4, and it's dubbed in Spanish!)

The -really-quiet is for reducing the output in the terminal window as the movie plays. The -framedrop is to skip late frames and keep the audio in sync.

Now you may say it's a little better, but still not there. Well, it's a little better than VLC/Quicktime because there's no GUI taking away CPU cycles. It only displays the movie itself. Quick demonstration: Play a movie in MPlayer OSX PPC and open Activity Monitor (or run top if you prefer). Notice how there are two entries, one "MPlayer Window" (the video itself), and the other "MPlayer OSX PPC" (the GUI). Notice the GUI using an additional percentage of your CPU in addition to the movie playing?

Now let's go back to the command line and add another parameter like this (again on one line):

/Applications/mplayer -really-quiet -framedrop -lavdopts skiploopfilter=all /Path/To/File

With the above Star Trek trailer, I can now view it stutter-free on a 1.5 GHz G4 Powerbook, something I can't do with VLC or Quicktime. However, you may not have a 1.5 GHz G4, and you still can't see smooth playback. Is there anything else you can do? Yes, with a qualification. You can add another option to the -lavdopts parameter, skipframe=nonref, that will reduce CPU usage by about 50% by skipping some frames to decode. This will result in something of a blinky effect like you're looking at an old zoetrope, but it makes a lot of files playable that weren't before. You can try it and see if your eyes adjust to it or not. Enter this (all on one line):

/Applications/mplayer -really-quiet -framedrop -lavdopts skiploopfilter=all:skipframe=nonref /Path/To/File

Also, I don't have a dual processor to test this on, but you can assign two threads for decoding with the -lavdopts option "threads=2" so it would read (all on one line):

mplayer -really-quiet -framedrop -lavdopts skiploopfilter=all:threads=2 /Path/To/File

So there you have it, the tools necessary to run HD video on your PPC Mac. There is one minor hitch in that the binary we used above is from December, 2006, and although it works with almost any file you throw at it, it doesn't correctly decode some newer AVC files. So the only solution here is to get an up-to-date binary, which you can only do by compiling it yourself, which I have no idea how to do. So I'll be writing a future post on my adventures or misadventures in compiling, depending on how things go.

One last thing. I noticed on a Sawtooth with an ATI Rage 128 Pro video card, the option -vo quartz is less demanding on the CPU than the default CoreVideo, but there's no difference on an aluminum Powerbook. My guess is it's because the Sawtooth's video card is not Quartz Extreme capable, but in any event you might want to use -vo quartz if you're running on a calcified card like the Rage 128.

Thursday, May 5, 2011

An eDonkey That Plays With Tiger

UPDATE: Somewhere in the time since this post was written, aMule released a new version 2.3.1 which resumes support for Tiger. Cool!

I was looking for an eDonkey client because I wanted to try out eD2k links to quench my thirst for old movies that you can't find anywhere else but, well, the eDonkey network. I had used aMule a few years ago, but I only used it to download through searching the network through the client. I never got around to downloading directly through eD2k links. So I went searching for the latest version but found it required Leopard (An OS Too Far) and couldn't immediately find the last version for Tiger.

Well, after much searching and scouring, I found the download link to aMule 2.2.5 here. Download the "aMule-2.2.5-OSX10.4+.dmg" file. It's a universal binary and it runs on Tiger. Happy hunting.*

*And on the whole downloading-copyrighted-material thing, I sort of go by the copyright laws we had before Hollywood money bought off Washington and purchased legislation to ensure Disney owned Mickey Mouse's copyright into perpetuity. If the makers of a movie, for example, are all long dead, I think it's okay to download a TV rip, at least.