(warning: long & verbose...probably incomplete too)
Here are some notes on my Subsonic-on-AppleTV setup. I don't remember the exact steps I took to get it running, but thought I'd at least make an attempt here.
Note that I'm not volunteering as some kind of support expert...the following is just raw/unformatted brain droppings, I'm not responsible for anything you choose to do to your Apple TV, I am not a lawyer, your mileage may vary, contents under pressure, etc.
OK, first off, mine is an old-skool Apple TV with a 40GB hard drive, not the cool black hockey-puck one. As it turns out, I don't really need much in the way of local storage at all, since all my music is actually elsewhere on the network. More about that in a minute.
The very first thing to do, of course, is to get ssh access. (I understand that this is now possible on the new black Apple TV, too.) I made a patchstick, following instructions that I found on awkwardtv.org, to do this. BTW, awkwardtv.org has a lot of very cool hacks, etc., but I dunno how many of these are applicable for the new ATV. Also, there's a lot of old/dated stuff on that site...some of the hacks there work better than others.
Login like this, from your "real" computer (mine is a Mac mini):
ssh -1
frontrow@appletv.local
The password is frontrow.
Now you're in. Use the df -h command to see how much free disk space you've got. Old disk-based ATV users are in luck, because Subsonic doesn't require very much space at all. New ATV users, without disk, might be out of luck...I dunno. You need disk space, plus write permissions. Try this:
touch foo
If it says "permission denied", or "read-only filesystem", you'll have to fix that. You can always use the "sudo" command to become root, and then you can do whatever you want.
[By the way, as long as you've got ssh, you should also get scp running so that you can transfer files back and forth. (I can't remember how I did this, or even if I had to do anything special to get scp working...) The only editor available is "ed". Unless you really want to relive the bad old days before full-screen editors, you should consider editing all of your files on your computer, and then scp them to the ATV. I suppose you could install vi, emacs, or some other editor on the ATV, but for me it was more trouble than it was worth.]
I seem to recall an issue, long ago before I started messing around with Subsonic, about the ATV disk being mounted as read-only. I had to issue some kind of magic incantation to mount it as read-write instead, at one point. Can't remember now, and haven't had to worry about this for a while...hopefully this won't bite you.
If you're going to be doing stuff as root, you might as well setup the /etc/sudoers file so that the user "frontrow" can issue commands as root without having to type a password all the time. Here's the entry in /etc/sudoers that does it for me:
%frontrow ALL=(ALL) NOPASSWD: ALL
Next, you need to install Java. The one I'm using is SoyLatte, available at
http://landonf.bikemonkey.org/static/soylatte/. OK, it's not *real* Java, but hey, it runs Subsonic just fine. Download it onto the ATV, install it, etc. I leave this as an exercise for the reader - you're done when you can type the word "java" at the command line and something happens.
Now for Subsonic: I did this as user "frontrow":
cd
mkdir subsonic
cd subsonic
Next, I copied the Subsonic standalone version from
http://www.subsonic.org, and unzipped it into the subsonic directory.
The subsonic.sh file is the thing that you run to start Subsonic. I had to make a modification here: Subsonic assumes that it's running on a system that supports the X Window system, which the ATV most assuredly does not...and unless you tell it otherwise, It Just Won't Work. In my subsonic.sh file, I had to add the following option to the line that starts up subsonic-booter-jar-with-dependencies.jar:
-Djava.awt.headless=true \
Subsonic will roll over and die if you don't include this, and the only way you'll find out is by looking at the log. [The key to really understanding Subsonic, or any Java application for that matter, is to get really good at reading the logfile. For example, earlier in this thread, I was having problems with Subsonic not displaying artwork...turns out it was missing an X Window graphics library file (scroll back & take a look at the solution). Runtime errors like this happen all the time in systems of any complexity at all, so take the time to really study the logs - you might not be as stumped as you think you are. And if you are stumped, well, that's what Google is for, right? Or some of the other ATV hackers out there.]
I think that's it for getting Subsonic running. Now, on your computer, you can point your browser to
http://appletv.local:1234 (or whatever you set your SUBSONIC_PORT to) and login. Did it work? Great! Stop and drink a beer.
Now I have a Linksys/Cisco WRT54NL router. It's plug-n-play compatible, so it was really easy to setup my own Subsonic URL (i.e.,
http://________.subsonic.org). But first, I had to setup my router...
My first stop was
http://portforward.com - great site. Chances are your router is on the big list that they've got there, and there's lots of good step-by-step instructions. Here are the things I did to my router:
* Setup the Apple TV with a static IP address. If you let the ATV grab whatever DHCP gives it, you'll have to change things all the time, and it's a pain. Static IP is the way to go.
* Setup port forwarding. My ATV has a static IP address of 192.168.1.101, so in the router firmware/configuration, I enabled both TCP and UDP on port 4040 (my $SUBSONIC_PORT), external and internal. I also had to do the same thing for port 80 (not quite sure why, but Subsonic didn't seem to like it much without this available).
* Make sure you actually enable uPnp (universal plug-&-play) in the router firmware, so Subsonic can configure it for you.
Back in the Subsonic UI go to Settings | Network. Ask it to setup "foobar.subsonic.org", or some other domain name of your choosing. If all goes well, it'll tell you "success". Try it out - go to
http://foobar.subsonic.org and see if it works. Now you can get to your Subsonic music from anywhere in the world there's web browser.
Wait a minute...what music? You could setup a folder on your ATV disk with all your music, I guess. I have a larger music collection than would fit on the ATV disk, so...
My Linksys router has a USB port at the back, and I plugged in a cheapo USB drive into it. The router firmware lets you set this up as storage (StorageLink, they call it). So I went ahead and did that, and then copied my MP3s onto it. I setup a cron job to do this for me every night, using rsync to copy all my MP3s from my iTunes library to the drive attached to the router (I named it "public", for no good reason). It's pretty much set-it-and-forget-it at this point: If I add something new to iTunes, it shows up on "public" soon after.
Now, on the Apple TV, here's how I mount the disk:
sudo mount_smbfs //admin:admin@192.168.1.1/public /Users/frontrow/subsonic/music
For the life of me, I can't remember if I had to do something special to allow mounting SMB/CIFS volumes. Try it and see if it works for you...else Google it, I guess. Once you mount this, you can setup Subsonic so that it'll look in this directory for its music...and now you're good to go.
Now for a couple of things that don't work so well with this setup:
* My router sucks as a NAS device. It's just plain unstable. One of these days I'm going to get something more reliable...sometimes it'll just unmount right out from underneath Subsonic, which is no fun. An actual, purpose-built device would be better for this, methinks. Even better yet would be just to directly attach a USB disk to the ATV, but that's probably too much to ask (thanks Apple).
* Subsonic itself will usually run a few days, and then just...stop. I don't know why. It did this before when I had it running on my Mac mini. There's nothing interesting in the logfile, either - it. just. stops. I haven't bothered to report this to Sindre b/c I can't reproduce it. Besides, I have a workaround (see below).
My solution to both problems is a shell script: It's basically an infinite loop, with a "sleep 3600" at the bottom, so it only wakes up every hour. Then it (a) checks to see if the disk attached to my router is mounted, and if not, it mounts it; (b) does a "ps -ef" command to see if Subsonic is running, and if not, starts it.
I could've installed "cron" on the Apple TV. I could've filed a Subsonic bug report. But my "solution" is more hack-ish, and thus more fun - so there!
One more thing - not ATV-related, but definitely worth checking out: I have an iPhone, and have installed the excellent iSub app from Ben Baron (isubapp.com). $5 from the App Store, and worth every cent. I simply point it at my subsonic.org URL, and bingo - streaming musical goodness from my ATV to my phone, anywhere there's a 3G connection - at work, in the car (with the iPhone plugged in to a cassette-tape adapter), or wherever. To make this setup work, you have to do two things:
* Purchase a Subsonic license. iSub uses the Subsonic REST interface, which only works for 30 days. It costs E10 (sorry, don't have a "euro" symbol on my keyboard). To pre-empt any griping about the price, I, for one hope Sindre makes a million dollars (euros?) off Subsonic, and am happy to purchase a license.
* iSub works great on wifi; however, over 3G networks, the playback can stutter or slow down. I solved this by setting up iSub to play at 128K when connected to 3G. You do have to setup the Subsonic server so it'll transcode on the fly...I setup Lame on my ATV, and it works great.
To sum up: This has been a fun little project, and a great use for an old Apple TV. (I still also use my ATV for streaming movies from my Mac. and can also stream from Subsonic at the same time elsewhere in the house.) I'd be very curious to see if anyone has success with a setup like this on the new diskless ATVs...I'm thinking of buying one for my second TV upstairs.
-Mike C.