How to make the Playstation 3 co-exist with Linux and OpenBSD

On Sunday I shelled out the hard earned rupees to the local Game Stop and received a brand new 60GB PlayStation 3 console. I cranked it up on the home LAN and away I went.

I will address two things in this here little article. Getting the “media server” function working with a Linux server, and how to overcome the “NAT Type: 3″ guy.

Media Server
I have a Linux media server in my basement, connected to the network primarily using NFS. I have 400GB or so of movies and music on the server and I wanted to be able to access it via the PlayStation 3′s XMB interface. I know I could install Linux on the PS3, but I’m somewhat massochistic.

The following types of files can be played under (Video).

* Memory Stick Video Format
* – MPEG-4 SP (AAC LC)
* – H.264/MPEG-4 AVC Main Profile (AAC LC)
* MP4 file format
* – H.264/MPEG-4 AVC High Profile (AAC LC)
* MPEG-1 (MPEG Audio Layer 2)
* MPEG-2 PS (MPEG2 Audio Layer 2, AAC LC, AC3(Dolby Digital), LPCM)
* MPEG-2 TS (MPEG2 Audio Layer 2)
* AVI
* – Motion JPEG (Linear PCM)
* – Motion JPEG (μ-Law)
* AVCHD (.m2ts / .mts)

( From the PlayStation(R) 3 Manual [http://manuals.playstation.net/document/en/ps3/current/video/filetypes.html
] )

You may have to re-encode your media files to be compatible with the PlayStation 3, that is outside the scope of this document. There are many mencoder(1) HowTo’s out there, you could also use ffmpeg(1). H264 is rapidly becoming a standard, and the mp4 container is widely supported, so I don’t see any overt reason one couldn’t batch reconvert their media collection. Of course this might be a non-starter for some, so you can either plug on and get the mp3 playback capability (and photos) or you can give up and proceed down to the NAT Type 3 bit. I personally hope that Sony will release DivX and XviD support in a (soon to come?) firmware update.

So, more than you needed to know about the PlayStation 3 media server feature:
This is basically DLNA, an ‘open’ standard that Sony seems to have thrown their weight behind. Essentially it’s UPnP SSDP (Universal Plug and Play Service Set Discovery Protocol) with multicast HTTP on the back end. It’s kind of like the iTunes daap music and video sharing, except instead of using Zeroconf (Bonjour / Avahi / Multicast DNS) for discovery, it uses UPnP. The software I found for Linux that works fairly well is called uShare, it is a subset of GeeXboX, a media-player Linux distribution and can be found on the geexbox website (http://ushare.geexbox.org/). It requires libupnp, which is linked on the page. The installation directions are fairly straightforward though they don’t have many packages available, so if your distribution doesn’t have one then you’ll have to do it the old fashioned way (configure && make && sudo make install). For what it is worth I use Slackware and had no problems whatsoever compiling and installing it. It is configured either in a configuration file that is fairly straight forward or via the command line. For example I have my RAID-5 array mounted on /u01, so I simply did “/usr/local/bin/ushare -D -d -f /usr/local/etc/ushare.conf -c /u01″ and the PlayStation 3 immediately found it sharing movies music and photos.

NAT Type 3
NAT Type 3 hasn’t caused me any problems as of yet, but the manual seems to indicate that direct connections don’t work in this mode. Basically what the 3 types break down to is this:

* Type 1 – Your router has UPnP enabled and I was able to map my ports.
* Type 2 – Your router does NOT have UPnP on but my ports are mapped.
* Type 3 – Your router does NOT have UPnP on and my ports are NOT mapped.

Type 3 sounds somewhat scary, but in reality that just means other PlayStation 3 consoles cannot connect directly to yours. This isn’t really that big of a deal in most cases, however it’s quite easy to solve.

The port numbers for PLAYSTATION®Network servers used for this are TCP: 80, 443, 5223 and UDP: 3478, 3479.

For voice / video chat and online game play, direct communication with other PS3™ systems is used for data transmission during voice / video chat and online gaming. The port number used for this is UDP: 3658. However, you may need to use a different port number when you are connected using a NAT router.

( From the PlayStation(R) 3 Manual [http://manuals.playstation.net/document/en/ps3/current/settings/connecttest.html] )

So I have an OpenBSD router running the pf(4) firewall and was originally getting “Type 3″ when I ran the internet connection test. All I had to do was to map 3658/udp to the PlayStation 3′s IP address and it switched to “Type 2″. Now I have a transparent firewall on the LAN as well that blocks outbound connections from the workstations, in that case I had to allow the other ports listed in the above excerpt OUTBOUND, but as long as you don’t block OUTBOUND connections, all you should have to do is map the one port (3658/udp) and your PlayStation 3 will be able to receive connections from the outside world.

Please feel free to drop me a comment or an e-mail if you have any questions or suggestions. This is not meant to be a step by step, since everyone’s network is a little different but I didn’t find much documentation on the situation so I figured I would write it up.

mernisse at ub3rgeek dot net, PSN-ID: mernisse

mernisse[] - brought to you by: ps3tag.com

bwahahaha

The world’s most influential break beat…

… and a commentary on copyright and innovation.

Lenovo/IBM support

So about 2 weeks ago my Lenovo 3000 N100 laptop battery died. I left it on overnight forgetting to plug the power in and poof, the battery went flat. Not that this hasn’t happened before but now the battery wouldn’t charge. It was reading ACPI state: Charged, Capacity 0%. I Googled a bit and found that others had had this problem and the battery was toast. Some claimed that the battery wasn’t covered by Lenovo’s warranty. So I checked e-bay and decided I didn’t want to pay for a new battery if I didn’t have to, so after going through the maze that is the IBM / Lenovo site I opened a ticket to see if the battery was in fact covered. Now mind you this was nearly 5:30pm EDT on a Friday afternoon. I received a call shortly before 6 PM from the Thinkpad support department in Atlanta Georga, and an english speaking gentleman (!!!) informed me that yes, the battery was covered under warranty and that they were going to drop ship me one. Now they said that it would ship Monday and I’d have it Tuesday, they gave me instructions on whom to contact if this didn’t happen. Filled with glee I went about my weekend expecting to be disappointed but hoping that I’d have a good experience. I was shocked Monday afternoon when I came home from work to find the replacement battery waiting for me, hot from IBM’s warehouse in Pennsylvania.

I am nothing but impressed. I am glad I purchased this laptop new. The quality and professionalism that one would expect from IBM appears to have translated well into Lenovo. Hooray!

ub[3]rgeek.net is Digg proof thanks to caching by WP Super Cache