SPE Scaler

Investigation into how Linux on the PS3 might lead to homebrew development.

Moderators: cheriff, emoon

Post Reply
billb
Posts: 32
Joined: Wed Dec 12, 2007 5:52 am

SPE Scaler

Post by billb »

Hi, I'm hoping that someone who is knowledgeable about programming could look into this project ... I'm able to compile it OK on YDL6 / PS3 but so far running the binary (scaler) only results in locking up the system. Also, all the comments in the code are in Japanese... I know less about Japanese than I do programming ... :)

I first saw it being used in a video on YouTube showing Quake 2 running on the PS3:
http://www.youtube.com/watch?v=B9VUmWnpCbg
(I have one also, but I'm just using a mostly unmodified version of the port from icculus.org)

Here's where you can get the source (translated page): link
direct link to scaler.tar.gz

Thanks
billb
Posts: 32
Joined: Wed Dec 12, 2007 5:52 am

Found the problem ...

Post by billb »

I figured out what my problem was -- I had set my ps3fb memory to 4M to get more system RAM. So I took out the ps3fb=4M in my /etc/yaboot.conf file, rebooted, and it works! :)
billb
Posts: 32
Joined: Wed Dec 12, 2007 5:52 am

Screenshots & photo

Post by billb »

snes9x-gtk running a game at the original resolution:
Image

about to start scaler:
Image

photo of scaler running -- snes9x-gtk is still running the game at the original resolution, but scaler has zoomed in on the center of the screen (3X):
Image

To stop scaler from running, I use Alt-TAB to switch to the terminal window from which it was started and hit Ctrl-C.

So this should work for anything from sdlmame to playing movies -- anything that runs smoother at the original resolution instead of being scaled by the application running it, or simply can't be scaled by the application (like qemu running Win98). :)

EDIT: I have scaler starting with custom keyboard shortcuts now so I can zoom 2X 3X or 4X easily, and disable it with another key. Or I can use a script to automatically start it before a fullscreen game starts and automatically kill it on exit. What a great tool for PS3 Linux!

Example script:

Code: Select all

#!/bin/sh
scaler -s 2 -t 3000 & quake2.sh
killall scaler
Ocelot
Posts: 11
Joined: Sat Dec 08, 2007 9:58 pm

Post by Ocelot »

So what exactly does this all mean?
Better performance for video applications? Can you play HD videos in mplayer?
billb
Posts: 32
Joined: Wed Dec 12, 2007 5:52 am

Post by billb »

Ocelot wrote:So what exactly does this all mean?
Better performance for video applications? Can you play HD videos in mplayer?
No, it wouldn't help for playing HD videos ... it is basically just a way to zoom in on the center of the screen.

It means that if you you're running at a resolution like 1280x720 or 1920x1080 and you're using an emulator that normally has to scale the image to fit your screen -- giving you a low frame rate -- that you can run it at the original resolution and let scaler do the work of fitting the image to your screen instead.

Or if you're running something like DOSBox or Windows via Qemu, those applications won't scale the image for you at all. So you can run something like Diablo which is normally 640x480 and use scaler set at -s 2 so it will be displayed at 1280x960 with no loss in speed.

It also helps for running FPS games like Quake 2 ... you can run Quake 2 at 320x240 and use 3x scaling to have it display at 960x720 with the same framerate you'd have running at 320x240 (around 150 FPS?). It won't look as good as actually running at 960x720, of course.
billb
Posts: 32
Joined: Wed Dec 12, 2007 5:52 am

Post by billb »

It would be nice to add 1.5X scaling to this scaler tool -- for example, if I wanted to use it with QEMU running Windows / Games at 640x480 and my PS3 is running at 1280x720, 1.5 X scaling would give me 960x720, filling the screen vertically.

I've already tried running Diablo under DOSBox, or QEMU / Win95 with a 1080i resolution on the PS3, and 2x scaling. So that gives me a nearly full screen (vertically) Diablo running at 1280x960 (on a 1920x1080 screen) and it runs great (maybe even better than normal?), but I usually run PS3 Linux at 1280x720 so 2x scaling is too much.

It would also be interesting to see it doing other things like antialiasing, but I started playing around with the code just to try and get a 1.5x mode going. I almost got it, but in fullscreen mode the image was offset to the right a bit.

EDIT: looking at it again, I think all I managed was to offset the image and didn't affect the scaling -- it doesn't appear to be a simple change as I had hoped

The relevant code appears to be in overlay/overlay001.c if anyone with some knowledge of this subject wants to take a look at it. For me, it's just a matter of trial and error since I have little to no idea of what I'm doing ... It might help if the comments were in English. ;-)
Last edited by billb on Wed Jul 23, 2008 1:59 pm, edited 1 time in total.
billb
Posts: 32
Joined: Wed Dec 12, 2007 5:52 am

Post by billb »

billb wrote:The relevant code appears to be in overlay/overlay001.c if anyone with some knowledge of this subject wants to take a look at it. For me, it's just a matter of trial and error since I have little to no idea of what I'm doing ... It might help if the comments were in English. ;-)
On second thought, I may be way off on that being the right place to look. :) Still poking around ...

I've translated all the source code and readme.txt to English using Google translator -- the original source code is unmodified and translated versions are in .txt files instead (the translator hoses up the code). Here's a link to it:
http://pleasantfiction.ipower.com/ps3li ... eng.tar.gz
ouasse
Posts: 80
Joined: Mon Jul 30, 2007 5:58 am
Location: Paris, France

Post by ouasse »

why not write a full general purpose SPE scaler, and include it in a XV extension of Xorg, or at an upper level in libSDL ?
Kilonga
Posts: 1
Joined: Wed Nov 12, 2008 5:39 am

fix to scaler program to work on all ps3-video-modes

Post by Kilonga »

Download the gzipped tarball of the source code mentioned above and then download the following file (patch): here.

Once you have both files copy them to your home directory and type the following commands:

Code: Select all

tar -zxvf scaler.tar.gz
cp scaler_borderfix.patch scaler/.
cd scaler
patch -p1 < scaler_borderfix.patch
make clean
make
sudo cp scaler /usr/local/bin/.
If you cannot copy the file using sudo, su to root and then copy it.

This executable should work for all ps3-video-modes.

Enjoy!
Post Reply