[MPlayer-dev-eng] Feature Request: PS3 performance: Double Buffering

Dobin Rutishauser dobin at broken.ch
Sat May 26 15:44:53 CEST 2007


Hi,

Problem:
I've got a PS3 with Yellow Dog Linux on it, on a 720p HD Beamer.
I can watch most of my videos, but the load of the PS3 while
playing is like 3.00, and on some movies i've got very bad framerates
(means, unwatchable). On other values for -sws as "0", video
playing is too slow, sound is >2 secs behind etc.
People with 1080p screens arent so lucky.

Some relevant Technical infos about the PS3 (from (*)):
"The frame buffer on PS3 platform has been implemented as virtual frame
buffer allocated on main memory."

Means, writing to Framebuffer is expensive:
"Handling the ("DO_FRAMEBUFFER_FLIP") interrupt, the
kernel daemon requests dma via hyper visor and the data in the frame
buffer on main memory is transferred to the GPU."

How its done now:
There's a kernel thread named "ps3fbd", which does a framebuffer
flip on all VSYNC's. Mplayer uses -vo x11.

How it could be done:
Implement "double buffering", which means we do the page flip
when we request it.
As VSYNC =~ 50/60Hz and a movie has like 24/25 FPS, we could halfe
the amount of data transferred. Also, we have 60 task switches fewer
than before (the PS3 cpu is slow-ass, not superscalar and such things (i
think), so this would also be a great speedup).
Maybe i'm wrong here, i've got no clue of framebuffer/grafic programming.
I'm just a PS3 gamer  ;)

How it's should be done:

1) Get a screen size and number of frame buffers by
   ioctl PS3FB_IOCTL_SCREENINFO.
2) Stop the ps3fbd which performs flip in the kernel by ioctl
   PS3FB_IOCTL_ON. Then flip will be controllable from the user space.
3) Wait the next vsync by blocking ioctl FBIO_WAITFORVSYNC.
4) After the vsync, call blocking ioctl PS3FB_IOCTL_FSEL with frame
   buffer number in user space. This number indicates which frame buffer
   will be used at the next flip. After calling the ioctl, the data in
   the frame buffer is transferred with dma and flip request is issued
   in the kernel.
5) Return to 3.
6) Call the ioctl PS3FB_IOCTL_OFF at the end of the applications.


Me:
I would happily test patches, as i cant yet figure out how to
mess with vo_fbdev2.c  :)

Me is also waiting for some massive SPE using in mplayer for massive
speedup!!  :)

For detailed informations, and the source of the quotes in this mail,
check:
(*)
http://felter.org/wesley/files/ps3/linux-20061110-docs/ApplicationProgrammingEnvironment.html

and a link to "Handy PS3 Linux Framebuffer utilities":
http://www.cellperformance.com/articles/2007/03/handy_ps3_linux_framebuffer_ut.html

and the linux PS3 virtual frame buffer driver patch:
http://patchwork.ozlabs.org/linuxppc/patch?id=9476

cya, Dobin

PS: sorry vor mi pad englisch



More information about the MPlayer-dev-eng mailing list