forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Media Engine and Mp3 decoding

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Shapyi



Joined: 25 Apr 2005
Posts: 95

PostPosted: Wed Feb 11, 2009 11:49 am    Post subject: Media Engine and Mp3 decoding Reply with quote

I am working with an application that uses the media engine for extra CPU power. I would like to move mp3 decoding from the main CPU and use the media engine hardware method cooleyes discovered. Is it possible to do that or are there some restrictions I should know about before I start working on it? Thanks for the help.
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Wed Feb 11, 2009 11:58 am    Post subject: Reply with quote

For simply MP3 decoding you can use the sce* MP3 functions. It will decode on the ME. There are samples in the newer SDK.
Back to top
View user's profile Send private message
Shapyi



Joined: 25 Apr 2005
Posts: 95

PostPosted: Wed Feb 11, 2009 12:08 pm    Post subject: Reply with quote

I know, but is it possible to run my own code on the media engine and decode mp3 (say in a separate thread maybe)?
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Wed Feb 11, 2009 3:28 pm    Post subject: Reply with quote

Yes you can run your own code on the ME. Search for crazyc's sample.
Back to top
View user's profile Send private message
Shapyi



Joined: 25 Apr 2005
Posts: 95

PostPosted: Wed Feb 11, 2009 3:32 pm    Post subject: Reply with quote

Yeah I know you could. But I know Sony's PRX sets up the media engine for decoding mp3 audio, or h.264 video. My question is, when the ME is in that state and decoding "media" can I still run my own code on it by using threads or some other method?
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Wed Feb 11, 2009 3:33 pm    Post subject: Reply with quote

Don't know about that :/
I wonder if MP3 uses the ME or the VME??
Back to top
View user's profile Send private message
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Thu Feb 12, 2009 6:24 am    Post subject: Reply with quote

Shapyi wrote:
Yeah I know you could. But I know Sony's PRX sets up the media engine for decoding mp3 audio, or h.264 video. My question is, when the ME is in that state and decoding "media" can I still run my own code on it by using threads or some other method?


Most probably the second processor for *EITHER* decoding mp3 audio, or h.264 video *OR* running your own code and not *BOTH*. In both cases, you need a processor to wait for events. Due to the fact that official developers cannot run any code on the second processor, there is very few chances for us to be able to inject our own code to run them when the mp3/h.264 decoding code is idling without messing up.
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Thu Feb 12, 2009 6:08 pm    Post subject: Reply with quote

Then what is the VME for? I was given to believe that the whole point of the VME was to hardware decode Atract and possibly other music codecs, and for applying equalizer effects.

I'm sure the ME handles the video decoding though, cos the VME is only audio. Though I have a feeling, the ME runs the code to "manage" the VME in the case of audio, but the actual decoding is on VME.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Thu Feb 12, 2009 6:51 pm    Post subject: Reply with quote

More likely to be the other way around... the ME can't possibly be decoding the video - a 333 MHz MIPS cannot decode 720x480 h.264 in real-time. The VME MUST be doing most of the work. The ME is probably used for decoding the container, moving data, and colorspace conversion at most. It may also be decoding audio formats the VME doesn't understand.
Back to top
View user's profile Send private message AIM Address
hitchhikr



Joined: 04 Feb 2006
Posts: 83

PostPosted: Thu Feb 12, 2009 10:12 pm    Post subject: Reply with quote

There's a specific hw component in the console to decode such videos, nothing to do with the VME which is only used for sound, i think.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Fri Feb 13, 2009 8:46 am    Post subject: Reply with quote

hitchhikr wrote:
There's a specific hw component in the console to decode such videos, nothing to do with the VME which is only used for sound, i think.


Well, looking at the block diagram, the AVC decoding is shown as a different block, but it's certainly not being decoded by the ME. It's a hardware module doing the heavy lifting. :)
Back to top
View user's profile Send private message AIM Address
Shapyi



Joined: 25 Apr 2005
Posts: 95

PostPosted: Fri Feb 13, 2009 12:51 pm    Post subject: Reply with quote

Well for my project I would only need Mp3 decoding using Sony's modules while using the media engine CPU for other operations. Anyone know if that is possible?
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Fri Feb 13, 2009 1:21 pm    Post subject: Reply with quote

The PS3 must have dedicated H264 decoding hardware too. There's no way a crappy 3.2GHz CPU that's not half as powerful as a desktop 3.2GHz CPU can decode 1080p. My old 3200+ couldn't.
Back to top
View user's profile Send private message
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Fri Feb 13, 2009 6:07 pm    Post subject: Reply with quote

Torch wrote:
The PS3 must have dedicated H264 decoding hardware too. There's no way a crappy 3.2GHz CPU that's not half as powerful as a desktop 3.2GHz CPU can decode 1080p. My old 3200+ couldn't.


Uhh its PPC.. PPC is hot damn digitty, its about 2x as powerful as your CPU xD
Back to top
View user's profile Send private message AIM Address
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Fri Feb 13, 2009 10:53 pm    Post subject: Reply with quote

Wally4000 wrote:
Uhh its PPC.. PPC is hot damn digitty, its about 2x as powerful as your CPU xD


It'd probably barely manage the 5MBytes/s Bluray spec on CPU alone. No way it'd play 10+ MBps videos from the XMB if it was just CPU. It can't use the RSX either cos it doesn't support CUDA. 20MBps footage brings my C2Q @ 3.52GHz to its knees, decoding on 3 cores.
Back to top
View user's profile Send private message
Mihawk



Joined: 03 Apr 2007
Posts: 29

PostPosted: Sat Feb 14, 2009 4:32 am    Post subject: Reply with quote

Torch wrote:
The PS3 must have dedicated H264 decoding hardware too. There's no way a crappy 3.2GHz CPU that's not half as powerful as a desktop 3.2GHz CPU can decode 1080p. My old 3200+ couldn't.


The hardware is called SPE(s) ;)
_________________
Ask and it will be given to you; seek and you will find; knock and the door will be opened to you.
Back to top
View user's profile Send private message
Chrighton



Joined: 15 Jun 2005
Posts: 58

PostPosted: Sat Feb 14, 2009 6:49 am    Post subject: Reply with quote

If the SPEs had a destiny, it would be signal processing - they should be able to chew through a couple (and I think I'm being conservative) concurrent 1080p sources quite easily.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Feb 14, 2009 7:33 am    Post subject: Reply with quote

Shapyi wrote:
Well for my project I would only need Mp3 decoding using Sony's modules while using the media engine CPU for other operations. Anyone know if that is possible?


Probably not. The ME is almost certainly used to pass data to/from the VME/AVC decoders, among other tasks. It's clear that Sony loads ME controlling software as part of the codecs, and since the ME is doing the controlling, that's why it's called an ME codec. The ME might not be doing that actual decoding itself, but it's in control of the whole process.

The code we use to run stuff on the ME was based on parts of the code used by Sony to start their stuff on the ME as part of those codecs, so it's a dead certainty they interfere with each other. One or the other, not both.
Back to top
View user's profile Send private message AIM Address
Shapyi



Joined: 25 Apr 2005
Posts: 95

PostPosted: Sat Feb 14, 2009 11:01 am    Post subject: Reply with quote

J.F. wrote:
Shapyi wrote:
Well for my project I would only need Mp3 decoding using Sony's modules while using the media engine CPU for other operations. Anyone know if that is possible?


Probably not. The ME is almost certainly used to pass data to/from the VME/AVC decoders, among other tasks. It's clear that Sony loads ME controlling software as part of the codecs, and since the ME is doing the controlling, that's why it's called an ME codec. The ME might not be doing that actual decoding itself, but it's in control of the whole process.

The code we use to run stuff on the ME was based on parts of the code used by Sony to start their stuff on the ME as part of those codecs, so it's a dead certainty they interfere with each other. One or the other, not both.


Makes sense. I haven't been able to get anything running, even as a sample.

So the ME actually, controls the VME... does that mean it might be possible to use the VME? Has anyone been able to access that piece of hardware for use? I know Sony can do as they wish with the VME, but has anyone been able to do anything with it in terms of homebrew?

I am trying to write a media player for PSP and I would like to off load as much to hardware as possible. Sony's modules are too limited in terms of MPEG4 and AVC decoding (resolution restrictions, etc). I read that the VME is a FPGA. I was wondering if it would be possible to access it in order to offload audio decoding, color space conversion and idct in order to save CPU cycles.

Thank you for the answer and keeping this on topic.
Back to top
View user's profile Send private message
crazyc



Joined: 17 Jun 2005
Posts: 410

PostPosted: Sat Feb 14, 2009 1:16 pm    Post subject: Reply with quote

Quote:
So the ME actually, controls the VME... does that mean it might be possible to use the VME? Has anyone been able to access that piece of hardware for use? I know Sony can do as they wish with the VME, but has anyone been able to do anything with it in terms of homebrew?
AFAIK, no one knows what the VME or the AVC really are. There's probably a DCT accelerator in there somewhere, but how to use it and what else is in there, Sony only knows.
Quote:
I read that the VME is a FPGA
I don't think there's any evidence for that.
Back to top
View user's profile Send private message
cheriff
Regular


Joined: 23 Jun 2004
Posts: 262
Location: Sydney.au

PostPosted: Sat Feb 14, 2009 3:03 pm    Post subject: Reply with quote

Maybe not an fpga as it were, but it does seem to be reconfigurable under software control in perhaps a similar manner.:

Some slides:
http://www.extremetech.com/slideshow/0,2850,l%253D%2526a%253D133950,00.asp

And some interesting reading from the horse's mouth, on the vme:
http://www.sony.net/Products/SC-HP/cx_news/vol42/pdf/sideview42.pdf

Other than that, there doesn't seem to be a lot out there, but I can guess that reversing the configuration bitstream format from a Sony module to the point of being able to emit custom ones ... would be difficult.
_________________
Damn, I need a decent signature!
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sun Feb 15, 2009 8:23 am    Post subject: Reply with quote

Basically, there's only two lines of work here: using Sony's "codecs" for decoding video and audio, and using the ME to run code. The former isn't low-level as it uses the Sony interface from user mode. The latter is COMPLETELY low-level and requires a kernel mode prx for user mode homebrew.
Back to top
View user's profile Send private message AIM Address
cualquiercosa327



Joined: 25 Nov 2009
Posts: 5

PostPosted: Mon Feb 01, 2010 5:11 am    Post subject: ME/VME...could this be possible? Reply with quote

hi.I know some parts of this has been posted before in several post but I dont know where asked it and if it could be an silly question.(correct me if i mistake,please)

First i know we can use me as other cpu (thanks to several people of this forum,using j.f / crazyc prx/samples as StrmnNrmn has done on daedalus.)
I read on a older post StrmnNrmn created a 'job manager' on top mediaengine.prx, which coordinates batches of work between the main CPU and the ME.
he uses J.F.'s MediaEngine.prx ,(i also have read it is not "finished" because some problem as not being able to stop the unit and other things)


The other way we can use is as cooleyes demos/programs using sony'prx and being able to decoder multimedia with hardware (they are many doubts how internally it works,how vme works...)


as PspPet said in a older post (2005):
"It appears the VME software is tied into the ME (Media Engine).

Suggestions/speculation:
If interested in the ME software, take a look at the "mebooter.prx" and "mebooter_umdvideo.prx" system files. Both of these files contain a GZIP copy of the ME software at the end (the mebooter.prx version is bigger, over 800KB).
(ie. the ME code is unziped, saved to memory, and the ME is reset).
You can disassemble this with a MIPS disassembler (the ME is the 2nd MIPS CPU). About half of it is MIPS code. The other half is data, some of which looks like it *might* be FPGA initialization data for the VME. It could also be general data tables (for the ME CPU), and/or code/data for the AVC (MPEG4 decoder).
A lot of reverse engineering required to figure it out."


I imagine the fist part of code of mebooter.prx initialized the ME and pass the data/instruction to vme and load/wait other prx with codec (aac,mp3..) is loaded.

could be posible create other 'job manager' into J.F.'s MediaEngine.prx
and use some parts of this disasmed code also ,making a "multitasking" mediaengine.prx able to use both extra cpu and as sony uses as vme starter/coordinator.


I am not talking to trying to understand the vme code,only reuse (imagine modificating something) the sony's dissasmed code .

dani
Back to top
View user's profile Send private message
SilverSpring



Joined: 27 Feb 2007
Posts: 115

PostPosted: Mon Feb 01, 2010 2:05 pm    Post subject: Reply with quote

The ME firmware was only embedded into those prxs upto 2.00. From 2.50 onwards they are stored in /kd/resource/me_xxx.img

No one has really documented the ME firmware extensively. It's quite complicated and relies heavily upon some type of MMIO at 0x4000000 (which on the main CPU is mapped to the EDRAM of the GE to be used as VRAM). This MMIO on the ME hasn't been documented either.

So at the moment, no one really knows how the VME works or how it's used.
_________________
PSP PRX LibDocs
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group