SDL Cell support

Technical discussion on the newly released and hard to find PS3.

Moderators: cheriff, emoon

Post Reply
ps3fanboy
Posts: 66
Joined: Sun Jul 06, 2008 2:03 am

SDL Cell support

Post by ps3fanboy »

according to a post on the SDL mailing list Cell support has been integrated into the SDL svn.
this should speed up media players like mplayer, xine, etc. quite a bit.
has anybody already tried that out?
ouasse
Posts: 80
Joined: Mon Jul 30, 2007 5:58 am
Location: Paris, France

Post by ouasse »

I could not find anything about Cell support in the SDL svn log.

Code: Select all

svn log -r  '{'20090101'}':HEAD  http://svn.libsdl.org/
returned nothing Cell-related.

But I am definitely interested about testing SPU acceleration in SDL :)
ps3fanboy
Posts: 66
Joined: Sun Jul 06, 2008 2:03 am

Post by ps3fanboy »

> last week I posted a patch to this list that contained a basic
> impementation
> of a framebuffer driver with acceleration on local SPEs.

Thank you very much! I've applied your patch to subversion.

See ya,
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC
i think it's in sdl-1.2
ouasse
Posts: 80
Joined: Mon Jul 30, 2007 5:58 am
Location: Paris, France

Post by ouasse »

oops, I just found the comment. it concerns revision 4476 of the svn. I'll give it a try tonight or tomorrow.
androvsky
Posts: 33
Joined: Sun Nov 11, 2007 5:59 am

Post by androvsky »

Hello.

This patch provides basic support for video on the Sony PS3
Linux framebuffer. Scaling, format-conversion, and drawing is
done from the SPEs, so there is little performance impact to
PPE applications. This is by no means production quality code,
but it is a very good start and a good example of how to use the
PS3's hardware capabilities to accelerate video playback on
the box.

The driver has been verified to work with ffplay, mplayer and xine.
This piece of software has been developed at the IBM R&D Lab
in Boeblingen, Germany and is now returned to the community.

Enjoy !
Found here: http://www.libsdl.org/cgi/viewvc.cgi/br ... threv=4476


Looks very interesting, much fuller support than I expected.
ouasse
Posts: 80
Joined: Mon Jul 30, 2007 5:58 am
Location: Paris, France

Post by ouasse »

I compiled SDL with Cell support (following instructions from the README.PS3 file).

Then, I compiled mplayer with SDL support.

And then, playing videos (using options : -vo sdl) does not make use of spu's at all, according to spu-top.

I tested in X, and in fullscreen framebuffer mode.
jonathan
Posts: 23
Joined: Fri Sep 21, 2007 12:18 pm
Location: Tasmania, Australia

Post by jonathan »

You need to specify the SDL driver

Code: Select all

mplayer -vo sdl:driver=PS3 moviefile
Seems to be working for me.

I say seems to be because the PS3 is currently headless - without the PS3 driver I see mplayer with ~100% cpu utilisation. With the above, I see ~80% CPU (fluctuating) and two SPU processes listed in spu-top.
ouasse
Posts: 80
Joined: Mon Jul 30, 2007 5:58 am
Location: Paris, France

Post by ouasse »

Thanks jonathan for the help. Unfortunately mplayer does not work on my setup.
I tried running mplayer using -vo sdl:driver=PS3.

Here is the output from my self-compiled mplayer

Code: Select all

MPlayer SVN-r29148-4.3.3 (C) 2000-2009 MPlayer Team

Playing anthology.avi.
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO:  [XVID]  400x300  24bpp  50.000 fps  3436.6 kbps (419.5 kbyte/s)
[VO_SDL] Using driver: ps3.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 44100 Hz, 2 ch, s16be, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
[AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
[AO ESD] esd_open_sound failed: No such file or directory
[AO SDL] Samplerate: 44100Hz Channels: Stereo Format s16be
AO: [sdl] 44100Hz 2ch s16be (2 bytes per sample)
Starting playback...
[mpeg4 @ 0x107d5148]Invalid and inefficient vfw-avi packed B frames detected
VDec: vo config request - 400 x 300 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [sdl] 400x300 => 400x300 Planar YV12 
A:   0.0 V:   0.0 A-V:  0.031 ct:  0.000   1/  1 ??% ??% ??,?% 0 0 ESC[J^MNew_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.


MPlayer interrupted by signal 11 in module: flip_page
- MPlayer crashed by bad usage of CPU/FPU/RAM.
  Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and
  disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.
- MPlayer crashed. This shouldn't happen.
  It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
  gcc version. If you think it's MPlayer's fault, please read
  DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
  won't help unless you provide this information when reporting a possible bug.
Tests done on a Debian squeeze system :
- kernel 2.6.27.5 from kernel.org, compiled using ps3_defconfig default configuration
- X.Org X Server 1.4.2, tested in WUXGA and 720p screen modes

in framebuffer mode, SDL does not detect any screen.

For more precisions, please ask.
Kali
Posts: 10
Joined: Mon Apr 14, 2008 10:44 pm

Post by Kali »

jonathan wrote:You need to specify the SDL driver

Code: Select all

mplayer -vo sdl:driver=PS3 moviefile
Seems to be working for me.

I say seems to be because the PS3 is currently headless - without the PS3 driver I see mplayer with ~100% cpu utilisation. With the above, I see ~80% CPU (fluctuating) and two SPU processes listed in spu-top.
same results
but i can't see any performance improvement
ps3fanboy
Posts: 66
Joined: Sun Jul 06, 2008 2:03 am

Post by ps3fanboy »

Kali wrote:
jonathan wrote:You need to specify the SDL driver

Code: Select all

mplayer -vo sdl:driver=PS3 moviefile
Seems to be working for me.

I say seems to be because the PS3 is currently headless - without the PS3 driver I see mplayer with ~100% cpu utilisation. With the above, I see ~80% CPU (fluctuating) and two SPU processes listed in spu-top.
same results
but i can't see any performance improvement
what would you expect other than ppe utilization going down?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

ps3fanboy wrote:
Kali wrote:
jonathan wrote:You need to specify the SDL driver

Code: Select all

mplayer -vo sdl:driver=PS3 moviefile
Seems to be working for me.

I say seems to be because the PS3 is currently headless - without the PS3 driver I see mplayer with ~100% cpu utilisation. With the above, I see ~80% CPU (fluctuating) and two SPU processes listed in spu-top.
same results
but i can't see any performance improvement
what would you expect other than ppe utilization going down?
Yeah, video playing at 24 FPS doesn't suddenly jump to 100 FPS because you increased the power. :D
Kali
Posts: 10
Joined: Mon Apr 14, 2008 10:44 pm

Post by Kali »

i hope for 720p and 1080p playback :D
hd video on xmb support is limited, i have to encode ~60% of the video, and other ~40% need only to change the container :/
ps3fanboy
Posts: 66
Joined: Sun Jul 06, 2008 2:03 am

Post by ps3fanboy »

Kali wrote:i hope for 720p and 1080p playback :D
hd video on xmb support is limited, i have to encode ~60% of the video, and other ~40% need only to change the container :/
for that the mpeg2 decoder is probably the bottleneck.
jonathan
Posts: 23
Joined: Fri Sep 21, 2007 12:18 pm
Location: Tasmania, Australia

Post by jonathan »

I've tried several different 720p and 1080p mp4 and mkv contained videos - nothing plays fast enough with -vo sdl:driver=PS3.

-vo fbdev is significantly better for the 720p mp4 I tried. Still dropping frames in places, but mostly watchable.
Post Reply