How to use your ATV as an UPnP server
From AwkwardTV
This guide will make you use your Apple TV as an UPnP server, not a client. This will allow you to stream the music, pictures and video confined to your Apple TV's hard drive to i.e. a PS3. This is very useful if you want to listen to music from your ATV while playing a game on your PS3, or send media across your home network to devices that support UPnP, and you don't have a computer that is always-on. Great. Let's get started.
[edit] Required files
The UPnP server i will use in this guide is TwonkyMedia, as it runs silently in the background, and is 100% configurable from a web browser.
The first thing we have to do is to download the Mac OS X build of TwonkyMedia, available at http://www.twonkyvision.com/Download/TwonkyMedia/index.html. Once you have downloaded the MediaServer-X_4.4.9.zip file, unextract the zip file if your browser didn't do that already. Then, right click on the extracted package file and click "Show Package Contents". Then head into Contents, and unextract the Archive.pax.gz file, head into the unextracted directory and you should see the application Mediaserver.app. Right click on Mediaserver.app, and click Show Package Contents again. You should see two directories this time. The MediaServer directory is the one we want. The MediaServer directory already has all the files we need, so let's copy that to the ATV. Just put it into /Users/frontrow/ and you're done with the MediaServer files.
The next thing we have to do before running it is to get the required package arp. You need to have arp installed, or else Twonky will keep being mad that it's not there. You can either get arp from a Darwin build, or grab it from http://bjarkebech.com/etc/arp. Safari will probably screw up the download, so use Firefox :)
When you have downloaded arp, just transfer that into your home directory (/Users/frontrow/), and all the files we will need are there.
[edit] Getting it to work
First, make sure you have both the MediaServer directory and the arp file in your home directory (/Users/frontrow/). If you do, head into your Terminal, and ssh into your Apple TV. It should already be in your home directory. Start by running these commands to make sure that arp is executable by the system, and that it runs as root, and lastly move it to /usr/sbin
$ sudo chown root:wheel arp $ sudo chmod +x arp $ sudo mv arp /usr/sbin/arp
Great. Now all we need to do is get TwonkyMedia to run on startup. I do this by editing the rc.local file, but some will probably say it's better to use launchd. Use whatever you like, this is what worked for me. To edit rc.local, the easiest thing to do is to install nano. When you have installed nano using the guide on this wiki, open rc.local in nano by typing
$ sudo nano /etc/rc.local
Then, at the bottom of the file, type
~frontrow/MediaServer/twonkymedia -D
And quit and save by pressing Ctrl+X.
Then, you should be all set. Try to reboot your Apple TV by typing
$ sudo reboot
And when it turns back on, try to go to the web page http://your.apple.tv's.ip.address:9000/, and, if it worked, you should see the TwonkyMedia start page.
[edit] Setting up TwonkyMedia
Now, all we have to do is specify the directory our media is in. Head to the TwonkyMedia configuration page at http://your.apple.tv's.ip.address:9000/config, and you should see the list of indexed directories. Change the first one on the list to
/mnt/Media/Media Files
and save settings, and then reboot the ATV. Then you're finished, but it takes some time before it has indexed all your music. Enjoy!
