Mac GeekeryGet your geek on. |
|
blog advertising is good for you
recent popular content
User login
|
Galleon is a relatively new project that allows any system with Java to host a wide range of services for your TiVo, ranging from getting news and weather, to archiving your TiVo video and serving your own video to your TiVo. The best part is that this requires no hacking of your TiVo. All of this can be accomplished via the public HME APIs that TiVo has made available to developers. Having recently installed this software and seeing how useful it is, I wanted to talk a bit about it with some articles on MG. In this first one, I’ll go over installation and basic setup of Galleon. Later, I’ll talk about some more advanced arrangements you can make with Galleon. At its core, HME is a very simple idea: a program runs on your computer that provides services on the TiVo in the form of pictures and sound, and takes input from the TiVo to trigger changes on the computer. Galleon is a host program, written in Java, that uses a modular architecture to provide a wide range of services ranging from news (RSS) and weather (with forecasts, radar, and local alerts) all the way to podcasting and videocasting (audio-only) support. In fact, with TiVo’s ToGo and GoBack features, Galleon can also take video from your TiVo and send it back, turning your computer into an additional TiVo in the home, essentially. A complete list of features as of 1.6 includes such things like: an RSS reader for reading news on-screen; an MP3 player that uses either using your iTunes playlists, custom M3U playlists, or by presenting an organized display based on ID3 tags (no AAC support as yet; does support streams); a photo browser that navigates a hierarchy and gathers all photos for display; a Shoutcast client that uses the streams listed on Shoutcast a weather module that includes local status, forecast, radar, and NWS alerts for your area; a webcam viewer a basic e-mail client a local movie listings module; a viewer for Internet slideshows which are just photo attachments in an RSS feed; and videocasts which requires some tweaking to get working right but does work. InstallationInstallation of Galleon can be very easy. Just make sure you understand that you’re going to have to get a little dirty to get started and that you’ll also need to do a little thinking about how you want things laid out in your home network as well. Requirements
To gauge, I’m running this on a G4/450 and things have a slight delay, but it’s more than acceptable for what I get. PreparationYour Mac should be on the same IP subnet as your TiVo. Both should, ideally, have a static IP on your home network (you’ll see why in later articles). Ideally, your HME server (the Mac) will have one interface so that ZeroConf works correctly both ways or, if you have two, you have the primary interface as the local LAN. If you have something special, you’ll have to do some manual configuration later that I don’t go into here. Obtain the PackageGo to the Galleon downloads page and get the Mac OS X package. If you’re unskilled in the geekery of Java class paths, don’t even think about getting the ZIP file. Even if the Mac package is behind, get the Mac package. If you’re good with class paths, get the latest ZIP and have at it. Because the package installs into InstallIf you’re using the package file, double-click and run through it. If you’re using the ZIP file, find a handy place and run the Unix directions on the Galleon install page. Understand that the Mac package comes with two scripts: run.sh and gui.sh. These set the class paths and then run the JAR with the proper arguments for the server and the GUI interface, respectively. It would be best to make sure these exist and work for you now. StartYou’re going to want this to run in the background all of the time so you don’t need to worry about it, but Galleon requires the It’s widely-known that I’m launchd’s bitch. It stands to reason I got that working within minutes.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.sourceforge.galleon</string>
<key>ServiceDescription</key>
<string>TiVo HME Server</string>
<key>Program</key>
<string>/bin/bash</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>/Applications/Galleon/bin/run.sh</string>
</array>
<key>RootDirectory</key>
<string>/Applications/Galleon/</string>
<key>WorkingDirectory</key>
<string>/Applications/Galleon/bin/</string>
<key>StandardErrorPath</key>
<string>/Applications/Galleon/logs/galleon.err</string>
<key>StandardOutPath</key>
<string>/Applications/Galleon/logs/galleon.log</string>
<key>Nice</key>
<integer>5</integer>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>30</integer>
</dict>
</plist>
I’ve done a few things here that are more than the basic, required elements. I’ve rooted the process in its own root directory, niced the process so it doesn’t take the machine over, put the output of the program into logs, and told it to make sure it’s running every 30 seconds to give it time to die completely if/when it does die. If you want to just run this from Terminal, as you should during testing, do so as such: $ cd /Applications/Galleon/bin $ ./run.sh Either way, get it started. Setup and RunOnce the server portion is running you’ll need to do basic setup which, for this install article is “add a module and prove that it’s working.” First, run the GUI: $ cd /Applications/Galleon/bin $ ./gui.sh You will have to do this every time. What you can do is save these two lines in a text file, add “#!/bin/sh” at the top, call it “Galleon.command” and then set the execute bit. Then when you open it in the Finder, Terminal will run the commands for you. In the GUI go to the File menu and pick Properties. Enter all the information for your TiVo, if needed. Close this and go to File again and then New App. Enter “News” for the title and pick “RSS” for the type and hit OK. Pick News from the list and then add a feed (like, say, “Mac Geekery” and “http://www.macgeekery.com/node/feed”) and hit Apply. Go to your TiVo and get to TiVo Central. Pick Music and Photos and then, if you have 7.2, you’ll have the option for “Enable Home Network Applications” (if it’s “Disable” then leave it alone). If you see “Enable” here, pick it to turn it on. If you’ve done things right then “News” will show up here. Pick it and you’re good to go. [series-info:center]
About Adam Knight
Author Biography Adam Knight is one of the founders of Mac Geekery and is a geek at heart. Programmer by day, hacker by night, his daily life revolves around the Macintosh platform, which he has been a user and programmer for since the early days of System 7 when his LCII replaced his Apple //c. In-between tech jobs, he’s managed to learn the basics of any web hacker: PHP, MySQL, Perl, Apache, Linux, *BSD, and the intricacies of ./configure —prefix=~/bombshelter/. Today, codepoet is concentrating on blogging again, writing some software for the Mac by himself (including Notae) and for his company (such as Switchblade) and has a few other toys coming out soon. Bug him over AIM or email [link fixed]. |
I’d love to see a future article on how to wrap this using Jar Bundler, so it can be double-clicked similarly to iSeeiTunes. Ideally it would check if the server is already running (such as via launchd) and if not, launch it for the duration of the app configuration. This would also be useful if for some reason you don’t want Galleon running all the time.
Another tip – use an AppleScript with “do shell script” to avoid opening the terminal to fire up Galleon (such as via a *.command file).
One final request – how can we use TivoGoBack with mencoder to stream Divx files, for example. I have gigs of anime that I’d love to watch in this fashion, if it’s possible.
While I will discuss GoBack, understand that it’s not streaming. You transcode a file and then transfer it to the TiVo, which plays it like any other stored content.
I’ll talk about it in detail, though, as it’s something I’ve wanted as well.
—
cp
I tried the above launchd plist and it didn’t work – it never even wrote anything to the log files. I attempted to log in via SSH and start Galleon that way to see what would happen, and it doesn’t appear that it can run at startup, as it needs access to the window server:
kCGErrorRangeCheck : Window Server communications from outside of session allowed for root and console user only
java.awt.image.BufferedImage
java.lang.NoClassDefFoundError: java.awt.image.BufferedImage
java.lang.NoClassDefFoundError: java.awt.image.BufferedImage
Galleon 1.6.0 is starting…
java.lang.UnsatisfiedLinkError: createFont
java.lang.NoClassDefFoundError: java.awt.image.ColorModel
Galleon is ready.
java.lang.NoClassDefFoundError: java.awt.image.ColorModel
java.lang.NoClassDefFoundError: java.awt.image.ColorModel
./run.sh: line 42: 214 Bus error java -server -Xms64m -Xmx64m -Djava.awt.fonts=”$JAVA_HOME/lib/fonts” org.lnicholls.galleon.server.Server
Any ideas?
Note in the error that root can get access to the window server session. Put the item in /Library/LaunchDaemons and it should run as root. Otherwise, you can set the machine to auto-login and drop it in one of the LaunchAgents folders. Since I have mine set to do this so that iTunes and iPhoto open for sharing, that’s what I’ve done.
I remember getting it working in LaunchDaemons at one point, but I recall it was iffy.
—
cp
I think the problem with that plist file is the RootDirectory directive, it makes launchd chroot() before execing the script, then since galleon doesn’t have an entire OS install, no go.
This plist file works for me:
although note I’ve modified the top of run.sh and gui.sh to pick up their home directory.
The daemon script:
and the GUI script:
Is there not some way to use this with Series 1 or DTiVo’s? It’s something I’ve been trying to hack my way through for some time…
Sorry, bud, but this isn’t even possible on Series 2 machines not running the latest software. For Series 1 there’s a world of hacks to add webpages and decoding the video and so on, but it just doesn’t have HMO/HME capabilities.
Time to upgrade.
—
cp
It’s pretty cool to be able use iTunes with my TiVo again but check me on this, please: I can transfer recorded shows from my TiVo to my Mac, but they’re still encrypted, meaning I’m still out in the cold when it comes to archiving my TiVo’d video, right?
That’s right. To decode them requires a Windows computer and some additional geekery.
—
cp
A follow up on the last comment. A handy little application has been made available to decode TiVO video. It is a handy Applescript rapper around a short perl script for transfer and decoding. The TiVoDecode Manager is quite handy. Though unfortunately the transcoder is not terribly quick but if you are happy with MPEG2 it works pretty fast over a 802.11g network.