PMF Player

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

User avatar
magiK
Posts: 21
Joined: Sun Apr 09, 2006 6:18 pm

Post by magiK »

Thanks Raphael but we're not quite there yet :)

jonny, I'm really pulling my hair over this one. I've made it freeze with a 200 frame sample, about 250kb in size, completely loaded into memory. It freezes at frame 59, the second frame of the second GOP. If I set the encoder to output the SPS/PPS headers only once, at the start, it gets past that point but freezes at frame 104.
I don't think CopyAu2Me can copy more data than iSize. The applications I've looked at are using that function to copy the AU from the interleaved stream so copying more that the size of the AU wouldn't make sense.
I'm thinking my buffering_period info is not correct but Elecard's headers certainly are yet you say it's still freezing. Can you upload a bad stream generated by Elecard so I can take a look and maybe eliminate some posibilities?
xxxstarmanxxx
Posts: 84
Joined: Thu Jan 05, 2006 8:52 am

Post by xxxstarmanxxx »

jonny wrote:the purpose of the code i've posted is to identify the cause of random crashes (by crash i mean the psp freeze and the app no more respond)
every comment (about the code i've posted) not focusing on the resolution of this problem is really superfluous (having smooth playback is not the purpose and not the problem here)
Hi Jonny -

I've yet to produce a crash encoding via quantisizer - although quant values have not been altered from magiK's graph settings.

All my freezing occur on variable bitrate encodes - and those freezes fluctuate depending on the min/max apeture.

All the best

J.
User avatar
magiK
Posts: 21
Joined: Sun Apr 09, 2006 6:18 pm

Post by magiK »

I've spotted the mistake in CopyAu2Me.
Replace this:

Code: Select all

		LLI[i-1].iSize = iSize % DMABLOCK;
		LLI[i-1].Next  = NULL;

with this:

Code: Select all

	if(iSize % DMABLOCK)
	{
		LLI[i].pSrc  = pSrc + i * DMABLOCK;
		LLI[i].pDst  = (void*)(MEAVCBUF + i * DMABLOCK);
		LLI[i].iSize = iSize % DMABLOCK;
		LLI[i].Next  = NULL;
	}
	else
	{
		LLI[i-1].Next  = NULL;
	}

Some clips encoded with x264 are still freezing though :(
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

Post by jonny »

i wasn't 100% accurate in my previous report :)
i'll try to summarize better:

- using the elecard encoder and loading the full clip on memory, none of the clips i've tryed crashes

- using the elecard encoder and buffered reads, many clips randomly crashes
usually the crash happen when the buffer is filled (if don't crash, i can spot, sometimes, artifacts in the decoding, so something is still wrong)

- using your x264 version, i have clips that crashes also when fully loaded in memory
that's why i think we should focus on only elecard clips atm

i've uploaded a clip and the test app, as you can see if the clip is fully loaded in memory, all goes well.
if you use buffered reads, it crashes
you can change the avc_reader_buffer_size parameter to check (using a buffer around 20MB will make the clip fully loaded in memory)

about CopyAu2Me and what i've said in the prev message, you can try "main_try_2.c"
here i read one frame at time from the memstick, as you can see it crashes really fast
and if you raise "read_ahead" (around 0.5MB), some initial frames are decoded better (that's why it seems CopyAu2Me transfer more data than iSize)

about the code i've added, i can't really spot errors
basically i first get frame positions and lengths using the access unit delimiters
the buffered reading routines seems also ok
(do you see anything wrong here?)
i've also already muxed frames inside a pmp (this is really the first thing i've tryed some days ago :) and i'm obtaining the same behavior when i try to play (clips crashes near the same points if i use the same buffer size of the testing app)

test app: http://www.megaupload.com/?d=VNBID6JZ
a clip (made with elecard): http://www.megaupload.com/?d=TIKGFP4V
User avatar
magiK
Posts: 21
Joined: Sun Apr 09, 2006 6:18 pm

Post by magiK »

Try adding a sceKernelDcacheWritebackInvalidateAll() after the fread().
PS: Looks like sceCtrlReadBufferPositive is slowing things down a lot :)
User avatar
groepaz
Posts: 305
Joined: Thu Sep 01, 2005 7:44 am
Contact:

Post by groepaz »

Looks like sceCtrlReadBufferPositive is slowing things down a lot :)
it implicitly waits for vblank, try sceCtrlPeekBufferPositive instead
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

Post by jonny »

Try adding a sceKernelDcacheWritebackInvalidateAll() after the fread().
i feel quite stupid now :) (but more relaxed ^^ )


EDIT: i've got also seeks working, but every time i must call:

Shutdown();
Initialize();

or sceMpegAvcDecode crash.
is this the way to go? (maybe i'm still missing an easyer way :)
therock003
Posts: 96
Joined: Fri Sep 23, 2005 11:09 pm

Post by therock003 »

Hey guys,sorry for bumping in here like that,but could you plz tellme what exactly are you testing here,and what you are trying to achieve?
User avatar
magiK
Posts: 21
Joined: Sun Apr 09, 2006 6:18 pm

Post by magiK »

jonny wrote:i've got also seeks working, but every time i must call:

Shutdown();
Initialize();

or sceMpegAvcDecode crash.
is this the way to go? (maybe i'm still missing an easyer way :)
It worked fine last time I tried it, without shutdown/init, even when jumping to a non-IDR frame (except for the garbled frames of course).
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

Post by jonny »

on the code i've posted, try to add:

Code: Select all

if (controller.Buttons & PSP_CTRL_SQUARE) { i = 0; sceKernelDelayThread(1000000); }
after:

Code: Select all

SceCtrlData controller;
sceCtrlReadBufferPositive(&controller, 1);
if (controller.Buttons & PSP_CTRL_TRIANGLE) break;
let the video play some seconds and press square, the video will seek to the start.
after this, try to keep square pressed now, looping on frame 0 now will generate the crash (this is the most simple example i can find about seeking to idr frame that crash).
also jumping on non idr frames seems to crash (try i+=2 in the loop)
(i'm sorry if i'm again missing something, but i can't really spot what)
Last edited by jonny on Sun Jun 04, 2006 5:08 am, edited 2 times in total.
jas0nuk
Posts: 137
Joined: Thu Apr 27, 2006 8:00 am

Post by jas0nuk »

therock003 wrote:Hey guys,sorry for bumping in here like that,but could you plz tellme what exactly are you testing here,and what you are trying to achieve?
lol, not too sure myself, I think originally they were trying to mux PMF files, but now they are trying to improve the PMF player?
User avatar
magiK
Posts: 21
Joined: Sun Apr 09, 2006 6:18 pm

Post by magiK »

jonny, strangely enough, clips encoded with the modified x264 encoder do not freeze while seeking. I'm guessing some setting in the Elecard encoder is responsible for this. You can grab an updated version of the x264 encoder from here. I've encoded a few clips with it and no freeze so far (fingers crossed).

therock003, jas0nuk, we're trying to properly decode an AVC stream using the PSP's integrated decoder.
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

Post by jonny »

yep, tryed some clips around 10mins and no crashes so far, seeking everywhere also don't crash (fingers crossed too :)
digihoe
Posts: 108
Joined: Sat May 14, 2005 7:40 pm

Post by digihoe »

What is the highest resulotion possible? Is it 480*272 or is it 720*512?

Best regards!
excalibur
Posts: 11
Joined: Sun Jan 15, 2006 8:36 pm

Post by excalibur »

hi jonny, i have read that you have make a beta of pmp with avc support (pmf derivated) can i have a version for test , i have see that you avec pb with seek but in first version it s not very important ..
the beta version (or alpha if you preffered ;-) ) is interesting for make experience on the encoder..
great job and thanks...
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

Post by jonny »

hi jonny, i have read that you have make a beta of pmp with avc support (pmf derivated) can i have a version for test
no :) (no beta testing is going on)
anyway, if all goes as expected, i should finish the muxer/player this week.
(the muxer is already finished, the player need some cleanup and a torture testing cycle)

@magiK:
your last x264 seems really ok, tested a full 2h movie with no crashes
therock003
Posts: 96
Joined: Fri Sep 23, 2005 11:09 pm

Post by therock003 »

So will this pmf player be better than our beloved pmp player?
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

Post by jonny »

the player is based on pmpmod (with a reduced set of options atm) and it's not a pmf player (why should i do a pmf player if there is already one? :)
pure avc streams will be muxed inside a .pmp
Eingang
Posts: 59
Joined: Wed Jan 04, 2006 7:33 am

Post by Eingang »

therock003 wrote:So will this pmf player be better than our beloved pmp player?
Possibly performance of avc pmps will be better I guess.....
Djakku
Posts: 45
Joined: Mon Jan 30, 2006 2:41 am

Post by Djakku »

At the risk of sounding completely off topic, Ive found a link from DCemu about a UMD composer.. I dont know any japanese so I only read the english part and it seem that sony will soon release a umd video composer.. Would that be helpfull for your work, that I dont know but you might want to satifsy your curiosity :<)
https://www.universalmediadisc.com/umdcomposer/

keep up the GREAT work!!
digihoe
Posts: 108
Joined: Sat May 14, 2005 7:40 pm

Post by digihoe »

https://www.universalmediadisc.com/umdc ... uction.pdf
On page 10 the specification of the AVC profile is stated... I guess I'll be having 720*480 :-)

Best regards!
User avatar
magiK
Posts: 21
Joined: Sun Apr 09, 2006 6:18 pm

Post by magiK »

I've traced things down to the VideoCodec driver so only the VideoCodec and the MpegBase modules are required to decode AVC. I've also managed to set up the decoder for 720x480 content but it freezes on everything I throw at it. It would be great if someone could upload the first 2-3MB of a 00001.MPS file from an original UMD movie for further investigation.

Here's some quick code:
http://www.megaupload.com/?d=L3Y4E0US
User avatar
0okm0000
Posts: 116
Joined: Fri Jan 13, 2006 9:51 am
Contact:

Post by 0okm0000 »

magiK wrote:I've traced things down to the VideoCodec driver so only the VideoCodec and the MpegBase modules are required to decode AVC. I've also managed to set up the decoder for 720x480 content but it freezes on everything I throw at it. It would be great if someone could upload the first 2-3MB of a 00001.MPS file from an original UMD movie for further investigation.

Here's some quick code:
http://www.megaupload.com/?d=L3Y4E0US
UMD-MS001-3.Initial D
00001.MPS size: 8,118,272
file link in PM ^^
PSP hardware hack
http://0okm.blogspot.com/
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

Post by jonny »

down to the metal :O :)
User avatar
magiK
Posts: 21
Joined: Sun Apr 09, 2006 6:18 pm

Post by magiK »

Thanks a lot 0okm0000 ^^ Unfortunately it freezes with that sample as well so I'm back to the drawing board :(
User avatar
magiK
Posts: 21
Joined: Sun Apr 09, 2006 6:18 pm

Post by magiK »

I'm not sure how I missed this but obviously mebooter_umdvideo.prx must be loaded in order to play 720x480 content. Unfortunately, sceMpegBaseCscAvc can only do 512x512 pixels at a time. The VSH player goes around this by doing three 256-pixel CSCs.
Tracing all that mess is not easy and in my opinion, not worthed.
First of all, you need the buffer to be on a 4MB boundary so you're wasting a good amount of memory, unless somehow you manage to put it to good use (the VSH player does). With a single 512x480 CSC, a Sony encoded stream was playing fast enough but my x264 encoded sample played at about 15-20fps.
So I think I'll put this on hold. 480x272 content looks good, plays fast and you get plenty of battery time with it :)
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

Post by jonny »

480x272 content looks good, plays fast and you get plenty of battery time with it :)
i agree. also i think near no one will want to use 720x480 on full movies anyway.

nyu! :)
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

I wonder if anyone can help me with this problem..

I can compile the player, and play a file ok, but if I insert the line:

Code: Select all

USE_PSPSDK_LIBC = 1
into a makefile to try to use it in an existing program, everything
goes nuts, and I get all sorts of compile errors.

If I exclude that line from the makefile of the test app, it doesn't work,
so I assume I need it.
What is the problem?
Post Reply