SageTV Community

SageTV Community (http://forums.sagetv.com/forums/index.php)
-   Hardware Support (http://forums.sagetv.com/forums/forumdisplay.php?f=9)
-   -   SageTV on PS3 via BD-J, possible? (http://forums.sagetv.com/forums/showthread.php?t=39654)

devinteske 02-15-2009 11:17 AM

SageTV on PS3 via BD-J, possible?
 
I've been doing some research on the BluRay BD-ROM architecture and discovered that BD-R/E discs have the BD-J specification which allows the execution of custom Java code via a BluRay disc.

Does anybody else think that it might be possible to get SageTV Client (a Java app) to run on the PS3 via the BD-J spec?

I think that this would be an amazing expansion of SageTV, to be able to load a BluRay disc (BD-R/E) into my PS3 and be able to connect to my SageTV server (running on another PC connected via LAN) to watch all my media.

I believe that this could work as long as the following are true:

a. The Sony PS3 provides a full and complete Java runtime environment to BD-J native code or at least a mechanism for providing your own JRE.

b. PS3 allows BD-J code to access system resources to create either a temporary swap space or RAM disk for buffering media content.

c. BD-J runtime environment handles all the normal system calls inherent to desktop use (for example, what will happen when SageTV under BD-J requests to create a new window? maximize or minimize? or handle window movement when there may be no toolkit API for such things (since the PS3 is not really a Desktop environment let-alone that there are no such things as windows when running under the BD-J environment).

d. What will navigation be like without a mouse? Can we integrate with the PS3 Bluetooth-based remote? Can we integrate other USB remote re/transcievers?

I for one believe that if Frey Technologies created a BD-R ISO that allowed you to turn your PS3 into a media extender simply by inserting a disc and loading it up like a game... a great many would pay upwards of $80 to gain such functionality. Sure, it may bite into sales of the HD200 a little (since you could get full 1080p output) but not everybody would go this route since the PS3 would need to have the disc in to use Sage (whereas the HD200 is a dedicated extender).

Of course, the next step would be to see if we could get Sage to install a local copy to the hard disk in the PS3 so you could run it whenever you like without the disc.

Cool idea, no?

Here's a link to a discussion about BD-J that I found that seems interesting. Hopefully Sony opens up BD-J for desktop development without licensing fees (like that would stop us... we could just reverse engineer the whole thing... BUT, one thing I can't do is de-compile SageTV for modification if it won't work out-of-the-box on a straight migration effort... APIs will likely need to be changed for the BD-J environment).

http://www.blueboard.com/bluray/article_blu.htm

Edit:

According to additional research:

Quote:

Authenticated applications can use a (signed) permission request file to acquire permissions that go beyond the BD-J sandbox. Permissions can be acquired for:
Reading and writing to local and system storage
Using the network connection (to connect to defined servers)
Access of the file system on the BD-ROM disc
Title selection of other titles on the BD-ROM disc
Control of other running BD-J applications
So it looks like all our concerns can be met. SageTV will have to be a signed app to gain access to local storage and network services (like connecting to a SageTV Server on the network). The only thing that looks daunting is that a special UI framework is used (Havi6). I wonder if Sage's own UI could just by-pass this or if it will have to be re-written to use Havi

Edit 2:

As per other frameworks that Sage might use, I found on Wikipedia:

Quote:

In addition to the standard BD-J APIs, developers may make use of existing Java libraries and application frameworks, assuming they do not use features outside the constraints of the BD-J platform, include that Java ME only supports Java version 1.3 class files.
That's reassuring to know that Sage can rely on standard libraries, but will likely have to be modified to support accessing of PS3 resources (like Local drive access for media buffers), signing of the app to allow BD Live features (network access), and remove some features that may violate the Jave ME environment rules.

paulbeers 02-15-2009 07:32 PM

It's entirely possible, infact the first HD "extender" that Sage ever showed off was a blu-Ray player running the Sage interface. This was done at CES about 2-3 years ago (if I remember correctly); however, Sage did not end up going down this path for its extenders (unknown as to why). My point is that Blu-Ray players running Sage is very possible.

stanger89 02-15-2009 08:55 PM

Actually they showed that at last year's CES (Sage something running on a Pioneer BD player, streaming video from a Dish STB), which was after the MVP and HD100 were released.

Frankly though I doubt it was running as a BD-J app.

stuckless 02-16-2009 07:38 AM

I think that BD-J could easily provide a SageTV client or placeshifter. According to the Blu-Ray page on wikipedia, it's subset of MHP, which is already used in set top boxes.

If you have a blu ray burner, check out the HD Cookbuok project, it's contains all you need to get started.

You used to be able to run bd-j apps on you PS3 using a thumbdrive, but sony closed that hole... I guess they didn't want to flood the market with bd-j developers... but before the hole was closed, some people did write some stuff. Most notable was the PS3 Filer with NES emulation... So you could play your NES roms on the ps3....

I don't have a bluray recorder, but i do have a ps3. For a while I was toying with trying to write up something... but without a recorder, it's not worth learning it... So instead, I installed, ps3 media server, which is basically a upnp server. You'll want a direct network connection and a fairly beefy server to run the ps3 media server, since it will be doing transcoding on the fly for most files, especially mkv files.

I think the main reason why sage doesn't do something like build a ps3 placeshifter client boils down to $$... I'm not sure how many sage users there are... but the the overlapp of ps3 users that are also sage users, is probably pretty small.

What would be interesting, and this is off tangent from the OP, so my apologies.... would be if Sage did a working prototype of a ps3 placeshifter... then they could open-source (gpl) it and open their placeshifter network streaming protocol. This way, people could still write native clients (ps3, xbox, applettv, iphone, etc), but you'd still need a client/placeshifter license for those clients to function. I doubt they'd do it... but it would be interesting.... Today, people like myself, run upnp servers with ps3 and xbox clients, but sage doesn't get a license cut from those clients.... if the the network streaming protocol was opened, then at least there is the potential to get license revenues from other native clients, without having to invest money into writing and maintaining the 3rd party clients.

devinteske 02-16-2009 08:20 PM

BD-J Possible?
 
I already downloaded a few BD-J resources already and am simply deciding whether to buy the burner first or an SD200 :) lol

If I buy the burner and get the PS3 working as a client/shifter then I won't need to buy the HD200 since I assume that a PS3/Sage combo would be able to play about any format up to and including 1080p MKV.

I'm thinking about starting off with a BD-RE (rewritable) so that I don't waste discs (and money).

I think that it all should go smoothly except for this one hitch in my gallop. I believe that I'm going to hit a brick wall at program instantiation.

Of course, I can copy the necessary files over to a BD and satiate the [assumedly] numerous library needs. However, what happens if/when Jave ME shuts down the app for making an illegal request? In addition, if the apps are not digitally signed, then they will be unable to request disk access or, more importantly, network access (BD Live). Those features are reserved for trusted applications. Either of these problems would likely require access to the source code to make the necessary changes.

Unfortunately, it looks like the PS3 provides a custom toolkit for requesting and managing resources such as BD Live and local disk access. We won't know until we crack open the PS3 BD-J ISO that I found yesterday which demos how to get this stuff working. If it's a custom API then we MAY need the Sage source to plug in the necessary calls.

On the other hand, something which I don't have much experience with, it may be possible to modify the built-in behaviour of Sage via STVi or other plugin mechanism. I'll need independent validation of such a claim but my initial thought is to say that it should be possible with some (arduous?) work.

stanger89 02-16-2009 08:37 PM

Quote:

Originally Posted by devinteske (Post 338859)
I already downloaded a few BD-J resources already and am simply deciding whether to buy the burner first or an SD200 :) lol

If I buy the burner and get the PS3 working as a client/shifter then I won't need to buy the HD200 since I assume that a PS3/Sage combo would be able to play about any format up to and including 1080p MKV.

The big issue with doing a "roll your own" Placeshifter BD-J thing, is that Placeshifter doesn't know anything about the "hardware" Blu-ray audio/video decoding interfaces. That means it would have to do everything in software, which may or may-not be possible.

But beyond that it's even more problematic. BD-J is (as noted) a quite limited in it's capabilities, most likely far more limited than the code for Placeshifter uses. And then there's the question of rendering Audio/Video, which is probably very different in a BD-J VM vs a PC, especially considering the security requirements for accessing hardware directly.

Placeshifter uses an (AFAIK) x86 build of Mplayer to decode/render video, you'd also need a PS3/BD-J version of that for a PS3 "build".

panteragstk 02-17-2009 12:05 AM

I think this is a great idea, but I think the route of bd-j working with sage and the ps3 might be the wrong way to go about it. There is a version of linux (yellow dog) that does work on the ps3 and can use it's hardware correctly (from what i've read). That being said, it looks like the linux version of sage may be the best way to get sage to work with the ps3. It would probobly have to be modified in some way, but it would be a starting point. I wish I knew something about programming so I could give it a try. The only downside is that sage linux is oem and there is no trial so whoever tried to undertake this project might be out $80. This would be great if somebody could get this to work.

gplasky 02-17-2009 06:09 AM

The version of SageTV for Linux is the server portion. Unless you want your PS3 to be your Sage server all you should want to do is get Placeshifter working on the PS3. There is no Linus "client" per se.

Gerry

stuckless 02-17-2009 06:43 AM

There are a few linux distros for the ps3.... Someone has even has freevo working on the ps3/linux as well. From what i can tell, sony does not allow linux to have access to the hardware accelerated gpu.... or hdmi out. (so basically useless)

As for sage under linux on the ps3... you'd need to recompile the native libraries for sage in order for that to work, so a placeshifter for ps3 won't run unless sage provides a build.

Brent 02-17-2009 07:55 AM

Quote:

Originally Posted by gplasky (Post 338917)
The version of SageTV for Linux is the server portion. Unless you want your PS3 to be your Sage server all you should want to do is get Placeshifter working on the PS3. There is no Linus "client" per se.

Gerry


Hmm, I guess I just now realized why SageTV isn't selling a linux variation of the client software. They want to control how Sage is embedded into devices I'm guessing...

stanger89 02-17-2009 08:02 AM

They don't sell a Mac version of client either, they use Placeshifter as their Linux/Mac client. It's probably got more to do with architecture than anything. Most of the big differences between Placeshifter/Client are Windows specific (eg Directshow).

And FWIW, extenders have a lot more incommon with Placeshifter than they do with Client.

Brent 02-17-2009 08:15 AM

Quote:

Originally Posted by stanger89 (Post 338929)
They don't sell a Mac version of client either, they use Placeshifter as their Linux/Mac client. It's probably got more to do with architecture than anything. Most of the big differences between Placeshifter/Client are Windows specific (eg Directshow).

And FWIW, extenders have a lot more incommon with Placeshifter than they do with Client.

I have so much to learn. Some day I need someone to give me a primer on how the extenders work behind the scenes and how the embedded linux on the extenders is used.

FWIW, I would love to see a Blu-ray player with SageTV extender capability. PS3 support would be nice, but a wider audience would be reached with a Blu-ray/SageTV extender. Either way, I read these sort of threads with great interest to learn and to ponder what if.

devinteske 02-17-2009 09:38 AM

Quote:

Originally Posted by stanger89 (Post 338929)
They don't sell a Mac version of client...

Where have you been? I've been using the Mac client for years on an iMac DV (300MHz, LoL... can't play video via Sage but it accesses music and everything else) and a MacBook (Core2Duo; White).

That's a little off-topic though and for another discussion.

Does anybody know if it is possible to run a live-OS off a CD/DVD/BD on the PS3? I can't imagine that Sony would allow the PS3 to be booted off optical media into a 3rd-party OS like Mac/Win/Linux/Unix BUT if it was possible then we could have a myriad of options like simply booting into a Linux environment to run the placeshifter.

I have thought about the possibility of simply installing YD Linux onto my PS3, the JRE and a placeshifter. The odds of that working are almost 100%.

Now, I know that it used to be the case that you can't access the accelerated GPU under Linux, but I remember seeing news that this is no longer the case (either by way of Sony unlocking the cell processor fully on Linux or by hackers writing their own driver, can't remember which it was).

I'd rather keep my PS3 the way that it came, however. Finding a way to run Sage on the PS3 via a disc or as a program would be preferable, though much more difficult.

Now, here's a thought... I wonder if the HD200 firmware could be rewritten for the PS3? No, I'm not a raving lunatic that has lost his mind... what would need to be done is that we'd have to write a BD-J wrapper to invoke the HD200 firmware. The BD-J wrapper could tie into the specific hardware interrupts and translate APIs in realtime (I have little doubt that the PS3 is powerful enough to handle such a daunting task). Sure, such an approach may be daunting and require rather low-level knowledge of the PS3, but if it could be done, then Sage would not need to maintain a code-base for the PS3. With each new revision of HD200 firmware, we could simply burn a new BD that has the necessary emulation code in the BD-J spec on the disc.

stanger89 02-17-2009 09:56 AM

Quote:

Originally Posted by devinteske (Post 338948)
Where have you been? I've been using the Mac client for years on an iMac DV (300MHz, LoL... can't play video via Sage but it accesses music and everything else) and a MacBook (Core2Duo; White).

Not using a Mac ;), I thought Mac was just stuck with Placeshifter.

Quote:

I have thought about the possibility of simply installing YD Linux onto my PS3, the JRE and a placeshifter. The odds of that working are almost 100%.
I rate it closer to 0%. Placeshifter uses native libraries (at least MPlayer/SageTVPlayer), you'd need Cell-compiled versions of those to run placeshifter on the PS3.

Quote:

Now, here's a thought... I wonder if the HD200 firmware could be rewritten for the PS3?
By us? I doubt it, very different processors/architectures.

Quote:

No, I'm not a raving lunatic that has lost his mind... what would need to be done is that we'd have to write a BD-J wrapper to invoke the HD200 firmware. The BD-J wrapper could tie into the specific hardware interrupts and translate APIs in realtime (I have little doubt that the PS3 is powerful enough to handle such a daunting task).
But I don't think the BD-J VM is robust enough to support that sort of thing. Even if you were to somehow get your app signed to allow it access to the hardware.

devinteske 02-17-2009 10:14 AM

I've been reading up on Linux for PS3 and it appears that the Cell processor understands the PowerPC instruction set. That being understood, the only version of Sage that is compiled for PPC is the Mac version.

I'm not a Java developer (by choice despite knowing the language), but somehow I highly doubt that the Mac client will work on Linux simply because they are both PowerPC.

Now, there may be some emulators out there (anybody remember Bassilisk?; a 68k mac emulator for Linux).

Those are lofty aspirations, but one solution I think might just work is if we can install VMware onto the PS3 Linux distro (beit YDL, Ubuntu, RH FC, or other distro that's successfully been ported to PS3). Running a PPC version of VMware on the PS3 under Linux could mean that we could virtualize an x86 OS on the PS3. However, I think that one problem we'll run into is the performance of the virtualized hardware within the Guest OS (virtual machine). I doubt that VMware would give us a video card that is powerful enough to display 1920x1080 resolution (we might be able to achieve 1280x720 though).

stuckless 02-17-2009 10:52 AM

Quote:

Does anybody know if it is possible to run a live-OS off a CD/DVD/BD on the PS3?
Petriboot is a bootloader for the ps3.... it will allow you to run a live cd or boot from external storaget (usb).

Given that BD-J provides a MediaPlayer (JMF) and Network access... I would think that a fairly feature rich Sage Client could be written using nothing but BD-J. I was curious about the jar signing, and it does appear that you can access the network, etc, as long as you sign the jars...and it appears the jars can be self signed....

There was post here of an example that accesses the network, confirmed to work on the ps3 and a pansonic player.

devinteske 02-17-2009 12:03 PM

I believe we're on the same page when it comes to whether BD-J will work or not. I don't think there's any contention against it being possible, rather that it's "not possible without adding/changing code."

Personally, I think that implementing a BD-J Placeshifter would be the cleanest and most effective implementation for accessing Sage via your PS3. Unfortunately, unless we can convince the SageTV developers of this (who in turn may convince the high-ups at Frey Technologies), their is little to no chance that we will have such an option.

I will hold out hope that we can maybe start discussions with some of the developers and get their opinion, but I'd also like to look into the following two (2) ideas which may allow us to get Sage working on the PS3 *without* any help from the developers:

a. We may be able to get the x86 Linux Placeshifter running in an emulator on Ubuntu 8.10 Intrepid Ibex (psubuntu.com)

b. We may be able to boot the PS3 onto removable media that provides a Live OS, designed to satisfy the needs of Placeshifter

devinteske 02-17-2009 02:06 PM

Research has yet to dash my hopes of getting this up and running. Rather contrary, more research is looking like this is definitely possible.

My biggest concern right now is definitely the amount of memory made available to Linux via the Hypervisor (a scant 196MB of usable RAM in your Linux environment). I found this article that shows how we can gain up to 100MB of usable RAM that might allow Sage to play without skipping:

http://www.ibm.com/developerworks/li...AGX59&S_CMP=GR

I'm thinking about starting out with the following setup:

1. Using OtherOs kboot to boot off thumb drive
2. Thumb-drive will likely be YD Linux (I've heard that it has access to more SPEs than Ubuntu and can see more RAM than other distros due to integration development with Sony).
3. YD Linux on the thumb-drive will be stripped down to provide the smallest memory foot-print possible

Things that I haven't solved yet are how we're going to run the Java code. I'm unsure if a PPC JRE can execute an x86 JRE app. Also, I'm not sure if there is special mac-specific code in the PPC Placeshifter that make it unusable on the YD Linux PPC JRE.

sandor 02-17-2009 03:49 PM

nobody has said it is impossible. but it does seem quite futile.

stanger89 02-17-2009 06:07 PM

Yeah, I'm sure SageTV could write a "Blu-ray" BD-J client, everything needed is there, UI, Mediaplayer, Network, though I've got some questions as to how well a standalone might run it.

The issue is I have serious doubts about being able to take a PC/Mac placeshifter and get it to do anything useful on a Blu-ray player. I think you're more likely to get it to run directly on a PS3, but even that I would expect to be problematic.

devinteske 02-18-2009 03:40 PM

Quote:

Originally Posted by stanger89 (Post 339125)
The issue is I have serious doubts about being able to take a PC/Mac placeshifter and get it to do anything useful on a Blu-ray player. I think you're more likely to get it to run directly on a PS3, but even that I would expect to be problematic.

That's a good point. What happens when you stick this supposed SageTV BD-J disc into a standard BluRay player (not a PS3)? Well, if the BluRay player supports the 1.1 spec of the BluRay format, then the player should have support for BD-Live (network access). Although, a standard player won't have likely have a built-in hard disk but it will likely have an HDMI output and some built-in RAM for buffering the data from the disc.

I hypothesize that it actually may just be possible to create a BD-J version of SageTV's Placeshifter that could actually run on ANY BluRay player (given BD-Live support). Surely, the Placeshifter will have to be modified slightly to remove any possible features that don't coincide with what a normal player provides (for example, a standard player will probably have less RAM than the PS3... if that's even possible).

If you think about it really, as long as the BD-J version of Placeshifter was re-written to strictly adhere to BD-J VM API, then I don't see how the Placeshifter *wouldn't* work on any ol' BluRay player that supports BD-J. After all, the only advantage that a PS3 would offer over a standard player is of course the built-in HD and beefier graphics (assuming BD-J apps have full 2D/3D acceleration via RSX, unlike apps running under Linux on the PS3 which are hardware-locked against using the RSX). This is of course only speaking on differences between the environment that BD-J apps would run in compared between a PS3 and stand-alone 1.1 BluRay player.

If that ends up being the case (and I'm sure that some simple testing can be done to make sure that it is possible), then I would argue that SageTV has a LOT to gain in writing a BD-J Placeshifter. Imagine, as though you were the CTO of Frey Technologies, if you could increase your potential market share to include anybody/everybody that owns a stand-alone BluRay player? Even better is that stand-alone BluRay players are not in every house-hold yet (good chance to get in before the competition gets too hot).

How many people do you think own both a computer and a BD player? How many of those people would like to play content from their computer in the living room via that BD player? With little more than a purchase of SageTV for the computer and one placeshifter license, they could stream content from the PC to any BD-J compliant BluRay player (including the PS3).

Now, on another note, I now believe that the Mac Placeshifter may indeed work natively in Yellow Dog Linux 6.1 on the PS3. Now, the only thing left to do before I start coding SageTV for the PS3 is... getting up the nerve to wipe out my PS3's hard disk to make room for the OtherOS boot loader (kboot). I've got over 60 million fans on Rock Band 2 that I don't want to lose months of stats and character building. Not really a topic for the SageTV forums... but does anybody happen to know off the top of their head if it's possible to back up the contents of the HD before wiping it and then restore backups into new partition? I guess I could just use gParted to resize the disk to make room for the OS, but haven't seen anybody try that before (what file system format is the thing in anyways? ext2?)

I'm reassured that this just may be possible by positive reports that others have got mplayer running decently on the PS3 at Full HD. Unfortunately, I don't think the Mac Placeshifter uses mplayer, but I know that the Linux Placeshifter does. So we may end up running the Linux Placeshifter under QEMU (x86 emulator for PPC). There have been reports of success on running x86 code on the PS3 under QEMU (heck, there's even been reports of being able to load WinXP onto the PS3 via QEMU, lol; albeit extremely slow).

Of all the Linux distributions currently available for the PS3, I think that Yellow Dog (YDL) looks to be the best if nothing more than for ps3vram which allows you to use the PS3's video memory as a swap space (which, pending real-time tests, should give us a marginal performance increase over using no swap or the internal HD for swap). Not only having more memory (more than the 196MB of usable XDR RAM seen by YDL) will help but having an additional bank of low-latency high-bandwidth memory for numerous read/write ops-per-sec will help greatly.

UItimately, I'd like to get FreeBSD running on the PS3 ( ^_^ ) but that looks to be a more concerted effort. It's just my personal belief (and part religion, being a FreeBSD developer) that SageTV would run better under FreeBSD on the PS3 (oh, and we'd have support for ZFS).

stanger89 02-18-2009 03:56 PM

Quote:

Originally Posted by devinteske (Post 339386)
That's a good point. What happens when you stick this supposed SageTV BD-J disc into a standard BluRay player (not a PS3)? Well, if the BluRay player supports the 1.1 spec of the BluRay format, then the player should have support for BD-Live (network access). Although, a standard player won't have likely have a built-in hard disk but it will likely have an HDMI output and some built-in RAM for buffering the data from the disc.

A BD-Live (2.0) player is required to have local storage and network access, I think 1GB but I don't remember for sure. A BD-Live player should have more than enough hardware to run a Sage client, they're very hardware similar to the HD200 (some may be running the same chipset).

Quote:

I hypothesize that it actually may just be possible to create a BD-J version of SageTV's Placeshifter that could actually run on ANY BluRay player (given BD-Live support). Surely, the Placeshifter will have to be modified slightly to remove any possible features that don't coincide with what a normal player provides (for example, a standard player will probably have less RAM than the PS3... if that's even possible).
I actually believe that it would not be hard (technically) for SageTV to tweak the extender miniplayer to run as a BD-J app on any BD-Live BD player. Indeed they already showed this capability last year at CES when they had SageTV software (of some sort) running on a Pioneer Blu-ray player. The real problem there would be logistical/political, that is SageTV managing to get their extender licensed/signed to run on a BD player.

Quote:

If that ends up being the case (and I'm sure that some simple testing can be done to make sure that it is possible), then I would argue that SageTV has a LOT to gain in writing a BD-J Placeshifter. Imagine, as though you were the CTO of Frey Technologies, if you could increase your potential market share to include anybody/everybody that owns a stand-alone BluRay player? Even better is that stand-alone BluRay players are not in every house-hold yet (good chance to get in before the competition gets too hot).
But this isn't really what we're talking about here, at least that's not what we "detractors" are disagreeing with. The discussion is if end users could take the released Placeshifter and get it to run (in a useful way) on a PS3 or other BD player. That I don't think is likely, at least not as a BD-J app.

devinteske 02-18-2009 04:24 PM

Quote:

Originally Posted by stanger89 (Post 339392)
But this isn't really what we're talking about here, at least that's not what we "detractors" are disagreeing with. The discussion is if end users could take the released Placeshifter and get it to run (in a useful way) on a PS3 or other BD player. That I don't think is likely, at least not as a BD-J app.

First off, I'd like to say that I have no intention of even *attempting* to turn the SageTV Placeshifter into a BD-J app. That's a job for Frey and the developers. If we had the source-code to the Placeshifter, then I'd say sure... no problem (have the thing working in a week or two). However, it just seems to be impossible unless you somehow decompile the Java byte-code and then augment it with new PS3-specific Java APIs to escalate privilege and use the local resources (there is a special API to use the local disk, network etc.). That's a bit beyond my expertise (were it a C program, no prob... but I'm not even sure if jars can be decompiled, changed and then recompiled properly).

So where I stand now is understanding that SageTV Placeshifter will likely never run on a PS3 unless we do it ourself under Linux or (sarcasm) convince Frey to release the code they used in CES on that Pioneer BD player.

And thus far, I haven't seen overwhelming evidence that we CAN'T get Placeshifter running on YDL on the PS3.

Can you think of anything that simply just won't work or where there isn't a decent work-around?

devinteske 02-20-2009 10:12 AM

Found this: Debian LiveCD for PS3

http://www.keshi.org/moin/PS3/Debian/Live

I almost can't resist putting FreeBSD onto my PS3, lol. Should be pretty simple, ... have kboot load memdisk (from the syslinux folks) as the kernel which will then mount the initrd image which will then execute the FreeBSD loader from the MBR of the image (standard floppy emulation). If kboot provides a correct boot_info struct to memdisk (as it should, memdisk only cares to be treated as a Linux kernel and to the best of my knowledge doesn't require any special flags, hooks, or other).

Should be fun to see if I can be the first person to get FreeBSD running on a PS3. Might take some kernel hacking, but that's not difficult for me (at all) as that's what I do for a living.

However, even if I do get FreeBSD running, I'll either end up dumping it for YDL (which can utilize more RAM on the PS3 than another other distro currently) or try to port ps3vram from YDL. Another major concern would be to get FreeBSD access to the SPEs.

I almost wish I had enough money to buy a second PS3 so I could do concurrent FreeBSD/Linux builds, but meh... I'll start off with a few tests on Debian LiveCD (just to play with the architecture), then move to YDL and finally FreeBSD.

Madz 02-22-2009 01:03 AM

This is a really interesting discussion, I'd love to see some sort of solution - came across it as I was googling for this very thing - a way to use the PS3 as a Sage Extender. Would love to see a reply from one of the Sage crew on their thoughts on all this.

@devinteske: I'm sure your testing efforts will be appreciated by a lot of us, regardless of the outcome, but I'd hate to see you lose all your data - I guess you don't want to pull the covers off your PS3, but I was wondering if one option wouldn't be to disconnect your HDD and connect a different HDD when you want to play with this??

Madz 02-22-2009 02:20 AM

Been doing a bit of reading on this and I really like the idea of the Blu Ray disc as the OP was suggesting, but given we probably need some help from Sage to get this happening, our best bet might be to plead with them...

In the meantime, as far as running Sage under linux on the PS3, looking at this page: http://www.sagetv.com/linuxOEMinstallAdv.html
It sounds like there is a linux version of the sage client - in which case why isn't it just as simple as installing linux on the PS3 and then installing this client? Aren't the architecture issues (cell instead of x86) all masked by the OS itself? I gather the linux distros that install on there all include a whole lot of apps, open office etc and surely there aren't cell specific compiles of all them?

I'm also pretty sure from what I've read that HDMI is supported by the video "hardware" presented to linux as are the USB ports so presumably we could get something like the MCE remote working. However from what I've been reading the biggest issue (even assuming we can actually get Sage to work) would be the speed of the linux VM, particularly in the video space. Seems like there aren't any linux drivers optimised for the hypervisor hardware - a few guys have been working on things, but nothing that sounds stable yet and unfortunately most of what I came across seemed a bit dormant?
http://forums.ps2dev.org/viewforum.php?f=29
http://code.google.com/p/cell-mpeg2-decoder

stuckless 02-22-2009 08:13 AM

Quote:

It sounds like there is a linux version of the sage client - in which case why isn't it just as simple as installing linux on the PS3 and then installing this client?
Nope.... Linux needs to be compiled for the achitecture on which it will run... including al applications.
Quote:

I gather the linux distros that install on there all include a whole lot of apps, open office etc and surely there aren't cell specific compiles of all them?
Linux on the ps3 will require that all binaries be compiled for the hardware on which it runs. But, because linux is open source, then doing this is sometimes trivial and other times not. In most cases, the developers that work on these large linux projects know that their stuff will need to run on lots of different hardware, so that they design their code to be used in that way. In short, if Open Office runs on the PS3, then it was compiled to run on the cell processor. Linux in not a vm.

The issue with the sage placeshifter is that it uses several native libraries, so each of those libraries would need to be ported to cell linux in order to work. Without the source, this is hard to do.

While I think the sage on ps3 linux is interesting, I don't see it as being a viable long term solution (although I'd still like to see it done). I think that the blu-ray solution holds much more long term potential. But the drawback to both of these solutions is that you have to boot into a separate application in order to watch tv/movies.

panteragstk 02-23-2009 03:11 AM

This idea appeals to me quite a bit. However, I don't think the linux/sagetv route is going to be the way to do it. Neither is the bd-j route. The best possible solution would be to get a ps3 version of sagetv. I doubt this would be possible because sony would be unlikely to let sagetv have rights to it's gpu/video processor. All of this is great "in theory" but to put it into practice just doesn't seem possible. Having a ps3 to game on and the open up my sagetv app on the ps3 menu to watch tv or play movies sounds great, but I just don't see it happening. Installing a linux distro and then getting the mac version of sage to run on it just seems like too many workarounds to be practical. I'd love to see this project come through though, there are just a lot of hurtles to jump for this to come to light.

Madz 02-23-2009 04:41 AM

If it wasn't for the PlayTV I'd say Sony wouldn't have any problems licensing it the same way as any other game. But the PlayTV changes the mix a bit.

It's frustrating as the PS3 would be the perfect extender....

devinteske 02-23-2009 08:48 AM

Quote:

Originally Posted by Madz (Post 340152)
@devinteske: I'm sure your testing efforts will be appreciated by a lot of us, regardless of the outcome, but I'd hate to see you lose all your data - I guess you don't want to pull the covers off your PS3, but I was wondering if one option wouldn't be to disconnect your HDD and connect a different HDD when you want to play with this??

I'm going to pull the drive out and attach it to my PC and run gParted on it. That should allow me to shrink and move the existing partition and create a new partition to install kboot onto. Then, having kboot installed will allow me to boot off an external USB drive or CD-ROM. Using a rewritable should allow things to move smoother and more efficiently (for testing purposes anyway). I'm thinking about starting off the Debian LiveCD.

devinteske 02-23-2009 09:23 AM

Quote:

Originally Posted by Madz (Post 340157)
It sounds like there is a linux version of the sage client - in which case why isn't it just as simple as installing linux on the PS3 and then installing this client? Aren't the architecture issues (cell instead of x86) all masked by the OS itself?

The hypervisor makes the Cell's main PPE processor appear and act identical to a late-model [IBM] PowerPC RISC processor. x86 Linux won't work on the PPC architecture without emulation. Linux/UNIX distributions that either cater to the PPC architecture (think Yellow Dog Linux) and/or those that can be compiled on PPC (Ubuntu, Gentoo, Debian, RedHat, CentOS, BSD, Darwin) are candidates for Sony's Playstation 3. However, though compiling for the PPC architecture will give you a usable Linux environment on the PS3, kernel/system additions are required to make full use of the PS3 hardware. Currently, Yellow Dog Linux (YDL) has the most functional support for the PS3's additional non-standard hardware.

In addition to the PPC processor (capable of running two threads, appearing to Linux as two logical CPUs), the PS3 has 8 cell processors called SPEs. YDL can make limited use of these SPEs while other distributions no not of their existence nor make use of them.

Another reason to use YDL is that they've figured out how to make use of the video RAM in the PS3 as a swap device, giving you more memory. This is rather important because the PS3 makes use of XDR (from the makers of Rambus RAM) that is permanently soldered onto the mother-board. There are essentially 4 banks of 256MB of super-fast XDR. Under the Linux environment, the hypervisor gives you approximately 196MB of usable RAM. That's hardly enough to do anything with. By slimming down the Linux environment by using Tom's Window Manager (twm) instead of Gnome/KDE and other tweaks, I can get just over 100MB of free memory that can be allocated to SageTV. But using YDL's special "ps3vram" utility, we can allocate the video memory as swap space and gain approximately another 300MB. Case-in-point, with YDL we can provide SageTV with enough memory, processing power, network bandwidth, and disk space to smoothly run SageTV Placeshifter WITHOUT needing access to the RSX 2D/3D graphic acceleration (which Sony has prevented by implementing the hypervisor to lock the hardware, preventing such homebrew as an ISO loader or custom dashboard that could load pirated discs).

However, YDL may not provide the most friendly environment to getting SageTV Placeshifter running. For that, I'm now thinking Darwin PPC. Darwin is open-source and designed to run the PowerPC architecture. Further, Darwin provides the core frameworks common with Mac OS X such as CoreServices providing the Carbon API, et cetera. This would be integral if it becomes discovered that the Mac version of Placeshifter makes use of any Carbon or Cocoa APIs (however doubtful).

Quote:

Originally Posted by Madz (Post 340157)
I'm also pretty sure from what I've read that HDMI is supported by the video "hardware" presented to linux as are the USB ports so presumably we could get something like the MCE remote working.

I actually like the MCE remote very much and have been using it on a multitude of systems for years now. I love the way it feels in my hand and it has all the buttons that I need. Although, wouldn't it be more advantageous to try to get the PS3 Bluetooth BluRay remote to work (I bought one of these just to watch BluRay movies... works well and I like that it can be pointed anywhere as it is not Infrared/IR based).

I do have a book on writing Linux kernel drivers, so it's not unforeseeable that we could have the MCE remote working (although I have a sneaking suspicion that somebody already has the MCE remote working on Linux). Could even write a FreeBSD driver, but I've never written a Darwin driver (for those that know, Darwin makes use of the Carnegie Mach Micro-Kernel architecture prevalent to the ol' NeXT system). So that could be a dodgy prospect (writing a kext for darwin... anybody know a good book?).

Quote:

Originally Posted by Madz (Post 340157)
However from what I've been reading the biggest issue (even assuming we can actually get Sage to work) would be the speed of the linux VM, particularly in the video space.

See my points above about YDL. I've seen other projects able to produce 1080p smooth video with the power available.

Quote:

Originally Posted by Madz (Post 340157)
Seems like there aren't any linux drivers optimised for the hypervisor hardware - a few guys have been working on things, but nothing that sounds stable yet and unfortunately most of what I came across seemed a bit dormant?
http://forums.ps2dev.org/viewforum.php?f=29
http://code.google.com/p/cell-mpeg2-decoder

Actually, Sony has been providing code to the makers of YDL to support additional components such as the 8 SPEs and additional video.

It's highly likely that Sony will NEVER unlock the RSX for 2D/3D acceleration, however. Doing so would almost immediately mean success in the homebrew world and unlock a flood of piracy (of PS3 games, ROM emulators for other consoles, and more).

devinteske 02-23-2009 09:40 AM

Quote:

Originally Posted by stuckless (Post 340172)
The issue with the sage placeshifter is that it uses several native libraries, so each of those libraries would need to be ported to cell linux in order to work. Without the source, this is hard to do.

You don't necessarily need to port to the Cell. The Hypervisor acts as a go-between in the layer above the Cell processor, articulating the PowerPC instruction set. ALL programs on the PS3 run on the PPE and the SPEs are there for support (IF your distribution can make use of them). This is essentially why we have Ubuntu (and all of its variants), Gentoo, Suse, Debian, YellowDog, and many other Linux distributions currently usable on the PS3. As a straight PowerPC build of the distribution will work on the PS3, it is not always necessary to have the source.

Those native libraries that you claim to be required are just that... native. A Linux distribution compiled for PPC will have those native libraries just as the x86 variant.

Naturally, some things will need to be worked around. For example, we could start off with the Linux miniclient (Placeshifter). Naturally, we could expect the Java to work as the JRE will correctly translate the VM byte-code into platform-specific byte-code to be run on the PPC architecture (which the hypervisor then translates for the PPE). However, there is some x86 code required by miniclient such as mplayer. Getting mplayer compiled under PPC is trivial and has even been shown to work on the PS3. However, I'll have to take a look to see if SageTV uses any C/C++ binaries/libraries. Generally speaking, decompilation does not work so well (you usually end up with x86 specific optimizations that hinder both compilation and performance on other platforms). So we may end up just throwing all the x86 binaries at QEMU (an x86 emulator for PPC).

As long as we can maintain a minimum of 100MB of allocated RAM to SageTV (including VRAM swap and possibly additional [slower] disk-based swap) with QEMU running, we should be able to get the performance that we need. Although I still wonder about the viability of using SageTV + Darwin to achieve a no-emulation native execution for best performance results.

devinteske 02-23-2009 09:49 AM

Quote:

Originally Posted by panteragstk (Post 340325)
I doubt this would be possible because sony would be unlikely to let sagetv have rights to it's gpu/video processor.

Not necessary. Others have shown that there is plenty of performance in the Linux environment, even with RSX access disallowed by the hypervisor.

Quote:

Originally Posted by panteragstk (Post 340325)
All of this is great "in theory" but to put it into practice just doesn't seem possible. Having a ps3 to game on and the open up my sagetv app on the ps3 menu to watch tv or play movies sounds great, but I just don't see it happening.

Ah, young grasshopper. Anything is possible and nothing improbable when you master the requisite kung-fu. The only question at play here is how to best implement it. The fact is that this is very real and very possible. In fact, SageTV demonstrated running SageTV on a Pioneer BluRay player just this last year. Now, granted that they have the resources available to do this with ease (or ate least more-so than us whom do not work for the company), but it is far from impossible.

Quote:

Originally Posted by panteragstk (Post 340325)
Installing a linux distro and then getting the mac version of sage to run on it just seems like too many workarounds to be practical.

You may be right. I fully expect to get it working, but what the outcome will be I can't say. It may end up being too sluggish or buggy. The fact, however will remain, that we have no way of knowing until we try it.

devinteske 02-23-2009 11:30 AM

Linux Placeshifter Analysis
 
I took a look at the Linux Placeshifter (miniclient) just now to see how things would fair in PPC Linux land.

These are the types of files distributed with the miniclient:

Code:

jogl.jar:          Zip archive data, at least v2.0 to extract
libjogl_awt.so:    ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped
libjogl_cg.so:      ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped
libjogl.so:        ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped
libjtux.so:        ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped
libSage.so:        ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped
MiniClient.jar:    Zip archive data, at least v1.0 to extract
mplayer:            ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), not stripped
sageclient.sh:      Bourne shell script text executable

Further, within jogl.jar, we have numerous "compiled Java class data, version 48.0" files (supporting "Mac OS X", "X11", and "Windows"). This Java archive should be cross-platform and functional in our PPC Linux environment without modification. Same goes for MiniClient.jar.

As for each of the shared objects (which have invariably been compiled for Intel x86), a few are available as open source and thus can be re-compiled for PPC. For example, we can recompile libjtux.so by downloading the source from:

http://freshmeat.net/projects/jtux/

JTux can be compiled for the PPC Linux architecture using the Java SDK.


For the files libjogl_awt.so, libgjogl_cg.so, and libjogl.so, we can do the same. These are from the Java OpenGL project JOGL available here:

http://freshmeat.net/projects/jogl/

I'm curious if this library can be ported since the hypervisor locks us out of the RSX. There is a slight chance that OGL calls are implemented in YDL to run on the PPE, otherwise we'll be hoping that the miniclient can make use of the X11/hypervisor framebuffer. We'll see.

Edit: OpenGL API is indeed supported under Linux on the PS3. As I guessed, it is a software implementation only but it is great to know that we will be able to port JOGL to the PS3, re-compiling with the JDK.

Here's the killer... libSage.so

Would be nice, if say, I could collaborate with the Sage dev-team on this one. Perhaps I could provide them with an ISO of the environment I'm working in (complete with ported libraries) to have them test to see if a straight re-compile of this shared object would work. That way, if it worked, they could simply share the compiled object with me to incorporate it into a no-emulation miniclient distro. However, I'm not going to hold my breath.

The only other way would be to use a decompiler to get the source but, as I said in an earlier post, decompilers never produce the same code as was used to generate the compiled object. This is because when the compiler (such as gcc) transforms the C/C++ code into 32-bit x86 machine-code, optimizations are added. These optimizations will wreak havoc on the decompilation, often causing oddities that weren't in the original code. When dealing with a relatively small object, this can be a trivial task (decompile, clean up as best you can, and re-compile). When you start getting above a few thousands lines is when things get daunting.

Now, we could sit here and ponder near-impossible, incredibly difficult tasks (like reverse engineering libSage.so to provide our own library that satisfies the required symbols) to achieve our goal (which could be fun) but I think that the simplest and easiest answer is still going to be QEMU.

Edit:

If we can get a Proof-of-Concept (PoC) running with the combination of PS3/YDL/QEMU/Placeshifter, regardless of how fast or efficient it operates, we could likely get the attention of the developers. In that case, we may be able to convince them to do a simple re-compile so that we can remove the emulation layer (QEMU).

devinteske 02-23-2009 12:01 PM

Did some more research on QEMU today.

It appears that QEMU offers two types of emulation, including the one that we want. Many people on the web are already using QEMU on the PS3 to do such odd things as run Windows 95/98 (and even XP). However, we have no need to emulate an entire operating system (though we could).

It should be possible to perform User emulation (emulation of user code to launch a Linux process) to execute the x86 Linux Placeshifter. This solution should provide us with a light-weight emulation layer that may be fast enough to actually be usable!

Now, if that doesn't work, then I see absolutely no reason whatsoever why we couldn't (albeit at the cost of performance) emulate an entire x86 Linux OS under QEMU to execute the Placeshifter without a single modification to SageTV's miniclient.

Madz 02-24-2009 04:15 AM

@devinteske: your enthusiasm is fantastic! It would be so great to get this working and I really don't want to be a wet blanket on this - but the night I spent reading up on this stuff didnt leave me as optomistic as you....

I don't have much idea about linux and what we'd have to do to get Sage working, it sounds like you all are over that side of things anyway. I was more interested in the performance limitations of the linux "VM" Sony has left us with via the hypervisor.

Before I found SageTV I used MythTV on Linux for a few months. So that was the angle I researched from as these guys, like us, are trying to run the PS3 as their front end. They have the advantage over us that MythTV is open source so they can load it up no problems. But from everything I read the performance just wasn't satisfactory. I even found posts discussing the fact that the old xbox (running xbmc) performs better than the PS3. I gather HD is basically out of the question.

I agree with you that Sony will never open up the video to linux - why would they? The sell the consoles at a loss and rely on the sales of games. If we all bought them to run linux on they'd be screwed :) I also agree with you though that the PS3 has enough grunt to do what we need without the video chip. The problem is it needs custom drivers/media libraries to be written to multithread stuff out to the SPEs otherwise like you say all you are using is the single general purpose PPE which doesn't have the grunt to do what we need. This means a LOT of work, particularly if we have to learn how to write these things as we go. From what I found, some guys have had a stab at writing drivers and codec? libraries to do various things but everything I came across was at an alpha/beta stage and didn't seem to be being actively developed.

Anyway, this is just from a night's googling, so maybe there's stuff out there that I missed, but I'm thinking before you go to the trouble of trying to get Sage running, maybe we need to get linux on a PS3 and run some tests just playing back media files manually - use ffmpeg or whatever it is that sage uses, but then we can get an idea of whether the hardware is up to the job and evaluate some different drivers and stuff for stability and performance.

Re the MCE remote on linux: http://www.mythtv.org/wiki/MCE_Remote. From what I remember the remote the stuff is pretty flexible and you could probably get the other one working at some stage...

devinteske 02-24-2009 10:09 AM

Quote:

Originally Posted by Madz (Post 340604)
The problem is it needs custom drivers/media libraries to be written to multithread stuff out to the SPEs otherwise like you say all you are using is the single general purpose PPE which doesn't have the grunt to do what we need. This means a LOT of work, particularly if we have to learn how to write these things as we go.

It's already been done for us.

See the following git repo:
http://mandos.homelinux.org/~glaurung/git/

That's the code that I'll be incorporating into a custom Linux kernel.

Here's discussion on the code:
http://forums.ps2dev.org/viewtopic.php?t=9479


In essence, we now not only have extended swap space by using the GPU as a gopher to tap into the VRAM, but we now have 2D acceleration via RSX (!!)

Is it starting to sound a bit more plausible now?

Quote:

Originally Posted by Madz (Post 340604)
Re the MCE remote on linux: http://www.mythtv.org/wiki/MCE_Remote. From what I remember the remote the stuff is pretty flexible and you could probably get the other one working at some stage...

That's great news! I'll definitely be incorporating that into the build.

In addition (and mentioned previously), I'll be slimming down the environment as best I can to give Sage as much usable RAM as possible. I'll be doing something along these lines (but more):

http://www.ibm.com/developerworks/li...l-linux-ps3-1/
http://www.ibm.com/developerworks/li...l-linux-ps3-2/
http://www.ibm.com/developerworks/li...l-linux-ps3-3/

Quote:

Originally Posted by Madz (Post 340604)
maybe we need to get linux on a PS3 and run some tests just playing back media files manually - use ffmpeg or whatever it is that sage uses, but then we can get an idea of whether the hardware is up to the job and evaluate some different drivers and stuff for stability and performance.

See the following discussion on AfterDawn. There are many reports in the wild of the PS3 running Linux able to play Full HD (1080p) smoothly without any tweaks:

http://forums.afterdawn.com/thread_view.cfm/627817

Now, if you add in the ps3vram module, ps3rsx module, slim down the X11 memory footprint, and add more swap and you should have a rather descent environment that should easily be able to handle executing the SageTV Placeshifter under QEMU.

Madz 02-25-2009 05:26 AM

I'm pretty sure from what I've read they shut the RSX access down in later firmwares on the PS3 (2.10+). Anyway, if you're willing to stick linux on and have a play you'll soon know how well it can handle itself - I still reckon you want to try this before sinking too much time into getting sage working. Keep us posted with your testing - looking forward to it!!

devinteske 03-15-2009 05:08 PM

Disaster Strikes but opportunity knocks
 
Well, this project is about to get under way due to some unfortunate circumstances.

I'd been dying to play Turok on the PS3 (who wouldn't love to kill some flesh-eating dinosaurs in High Definition?), so I rented it from Blockbuster over the weekend.

No more than 3 hours into the game, my PS3 locked up. Audio was still playing, but I could tell that it was just a very long loop, meanwhile the video was frozen. I let the thing sit there for a while (about a half an hour) before powering it down by holding the power switch.

Surprise, surprise, when I powered on my PS3 this morning, I was greeted with the error message "Cannot Start. Correct hard disk not found."

The PS3 is going back to the factory for service on an RMA and when I get it back, I'll make sure to format the hard disk for kboot and a Linux distribution.

Since I've lost everything, there's nothing holding me back now. Before, I was hesitant to re-format because I was close to ranking in the top-500 for the Rock Band 2 online leaderboard and didn't want to lose my progress (hopefully the scores are tied to my online PSNetwork account).

devinteske 03-31-2009 12:14 PM

And AWAY we go!
 
Got my PS3 back from Sony (in Laredo, TX) yesterday. My worst fears were confirmed when I got Rock Band 2 re-installed, my band profile along with an accumulated 90M fans was... gone.

Good news is that the hard disk is now formatted with 10GB allocated for Linux. The project of getting Sage running on the PS3 is now under way.

In the amount of time that has gone by in my gearing up for this project, I've found evidence of others successfully being able to produce flawless 480/720/1080p video playback under mplayer. The key still seems to be to slim down the user-land environment as much as possible (for example, running a light-weight window manager such as tvtwm, xfce, or windowmaker). It's also worth noting that playback over SMB does not work well and we should stick to NFS (it will be fun to try to get NFS working on my Windows XP Sage Server by installing Microsoft SFU).


All times are GMT -6. The time now is 11:56 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.