Multimedia with PS3 Linux

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

Moderators: cheriff, emoon

jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Multimedia with PS3 Linux

Post by jockyw2001 »

I've seen some feedback that there are issues with either audio or video playback on different distros with apps like Xine, Totem, Mplayer or VLC.

Would be nice to collect feedback about this and other multimedia issues in this thread.

PS: for YDL users, here you find some help to install VLC (or Mplayer or Xine):
http://tictech2.blogspot.com/
User avatar
evilo
Posts: 230
Joined: Thu Apr 22, 2004 8:40 pm
Contact:

Post by evilo »

I wanted to install freevo over YDL, once I'll have enough free time..
Since I have a NAS (DS101j), I'm looking for a UPNP compliant "Media Center like software", and this one looks nice :)

I'll post my feedback once done.

http://freevo.sourceforge.net/index.html
Matrixdub
Posts: 60
Joined: Fri May 13, 2005 3:47 am

Re: Multimedia with PS3 Linux

Post by Matrixdub »

jockyw2001 wrote:I've seen some feedback that there are issues with either audio or video playback on different distros with apps like Xine, Totem, Mplayer or VLC.

Would be nice to collect feedback about this and other multimedia issues in this thread.

PS: for YDL users, here you find some help to install VLC (or Mplayer or Xine):
http://tictech2.blogspot.com/
Hi. I read your blog on how to get VLC on YDL...That is one LENGTHY post! There must be a distro with the most recent application preinstalled! What about geexbox?
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Re: Multimedia with PS3 Linux

Post by jockyw2001 »

Matrixdub wrote:Hi. I read your blog on how to get VLC on YDL...That is one LENGTHY post! There must be a distro with the most recent application preinstalled! What about geexbox?
Not my blog :)

I tried VLC 0.8.5 ... it's a bit disappointing though. The cpu load is nearly 100% when playing mpeg2 SD files. Also bad is that VLC crashes with mpeg4 files. Well, it's only the beginning.
laichung
Posts: 123
Joined: Fri May 06, 2005 2:02 pm

Re: Multimedia with PS3 Linux

Post by laichung »

Since the linux version of VLC only using plain linux structure and didnt use any CELL technology. It should be used the PPU of the Cell only. (or part of the spu, whatever)

If anyone port the libmpeg2 using spe, I think the performent will be better. (Just like you play the movie in the xmb)

jockyw2001 wrote:
Matrixdub wrote:Hi. I read your blog on how to get VLC on YDL...That is one LENGTHY post! There must be a distro with the most recent application preinstalled! What about geexbox?
Not my blog :)

I tried VLC 0.8.5 ... it's a bit disappointing though. The cpu load is nearly 100% when playing mpeg2 SD files. Also bad is that VLC crashes with mpeg4 files. Well, it's only the beginning.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Re: Multimedia with PS3 Linux

Post by jockyw2001 »

laichung wrote:Since the linux version of VLC only using plain linux structure and didnt use any CELL technology. It should be used the PPU of the Cell only. (or part of the spu, whatever)

If anyone port the libmpeg2 using spe, I think the performent will be better. (Just like you play the movie in the xmb)
Of course. And it's the reason we have this forum :)
ralferoo
Posts: 122
Joined: Sat Mar 03, 2007 9:14 am
Contact:

Post by ralferoo »

Of course it would be better. I've lost the URLs, but figures I've read suggest that a full 1080p HD stream can be decoded at about 70 FPS using only 1 SPU. The figures for SD streams were very high, and Toshiba have also demoed their PVR system which is capable for rendering 48 SD treams simultaneously into mini windows using 8 SPUs.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

And it's encouraging to read how easy it is ;)
Quoted from:
http://www.power.org/forums/viewtopic.p ... 4a933b98e4
CODECs are very straightforward to be implemented into SPEs, i.e., SIMD.
Chapters 22 and 23 of the BE Programming Handbook are very helpful in that respect. Let's start porting ffmpeg to SPE :)
ralferoo
Posts: 122
Joined: Sat Mar 03, 2007 9:14 am
Contact:

Post by ralferoo »

jockyw2001 wrote:And it's encouraging to read how easy it is ;)
You'll notice that the guy who posted that has only made one post ever to that forum and personally, I read his post as a hand-wavey kind of thing rather than a "I've actually tried implementing this and here are the results" post.

The other downside is that IBM will for instance release all sorts of stats from the benchmarks but don't ever provide access to the source for the tests they run. Probably because they can get a good chunk of money by licensing it to people.
User avatar
Saotome
Posts: 182
Joined: Sat Apr 03, 2004 3:45 am

Post by Saotome »

ralferoo:
Great, you just ruined all of jockyw's effort to motivate others to actually do it. Now no one will even try (me included) ;P
infj
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

Saotome wrote:ralferoo:
Great, you just ruined all of jockyw's effort to motivate others to actually do it. Now no one will even try (me included) ;P
:)

ralferoo: you did notice the ";)" in "And it's encouraging to read how easy it is ;)" didn't you ?
ralferoo
Posts: 122
Joined: Sat Mar 03, 2007 9:14 am
Contact:

Post by ralferoo »

Saotome wrote:Great, you just ruined all of jockyw's effort to motivate others to actually do it. Now no one will even try (me included) ;P
If there's no challenge, there's no fun in my book. I'm not saying it's particularly difficult even (for someone who understands MPEG stuff, although that's a challenge in itself) as the instruction set of the SPU was designed around making certain applications very fast. One of those applications is the DCIT in MPEG decoding and so there are instructions like sumb which are incredibly useful to codec writers and not a lot of use to anyone else.

All I was saying was that this guy in the forum who claimed it was easy made that one post and hasn't been heard of since (over 6 months ago) and never once even claimed or suggested that he was attempting to write a codec. In fact, he sounded more like he was involved with OpenMP.

I'm not trying to discourage anyone, in fact I'd like to see it happen as much as anyone here, and it'd probably be a fun challenge, I was merely pointing out that nobody has yet done it apart from IBM to my knowledge and they haven't released any of their benchmark code into the public domain.

But I don't understand why me making an offhand comment would cause you not to try. If you're able to understand the MPEG specs and the SPU instruction set, and you're interested in that area then you'll learn a hell of a lot in the process. If it floats your boat, do it!
User avatar
Saotome
Posts: 182
Joined: Sat Apr 03, 2004 3:45 am

Post by Saotome »

I think you shouldn't take everything too seriously. Especialy comments with winking emoticons at the end ;)
infj
ralferoo
Posts: 122
Joined: Sat Mar 03, 2007 9:14 am
Contact:

Post by ralferoo »

Saotome wrote:I think you shouldn't take everything too seriously.
Yeah, probably. I didn't actually notice the smileys, but hey!

Anyway, found the reference for those figures: Check out slide 27 on this powerpoint: http://www-static.cc.gatech.edu/~bader/ ... uction.ppt
popper
Posts: 9
Joined: Mon Jan 15, 2007 5:21 am

Post by popper »

as far as i know, been a while since i hung around but i seem to remember nobu being a PPC ruby hacker
amung other talents.

http://svn.ruby-lang.org/cgi-bin/viewvc ... threv=3012

Lu_zero is the man thats done more for PPC/altivec/cell/spu ffmpeg h.264 etc code in the (gentoo) PPC area than most people.
http://dev.gentoo.org/~lu_zero/overlay/
http://planet.gentoo.org/developers/lu_zero

take a wonder over to the gentoo ppc irc channel sometime and see were the guys are that will help were they can im sure.

i assume their livePS3/PPC CD is still being kept current (and they will usually take idea's for app inclusion if you ask nice and help out were needed with info/quick feedback etc but iv not been around there for the few weeks so cant say for sure, take a look and report back if you feel like it, or not....8)
irc://irc.freenode.net/gentoo-ppc64

in ps3 news david and the others have been doing stuff too
http://patchwork.ozlabs.org/linuxppc/list?q=ps3

the SDL/trunk put up by yaegashi: over 4 months ago still does nothing.....
https://ssl.keshi.org/projects/ps3/trac ... /SDL/trunk
perhaps one or two of the productive EU guys can start one and get something moving now the UK machine etc is available?.

here a start of the tech programming thread ,add your interesting informative finds if you like.
http://www.powerdeveloper.org/forums/vi ... php?t=1082

http://www.powerdeveloper.org/forums/vi ... php?t=1090

and dont forget or ignore markos's freevec altivec lib (very useful for useing the altivec inside the cell)

http://www.powerdeveloper.org/forums/vi ... .php?t=387
http://freevec.org/
"About libfreevec

libfreevec is a free (LGPL) library with hand-optimized replacement routines for GLIBC, such as memcpy(), strlen(), etc. These routines have been written specifically to take advantage of the AltiVec unit (a.k.a Velocity Engine or VMX), and will only work on processors that include this unit.

This means they will not work on older processors, such as 603, 604, 750 (G3) or the POWER family of CPUs.

Check the Features page for more details on the exact set of functions that are included, with comments and rough speed gain estimates, and the FAQ for additional information about using the library itself."

http://www.powerdeveloper.org/forums/vi ... .php?t=835
|"markos wrote:
What I find very intriguing is the possibility that these algorithms may be applied to image processing applications as well, like GIMP, in particular the digital convolution filters, which I believe work in the same or similar way. Esp, since your code applies to "real" data -ie big data and not just "Proof of Concept" lab tests.

Krashan:Of course the principle of reducing memory accesses and paralellizing computations is valid for 2D convolutions. It will be the next step and results will be published in my Ph. D. dissertation which is about optimizing DSP algorithms for SIMD units placed in systems with limited memory bandwidth."
tictech2
Posts: 2
Joined: Thu Apr 05, 2007 12:45 am

Re: Multimedia with PS3 Linux

Post by tictech2 »

I'm the guilty party behind the blog post ;-) Having said that, once you've configured yum/yumex you're able to install 1000's of apps/libraries/tools without having to build them yourself. VLC/Xine and MPlayer were the only ones I was interested in at the time.

The PS3 isn't exactly the best supported Linux platform and downloading source + dependancies can be painful as a result. e.g. I tried several times to get the Source for VLC 0.8.6a to build on the PS3. When I finally got it to build it didn't decode DivX or Xvid *shrug*.
Matrixdub wrote:
jockyw2001 wrote:I've seen some feedback that there are issues with either audio or video playback on different distros with apps like Xine, Totem, Mplayer or VLC.

Would be nice to collect feedback about this and other multimedia issues in this thread.

PS: for YDL users, here you find some help to install VLC (or Mplayer or Xine):
http://tictech2.blogspot.com/
Hi. I read your blog on how to get VLC on YDL...That is one LENGTHY post! There must be a distro with the most recent application preinstalled! What about geexbox?
mbf
Posts: 55
Joined: Fri Aug 18, 2006 7:43 pm

Re: Multimedia with PS3 Linux

Post by mbf »

jockyw2001 wrote:I've seen some feedback that there are issues with either audio or video playback on different distros with apps like Xine, Totem, Mplayer or VLC.

Would be nice to collect feedback about this and other multimedia issues in this thread.

PS: for YDL users, here you find some help to install VLC (or Mplayer or Xine):
http://tictech2.blogspot.com/
I had VLC working out of the box on Fedora Core 6. Then later the sound started to behave eratically. The solution was to enable the "Advanced options", then in audio->output modules, force it to use OSS (Linux Open Sound System). Note that you have to permanently enable the advanced settings (Interface->Show advanced options), otherwise it will lose advanced settings the next time you change anything else.

As for the video, well, it's rather sluggish in 720p. In lower resolutions it's ok but it really looks ugly. The CPU usage for a 640x360 video was around 20%, so I don't really think the main problem is the optimization of ffmpeg right now. The problem is rather the lack of direct access to the frame buffer (it uses the x11 output module).

Same for MPlayer, which wouldn't let me use the frambuffer directly but only the x11 video out driver under X11 and SDL from the console (which uses its own fbcon driver). Needless to say it was even more sluggish.

As seen in other threads, it's possible to get 60fps in full HD out of the framebuffer. My personal goal is to use the PS3 as a media center (ala XBox Media Center) and NAS, for which I do not need or want XWindows. In this configuration, MPlayer would be the perfect candidate. I need to investigate some more in order to understand if MPlayer is just not compiled with the fb driver or if it's just not happy with the one of PS3's. More on that later, stay tuned. In any case, your knowledge of ffmpeg would be valuable in such a project ;)

Oh, by the way, in terms of optimizations, and unless any other distro starts to specifically target the PS3, I'll go for Gentoo. That might also help when I'll have to recompile MPlayer.
tictech2
Posts: 2
Joined: Thu Apr 05, 2007 12:45 am

Re: Multimedia with PS3 Linux

Post by tictech2 »

Did you manage to get the network working on Fedora 6? If so would you be able to post the settings here.

Thanks
mbf wrote:
jockyw2001 wrote:I've seen some feedback that there are issues with either audio or video playback on different distros with apps like Xine, Totem, Mplayer or VLC.

Would be nice to collect feedback about this and other multimedia issues in this thread.

PS: for YDL users, here you find some help to install VLC (or Mplayer or Xine):
http://tictech2.blogspot.com/
I had VLC working out of the box on Fedora Core 6. Then later the sound started to behave eratically. The solution was to enable the "Advanced options", then in audio->output modules, force it to use OSS (Linux Open Sound System). Note that you have to permanently enable the advanced settings (Interface->Show advanced options), otherwise it will lose advanced settings the next time you change anything else.

As for the video, well, it's rather sluggish in 720p. In lower resolutions it's ok but it really looks ugly. The CPU usage for a 640x360 video was around 20%, so I don't really think the main problem is the optimization of ffmpeg right now. The problem is rather the lack of direct access to the frame buffer (it uses the x11 output module).

Same for MPlayer, which wouldn't let me use the frambuffer directly but only the x11 video out driver under X11 and SDL from the console (which uses its own fbcon driver). Needless to say it was even more sluggish.

As seen in other threads, it's possible to get 60fps in full HD out of the framebuffer. My personal goal is to use the PS3 as a media center (ala XBox Media Center) and NAS, for which I do not need or want XWindows. In this configuration, MPlayer would be the perfect candidate. I need to investigate some more in order to understand if MPlayer is just not compiled with the fb driver or if it's just not happy with the one of PS3's. More on that later, stay tuned. In any case, your knowledge of ffmpeg would be valuable in such a project ;)

Oh, by the way, in terms of optimizations, and unless any other distro starts to specifically target the PS3, I'll go for Gentoo. That might also help when I'll have to recompile MPlayer.
User avatar
evilo
Posts: 230
Joined: Thu Apr 22, 2004 8:40 pm
Contact:

Post by evilo »

I got MPlayer working on YDL and played divx files through a NFS share on my NAS (although I still have weird issues with portmap).

I installed VLC as well, but it crash as soon as I put the display in fullscreen....

btw, software scaling sucks, sony could at least provide some basic hardware functions in the driver...

Anyway, playing "regular" SD divx is really fine and smooth, but "HD" divx are unplayable at the moment (laggy and shoppy sound)... but (hoping it could make a difference) I haven't recompiled the codec library yet (just used the precompiled ppc package).

My goal is to install freevo (as said in a previous post) to act as a media center, and be able to use the BD remote as well (I've done the pairing with the PS3 under linux, but it's not functional yet)

A default session (with autologin) that would automatically launch freevo, the BD remote to browse and launch video and my GF would be the happiest girl in the world :)
mbf
Posts: 55
Joined: Fri Aug 18, 2006 7:43 pm

Post by mbf »

@tictech2: If I remember correctly, I set it up from within KDE. And it's also better if you have plugged your network cable before booting. Apart from that I don't remember having real issues. PM me if you need help on that.

@evilo: Freevo looks good indeed. Have you checked the CPU usage with MPlayer while playing HD videos? I forgot to mention that the VLC version I'm using has Altivec optimizations... That might explain the rather low CPU usage compared to you guys.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

mbf wrote:I forgot to mention that the VLC version I'm using has Altivec optimizations... That might explain the rather low CPU usage compared to you guys.
Where did you find it or did you build it from source?
mbf
Posts: 55
Joined: Fri Aug 18, 2006 7:43 pm

Post by mbf »

I installed it from the Livna repositories.
rpm.livna.org is a community maintained add-on repository for Fedora Core that provides many useful packages that can not be distributed in Fedora Core or Fedora Extras for one reason or another, including multimedia applications such as xine and VideoLanClient, video drivers for ATI and Nvidia cards and firmware for common wireless cards.
Note that Fedora is not usually my distro of choice. I just went for one that I could install easily. I'll give a shot at Gentoo over the week end (everything is rebuilt from source with the appropriate optimizations when you install).
popper
Posts: 9
Joined: Mon Jan 15, 2007 5:21 am

Post by popper »

mbf wrote:I installed it from the Livna repositories.
rpm.livna.org is a community maintained add-on repository for Fedora Core that provides many useful packages that can not be distributed in Fedora Core or Fedora Extras for one reason or another, including multimedia applications such as xine and VideoLanClient, video drivers for ATI and Nvidia cards and firmware for common wireless cards.
Note that Fedora is not usually my distro of choice. I just went for one that I could install easily. I'll give a shot at Gentoo over the week end (everything is rebuilt from source with the appropriate optimizations when you install).
you could just do it the easy way and use a Gentoo stage4 tarball thats already compiled for ps3
http://www.daniel.jp/joomla/info/ps3/

does this mean the guys are gearing up to bring PS3 PPC/altivec and spu goodness to the wider world 8)
mbf
Posts: 55
Joined: Fri Aug 18, 2006 7:43 pm

Gentoo + MPlayer

Post by mbf »

I couldn't wait and installed Gentoo (see the Cell Project Overlay).

Next, I compiled emplayer with fbdev support.... set the resolution tro 720p and went on to play a movie (600x352). That played very smoothly although with an alarming 20% CPU usage AND the movie was not full screen. After a bit of fiddling, I eventually got it to play full screen with a less than perfect image quality but very good framerate. Here's the parameters I've used:

Code: Select all

mplayer movie.avi -ao oss -vo fbdev -vf scale:1280:720 -sws 0 -framedrop
With this, I had a full scrren movie playing with no noticable glitches and an average 90% CPU usage (as displayed by MPlayer, I haven't checked the real CPU usage as in 90% of only one PPU, or both?).

The -scale parameter forces software scaling (no choice here) and the -sws switch selects the scaleing algorithm (0 = fast bilinear). Any other algorithm and the movie is just not playable.

My initial quick and probably very wrong conclusions are:
- even with the vanilla "altivec" optimizations were turned on when compiling MPlayer, it obviously needs a bit more specific optimizations for the ppc64 architecture (20% CPU for a 600x300 movie would mean roughly 80% for a movie in 720p... forget about 1080p)
- the mplayer scaler is a hell of a cpu-cycle hungry monster. It's definitely the area that needs immediate attention and that could really benefit from an SPE based optimization. IMHO.

Oh, the guys at MPlayer say that the SDL scaler is superior... So I thought I'd give it a shot. First, I had to recompile SDL with fbcon support (if anyone working on gentoo/ps3 reads this, yes fbcon should be set as a system USE flag on ps3!). Then changed -vo to sdl, prefixed my command line with SDL_VIDEODRIVER=fbcon and then the PS3 hung. Alright, I got the hint and called it a day.

In the good news, some people are working on optimizing ffmpeg and mplayer for the PS3 as well as streamlining the cell toolchain and libspe(2).

For quick reference: mplayer man page and documentation
unsolo
Posts: 155
Joined: Mon Apr 16, 2007 2:39 am
Location: OSLO Norway

Post by unsolo »

I have near completed (well only the yv12 yuv420p(i420)) yuv2rgb (ARGB) spe acellerated.

That does 700 FPS at 1280x720 and 300 FPS at 1980x1080 .
Using only one SPE.

Note colorspace conversion from ffmpeg and mplayer is currently wasting 25% of the ppu when decoding.

we are working on other things such as decoders / filters etc

All this are a part of spu_medialib http://wiki.ps2dev.org/ps3:spu-medialib please join in if you can/want to contribute.
Don't do it alone.
Matrixdub
Posts: 60
Joined: Fri May 13, 2005 3:47 am

HDDVD key deleted

Post by Matrixdub »

Does this mean we can play BDiscs in Linux now? Or do we still need access to the RSX?
Last edited by Matrixdub on Fri May 04, 2007 5:06 am, edited 1 time in total.
laichung
Posts: 123
Joined: Fri May 06, 2005 2:02 pm

Post by laichung »

Why people always think about RSX? Does it mean to you, or you want it because you dont have it?

Does RSX have any hardware acceleration for MP4 decoding? I think CELL has enough power for decoding MP4, the only matters are about HDCP and AACS.
Last edited by laichung on Fri May 04, 2007 10:52 am, edited 1 time in total.
Matrixdub
Posts: 60
Joined: Fri May 13, 2005 3:47 am

Post by Matrixdub »

Isn't RSX the display driver-doesn't that mean we can't get proper output unless it goes through that? And sure the cell can decode the data, but don't we need RSX to display the data properly? Sorry if I'm being dumb.

PS: I think the subject of my previous message negates the AACS problem.
User avatar
StrontiumDog
Posts: 55
Joined: Wed Jun 01, 2005 1:41 pm
Location: Somewhere in the South Pacific

Post by StrontiumDog »

Isn't RSX the display driver-doesn't that mean we can't get proper output unless it goes through that? And sure the cell can decode the data, but don't we need RSX to display the data properly? Sorry if I'm being dumb.
Linux under the PS3 is quite capable of displaying 1920x1080px60Hz now. The issue isnt that, the issue is generating frames of data for it to display fast enough. Currently all quick and dirty ports of media software run on the over utilised and underpowered PPU and do not put any of the tough work onto the SPU's. Writing a media library to move the tough work to the SPU's will mean (without any further access to the RSX than the limited support sony has now given) that HD video should be playable at full frame rates.
ralferoo
Posts: 122
Joined: Sat Mar 03, 2007 9:14 am
Contact:

Post by ralferoo »

Matrixdub wrote:PS: I think the subject of my previous message negates the AACS problem.
No offence, but given the current climate of blog entries and even entire sites disappearing because ISPs are being threatened with court actions over this stupid key, why did you think it was a good idea to pollute our forum with the key? It adds nothing to your post and only gives the AACS LA another site to target. What is the point?

The key has absolutely nothing to do with Linux development and it's not even current news - the forum posting where it was first disclosed back in early February is still there, that's not going away, so what's with the current obsession of posting it everywhere?

Not only does it not have any relevance here, you didn't even manage to post the whole thing!

</rant>
Post Reply