Wednesday, January 30, 2013

Disappearing or Invisible Fonts on Debian/MintPPC

It seems a lot of people besides myself have had a slight problem lately when updating our Wheezy installs. All fonts in GTK apps render as a very light purple making them invisible. This only seems to affect people using the Radeon driver and the solution for me was ultimately a simple one. First generate a xorg.conf file if you don't already have one by switching to a console and entering:

sudo /etc/init.d/slim stop

Replace slim with gdm or lightdm or whatever your login manager is. At this point all the text in your console might be jumbled. That seems to be another bug. Just type the following commands blind:

sudo Xorg -configure

and then:

sudo cp /root/xorg.conf.new /etc/X11/xorg.conf

Next, edit /etc/X11/xorg.conf in a text editor by adding the following line under the "Device" section where you see the "radeon" driver:

Option "AccelMethod" "XAA"

You also want to tab in the Option and make sure it lines up with the section. Then save and exit, type startx or restart the computer, and you should have your fonts back.

At first I tried to fix this with the xorg option "NoAccel" "True", but that turned off all acceleration and made my desktop unacceptably slow. But changing the "AccelMethod" from EXA (default) to XAA, it preserves 2D desktop acceleration and fixes the font issue. There's more information in these threads here and here.

Just thought I'd leave this here in case anybody googles, "WHERE THE HELL DID MY FREAKING FONTS GO LINUX WHEEZY HELP."

UPDATE: Peter S. reports he can get fonts back with EXA acceleration using the following xorg.conf edits:

Option "AccelMethod" "EXA"
Option "RenderAcceleration" "false"

And you may also need:

Option "MigrationHeuristic" "greedy"

He also says he can now use Compiz without it "lagging like crazy" on his G3 :)

UPDATE II: Here's a bug report, Bug #702480 xserver-xorg-video-radeon: GTK fonts are invisible on PowerPC

Monday, January 28, 2013

GarageBand Alternative for Linux

It's called LMMS (Linux MultiMedia Studio). Recently I decided to get more into learning about and making music. I'm always on the lookout for productive outlets for my OCDing and thought this could be the ticket. Also it has the added benefit of making me stop regretting that I couldn't play a note of music.

When looking for music production software on Linux, the first thing I became aware of is a lot of these programs require the JACK Audio server. So I installed it along with qjackctl (a settings GUI that also turns the daemon on and off) but got errors when I tried to start it. After a bit of googling, I found there are two separate JACKs, jackd1 and jackd2. jackd2 is not a sequel to jackd1. It's a different fork. So given I had jackd2 installed, I replaced it with jackd1 and...success! Got the server running, so now I can pass audio around between different applications if I ever need that function (moduler work environment is the applicable phrase). I don't know what the problem with jackd2 was. I got the same errors on an iBook and a Power Mac and the common advice about realtime settings didn't work. But for now I'm not gonna care.

Onto LMMS. This is probably your best bet as far as GarageBand alternatives go in that it's fairly easy to get started with but is also complex as hell just with the sheer number of options available to you. Here's the default setup with a triple oscillator synth selected:

LMMS screenshot

It has a song editor for writing melodies and a beat/baseline editor for writing repetitious things like...beats and baselines. You bring up a piano roll for composing notes, and it's pretty flexible as far as copying/pasting and moving things around, etc. It also comes with plenty of instrument presets and samples for you to mess around with. And the GUI's pretty slick.

I've only found a couple of problems. If your computer's too slow, playing back songs with too many simultaneous elements may result in distorted sound, so you'd have to export to wav or ogg to hear the whole thing at once. Also, I thought at first that LMMS required JACK and I couldn't get it to start up with a JACK server running. When I stopped the server LMMS started fine, and I found in the preferences it's set to use ALSA by default. Cool, but just to see, I switched it to use JACK and got the same failure to start up even with the JACK server turned off. I had to trash the .lmmsrc.xml file just to get it to launch again. Maybe the JACK problem will be an inconvenience down the road, but as is the theme of this post, for now I'm not gonna care.

Be sure to check out LMMS's online manual beginning with the Getting Started section.

As for other programs, there's also Rosegarden. When I installed it it wanted to install Latex as a recommended package for typesetting music notation, but since I wasn't in the mood for a 1 GB download and I don't need to produce fancy musical sheets I installed Rosegarden with the --without-recommends argument. It basically does the same thing as LMMS, but in different way, so it's a matter of taste. Rosegarden requires JACK.

Also requiring JACK is Hydrogen, which is like an LMMS for drum machines. There's also Superlooper, which is about making loops presumably super. And QTractor is a newer program people are talking about.

I also tried Ardour, but I couldn't get it to launch. Maybe it's a RAM issue as the iBook I tried it on only has 256 MB (UPDATE: It was a RAM issue. I upgraded to 640 MB and it started up fine.). And Jokosher failed at the Create New Project prompt. It sounds like this PowerPC bug is still there. Oh well, Jokosher. Your screenshots looked good, but you'll have to remain a mannequin in the window.

So now I'm in the market for a midi keyboard and having to answer the existential question that has ruined larger men than me: 49 or 61 keys?

Friday, January 18, 2013

TenFourFox 19 Beta

A new TenFourFox beta is out for testing. This is an important update as it's the first build under a new compiler and there were previous warnings that it would push minimum memory requirements up to 1 GB. I can echo Cameron Kaiser's finding that those fears have not come to pass. In my testing, memory use is up slightly, maybe 30-40 MB on average, not enough for me to care about. He also says he's eager for Leopard and G3 users to test this as he doesn't have a G3 or a Leopard machine, so give it a download.

In my couple of days testing, it's been stable. In that respect, TenFourFox remains as boring as ever. Page rendering seems less jumpy and a tad quicker, but that could be a placebo effect. Altivec acceleration has been added for pages that shadow out the background. This will make me hate web developers a little less. Also, clicking scrollbars and tabs with the window in the background are now active, like with Safari/TenFourKit.

Check out Cameron's blog for the longer version. His posts are always packed with information without being overwhelming to the layperson. Glad to see TenFourFox still has a bright future.

UPDATE: And for Leopard users, SeaMonkey 2.16b1 has been released.

Monday, January 7, 2013

Some Cross-Platform Flash Alternatives

(This post has been updated with more current information.)

By now you probably know about MacTubes for OS X, and I've written about quvi on Linux, but I think it's worthwhile to go through a few other Flash/Youtube alternatives given the way Google likes to break third party apps by changing its URL paths. Also, MacTubes hasn't been updated in quite awhile and has difficulty on videos with embedded ads, so who knows how long before it completely breaks? We need workarounds that have a history of rapid updates, and that's what this post is about.

Like the title says, the three alternatives I've found are cross-platform. One's a python script, and the other two are Greasemonkey scripts that work in Firefox/Iceweasel/TenFourFox.

We're also going to be using Mplayer from the shell to stream the video. You could just as easily use VLC or the new Mplayer fork, Mpv, but since I primarily use Mplayer I'll focus on that.

On Linux you can install Mplayer with your package manager, unless you're on a G3, in which case you have to compile it with the configuration option --disable-altivec (Mpv doesn't have this complication, but it's not yet available in Debian Stable). OS X users can use Macports or Tigerbrew to install Mplayer, or you can find an older pre-compiled binary inside the application package distributed at MPlayer for MacOS X.

Now to the best command line arguments for streaming Youtube, which are:

mplayer -framedrop -cache 8192 -cache-min 10

Those arguments will prevent the picture from lagging the audio, though if you have a slower computer and lagging is still a problem, you can add the argument -lavdopts skiploopfilter=all on h.264 files. Note that last argument will slightly degrade picture quality.

Next, OS X users will want to copy and paste B-G's Mplayer scripts. They're easy to edit if you need to change Mplayer's path or add arguments, and you can save them in your ~/Library/Scripts folder so you won't have to open a terminal to start a vid. As you can see from my scripts menu (enabled in AppleScript Utility), I've created way too many for every conceivable scenario:

AppleScript menu

On Linux we'll set up quick video launching with a bash script. First, install "xsel" with aptitude/apt-get. Then create a text file and paste the following (no carriage returns on the second line):

#!/bin/bash
mplayer -framedrop -cache 8192 -cache-min 10 -cookies -cookies-file ~/.cookie.txt $(youtube-dl -gf 18 --prefer-insecure --cookies ~/.cookie.txt $(xsel --clipboard))


Save it as toob.sh and make it executable with chmod +x path to toob.sh. Don't worry, that script will all make sense in a minute.

Now that Mplayer is set up, let's switch to the video downloader youtube-dl. It's a python script that requires Python 2.6, 2.7, or 3.3. Tiger and Leopard came with 2.3 and 2.5 respectively, so you'll have to update. Python 2.7 works great for me on Tiger. Next, Linux and OS X users can follow the instructions on youtube-dl's download page to install (if curl or wget mysteriously won't work on your OS X system, you can also paste the download URL in your address bar and save the file). Once it's in your /usr/local/bin and made executable, run youtube-dl -U to update to the newest version.

Ordinarily youtube-dl is used to download videos to disk, but for streaming we'll use it to retrieve the video link only. Not the page URL, but the long URL to the actual video. Before we get to the shortcuts, let's do this from the command line to see it all under the hood. In a terminal, enter (on one line):

youtube-dl -gf 18 --prefer-insecure "Youtube page URL inside quotes"

The -g option outputs the video link only, -f 18 specifies the format of the vid, in this case 360p mp4 (with no arguments it defaults to the highest resolution, and -F outputs all available formats). The --prefer-insecure is a new option to deal with Youtube throwing up https links, which Mplayer doesn't handle (Mpv, however, does). Now you'll notice the output is a really long link. That's the link to your video! So to get Mplayer to play it, you enter in a terminal (on one line):

mplayer -quiet -framedrop -cache 8192 -cache-min 10 "youtube-dl output link inside quotes"

and to retrieve the link and play, all in one command, enter (on one line):

mplayer -quiet -framedrop -cache 8192 -cache-min 10 -cookies -cookies-file ~/.cookie.txt $(youtube-dl -gf 18 --prefer-insecure --cookies ~/.cookie.txt "Youtube page URL inside quotes")

Some people say you need those cookies options on some rare videos, so that's why I'm including them. Otherwise, they're harmless.

Now to the shortcuts. In OS X, copying the long link from the youtube-dl output and choosing B-G's streaming script from your AppleScript menu will play the video. Alternately, you can "Save As..." in Terminal.app, and where it says "Execute this command (specify complete path)" enter:

mplayer -quiet -framedrop -cache 8192 -cache-min 10 -cookies -cookies-file ~/.cookie.txt $(youtube-dl -gf 18 --prefer-insecure --cookies ~/.cookie.txt $(pbpaste))

and check "Execute command in a shell". Now when you copy a Youtube page URL to clipboard, choose the command from the File | Library submenu in Terminal.app and the video will play.

On Linux it's even easier. Just copy the Youtube page URL to clipboard and launch that bash script I showed you above. Your video will now play.

So that's one Flash alternative, but I mentioned there were two others. These two are Greasemonkey scripts for Firefox/Iceweasel/TenFourFox, so first install Greasemonkey. Then install the user script Youtube EZ Download. Now when you go to a Youtube page you'll see a box on the lower right corner with a list of download links:

Youtube - EZ Download

In OS X, copy a link to the clipboard, then choose B-G's streaming script from the AppleScript menu and watch the video. In Linux, use the Firefox add-on Open With to create a new menu item for Mplayer and its args. Then right-click a link in the Youtube EZ Download box and choose "Open Link with Mplayer".

Open With add-on

The other Greasemonkey script has been around awhile and is called Viewtube (also in the screenshots). It replaces Youtube's video player with a picture preview and several buttons for playback and downloading. You can use the Play function to play back videos with the gecko-mediaplayer browser plugin and gnome-mplayer, but that's not cross-platform to OS X. OS X users will still find it useful as the Get button works for downloading, and it replaces Youtube's CPU eating no-flash warning with the aforementioned picture preview. It also works with Youtube's Feather Beta.

So there you have it. Streaming Youtube through Mplayer with just a couple of clicks. Also, youtube-dl and these two Greasemonkey scripts have a history of frequent updates so any of Google's periodic breakages shouldn't last long.

I found a couple of other Youtube browsers I didn't try. One was yt, a command line browser, but it didn't have thumbnails so it wasn't for me. Also, there's gtk-youtube-viewer (bottom of page), but I didn't see any documentation about compiling on Debian, and knowing my compiling skills...

Thanks to Peter S. for telling me about youtube-dl :)

UPDATE: There's some good stuff in the comments, too, about UnPlug and more AppleScripts. Read on!

UPDATE II: Peter S. reports playback on his G3 is way smoother with VLC than Mplayer. Here's his VLC + youtube-dl command:

/Applications/VLC.app/Contents/MacOS/VLC $(youtube-dl -gf 18 --prefer-insecure "http://www.youtube.com/watch?v=pSwy412nttI")

So you can adjust all the above commands by pointing to the binary in the VLC app package.

Friday, December 28, 2012

LibreOffice OS X vs. LibreOffice Linux on PPC

I tried to like Abiword. Really, I gave it the old college try, but in the end I had to admit I...what's the phrase I'm groping for...utterly despise it. It's onscreen font rendering, especially monospace fonts, is terrible. Formatting large documents often caused freezes. And despite being the "lightweight" alternative to LibreOffice, it felt slow and clunky like it was ported from somewhere else, not a native Linux application. Which brings me to one of the tangential subjects of this post--the dearth of word processors on Linux.

On OS X there are the big ones, Microsoft Office, LibreOffice, Pages, etc., and there are also several lighter alternatives like Bean and iText Express, to name two. However, on Linux there's basically LibreOffice, Calligra (KOffice), and Abiword. There used to be TED, which was a lightweight RTF editor, but after being unmaintained for years it was dropped from Debian's repositories. There was just recently an update, though, but Debian hasn't reintroduced it due to the author's lack of clarity on licensing issues. I decided to waste fifteen minutes of my life compiling it only to get errors, and sure enough, it exited with errors. So here I was basically left with LibreOffice as my only fallback. Thankfully LibreOffice is a much different (and better) performer on Linux than on OS X, and I've found I can use it for actual composing and not just formatting after the fact.

Usually in OS X when I write something, I use iText Express for the actual writing and then switch to LibreOffice or a dated Microsoft Word if I need to perform advanced formatting. LibreOffice on Tiger is just too slow to actually write on. Writer uses about 130-140 MB of RAM and also has a few display bugs in monospace fonts. Em-dashes typed as "--" are displayed as "—" in Courier, though when you save and open it in another word processor, it will show the correct "--". Also, Courier and Monaco have a spacing problem with "f" followed by "i" detailed in this bug report (UPDATE: These bugs have been fixed). And it suffers from the same slight font blur I talked about in this post on OpenOffice Aqua. Not to totally slag LibreOffice. It still supports Tiger PowerPC and still works despite the quirks.

On Linux, though, LibreOffice is much snappier. Despite being on the same PowerPC hardware, Writer uses about 90-100 MB of RAM and has fast scrolling and selecting of text, none of the clunkiness seen on OS X. Also none of the font problems I mentioned above. This is something I can actually compose on. Just make sure to install it alongside the libreoffice-gtk package for GTK integration. It's a bit similar to Mozilla products, where Mozilla applications have always been more lightweight and snappier on Linux than on OS X on the same PowerPC hardware. Cool!

I still don't get the Abiword thing. It's pretty much universally praised elsewhere, so maybe it's a PowerPC thing. Also, if you're looking for one of those WriteRoom clones for Linux, FocusWriter is good. It's not strictly a word processor as it lacks page margins and a ruler, but it has basic rich text formatting like bold and italics. Overall it's a great tool for getting writing done.

Thursday, December 13, 2012

Some Ogg Vorbis Tools for Your Mac

When it came time to choose a format to encode my audio CDs with, I could have set up my own double-blind testing regimen and carefully tabulated the results in a spreadsheet, but the good folks at Hydrogen Audio already did that so why reinvent the wheel? Their conclusion was that Ogg Vorbis offered the best sound for lossy formats, better than MP3 LAME, so that's what I went with.

Obviously Linux comes with support for encoding and playing .ogg files out of the box, but on OS X you have to download a couple of tools first. To play .ogg files in iTunes, download Xiph.org's Quicktime Components (also, check out their FAQ for info on using it with 64-bit Macs). Afterward, you may notice your .ogg files are out of order when added to your playlist. To fix this, download Rescan QuickTime metadata 2.scpt.zip (the second one on the list)* from this page, unpack it, and add it to your home/Library/iTunes/Scripts folder (UPDATE: this script works in iTunes 7, but not 9, I didn't try it with 8). When you restart iTunes you'll notice the item "Rescan QuickTime metadata 2" in the scripts menu. Next, just highlight the songs you want fixed, choose the script from the menu, and your songs will magically be re-arranged in the correct order.

For encoding .ogg files, I'd been using Max for awhile, but recently it failed to look up a CD's metadata. Maybe the MusicBrainz server was down, but since Max was getting long in the tooth (last update 3+ years ago), I went looking for something newer. I went straight to X Lossless Decoder and saw their latest update (10/27/12) still supports Tiger PowerPC. Cool!

(UPDATE: I found a bug where embedding cover images in Ogg Vorbis files makes about half the files play only silence. My simple workaround for now is to disable embedding cover art in the preferences. I'll file a bug report and see what the maintainer says.) The Xiph plugin and my version of VLC were old and don't support METADATA_BLOCK_PICTURE. Newer decoders work fine.

One thing about encoding in the program, by default it dumps all the files into the parent music folder you choose in the preferences. However, if you want to organize your files in separate /Artist/Album folders, you need to go to "Format of filename" in the General preferences and add "%A/%T/%n - %t" to the text field. The forward slashes will create folders.

X Lossless Decoder prefrences

And for playing .ogg files on an iPod? Rockbox will let you do that, though it's not yet compatible with all models. And if you have something newer like an iPhone or iPad, ditch it and get an Android device that isn't crippled out of the box ;)

*Also, this page has an iTunes script that combines the metadata rescan with ReplayGain, though ReplayGain requires vorbis-tools be installed "(e.g. through Fink)."

Friday, December 7, 2012

Sharing Files Across OS X, Classic, and Linux Macs

If all else fails, there's the cloud. But if you want something faster, say a home network and you have a mixed environment with Tiger, Lion, OS 9, and Linux Macs to share files on, you have several options to play with.

Target Disk Mode

If you don't mind rebooting and need to move large files quickly, Target Disk Mode is a good option. Target Disk Mode works on any Mac with native firewire. Just start up holding the "t" key, attach it to another Mac via firewire, and it will automount as an external hard drive on Macs running Mac OS 8.6 or later, and on any recent Linux distribution, too.

AFP

Another option is AFP (Apple Filing Protocol). This is the "Personal File Sharing" option in OS X's Sharing preferences. After Tiger it was changed to just "File Sharing," which is also the name of the corresponding control panel in OS 9. In Linux, you need to install the Netatalk package for AFP client and server capabilities, no post-install configuration necessary unless you want to do something fancy;)

For sharing between OS X machines, just activate the File Sharing option on the server side, then on the other Mac choose "Connect to Server..." from the Finder's Go menu, enter its router IP address (afp://xxx.xxx.x.xxx), followed by the server machine's administrator name and password. To connect a Linux machine, go to the network folder in your file manager and where you see your host's network icon, double click it and enter name and password. If you don't see the icon you can also enter the IP address in the text field.

When adding OS 9 to the mix, there are a few caveats. Apple has been deprecating legacy Appleshare and Apple Talk services like crazy, so a lot of the older stuff doesn't "just work." I can say that I can network with Tiger and Linux hosts using the Network Browser application in OS 9. And when using OS 9 as a server, make sure the TCP/IP box is checked in OS 9's File Sharing control panel. With Snow Leopard, I could only connect to an OS 9 server, not the other way around. It may take some trial and error to figure out what works on your setup, especially if you have Snow Leopard and up, but I'll leave you some links:

This System 7 Today link shows how to network System 7 and Leopard.

A 68k Macintosh Liberation Army thread goes through a lot about Lion and old Macs, and down thread has a hack to replace Lion's AppleFileServer.app with Leopard's to enable connecting with OS 9.

Also, Lion deprecated older AFP authentication methods causing connections to fail, so look here to re-enable them.

And a last note about Netatalk on Linux, there's a bug which causes it to sometimes use 100% cpu after the server side disconnects, forcing you to kill the background process. Maybe one of these days they'll fix it:)

SSH

There's also SSH and SFTP (SSH File Transfer Protocol). The server side is activated in OS X with the Remote Login option in the Sharing preferences. Linux systems usually have the client and server software automatically installed with the openssh-client and openssh-server packages. As far as clients go, Cyberduck is a great SFTP client for OS X (3.2.1 for Tiger available in their changelog section). There's Filezilla or bareFTP for Linux, or you can even connect through a file manager. And there's an OS 9 SSH client called Nifty Telnet SSH.

There's also ftp, but that's too boring to write about, har. And if you're transfering files from OS 9, check out my post about resource forks.