Subsonic on Apple TV - missing artwork

General discussions.

Moderator: moderators

Subsonic on Apple TV - missing artwork

Postby Mike C. » Fri Sep 24, 2010 3:00 am

I've been running Subsonic on my Mac mini for a while, then got the idea to run it on my Apple TV instead. It runs great, streaming MP3 files from a USB disk drive attached to my wireless router.

The only not-so-great part is the lack of album artwork. When I had it running on my Mac, the artwork would display OK, in both the web UI and on my iPhone (running the iSub app). Now that it's running on the Apple TV, I only get placeholder links in the UI and in iSub.

In the subsonic_sh.log, I get errors like these (one for each album):

subsonic_sh.log:88573132 [btpool0-50] WARN org.mortbay.log - /coverArt.view: java.io.IOException: Failed to create thumbnail for /Users/frontrow/subsonic/music/mp3/Louis Armstrong/The Essential Louis Armstrong/Folder.jpg. Could not initialize class sun.java2d.Disposer

I installed Soylatte (Java 6 Port for Mac OS X) on the Apple TV in order to run Subsonic...is it missing the class noted in the error message above?

I realize it's a long shot that anyone has tried this particular configuration for running Subsonic, and if I can't see the album art, no biggie. But if anyone here knows anything helpful, please post it here. Thanks!!
Mike C.
 
Posts: 7
Joined: Fri Sep 24, 2010 2:49 am

Fixed it

Postby Mike C. » Sun Oct 03, 2010 2:27 am

The best problems in life are the ones you solve yourself.

I traced the error back to a complaint about AWT not being able to find libXext.6.dylib in /usr/X11R6/lib. Duh...Apple TV isn't meant to have graphics capabilities. So I copied this over from my Mac to the Apple TV.

Next, I added the following option to the "java" command line in the subsonic.sh startup file:
-Djava.awt.headless=true

...and now it works. Album art now appears in the web browser, as well as on the iSub app running on my iPhone.

If you have an older Apple TV (the silver & white one, not the small black one), I can't think of a better place to run Subsonic. If you don't have an Apple TV, and can get one for cheep, you should consider picking one up and installing Subsonic on it. Takes a little bit of hackery, but it's very cool once you get it working.
Mike C.
 
Posts: 7
Joined: Fri Sep 24, 2010 2:49 am

Postby ftwo » Sun Oct 17, 2010 3:36 am

How exactly do you get Subsonic working on a new AppleTV (the tiny black one)?!

Thanks ...
ftwo
 
Posts: 5
Joined: Wed Apr 28, 2010 3:33 am
Location: Germany

Postby 2ears » Wed Oct 20, 2010 5:44 am

ftwo:
"How exactly do you get Subsonic working on a new AppleTV (the tiny black one)?!

Thanks ..."

ftwo, you need something with a hard drive. The older AppleTV was, effectively, a little linux box. The new (little black) one isn't -- no storage.
2ears
 
Posts: 2
Joined: Wed Oct 20, 2010 5:40 am

Postby 2ears » Wed Oct 20, 2010 5:47 am

Mike C,

Just wanted to add you're brilliant -- I never thought of using my (older) AppleTV that way. Thanks for not only figuring it out but posting here with tips on how to accomplish it.

The only downside, I suppose, is the 160GB hard drive. If one's collection is bigger than that, SOL. Or are you able to mount network shares?

Interested to hear what you've been able to do.
2ears
 
Posts: 2
Joined: Wed Oct 20, 2010 5:40 am

Postby Mike C. » Wed Jan 05, 2011 5:14 am

(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.
Mike C.
 
Posts: 7
Joined: Fri Sep 24, 2010 2:49 am

Re: Subsonic on Apple TV - missing artwork

Postby CasN » Mon Aug 15, 2011 8:47 pm

The new atv2 still has a 8gb solid disk so should be enough.
I now run Subsonic as a XBMC plugin on a jailbroken ATV with a remote XBMC android app.
This works pretty neat but would prefer to run a subsonic client in native mode since I have no need for XMBC nor the other apple stuff, simply music to my stereo via optical cable.
If there is a better idea to put this in action, would like to hear so. :D
CasN
 
Posts: 35
Joined: Wed Jan 12, 2011 2:24 pm

Re: Subsonic on Apple TV - missing artwork

Postby CasN » Thu Sep 22, 2011 10:42 am

Thought I would give it a try on my atv2.
I am running into an issue while installing Java.
Following the instructions on http://wiki.awkwardtv.org/wiki/Install_Java, I end up with actually 3 issues:
The symbolic links to be created will not work since those directories do not exist within "/Library/Frameworks".
Nevertheless I do get Java running biut it comes back with "Bad CPU type in executable".

Suppose I used the wrong binary, which one should I actually use?
Thanks for some feedback :mrgreen:
CasN
 
Posts: 35
Joined: Wed Jan 12, 2011 2:24 pm


Return to General

Who is online

Users browsing this forum: No registered users and 5 guests