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 

PMF Player
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
magiK



Joined: 09 Apr 2006
Posts: 22

PostPosted: Sat Jun 03, 2006 1:50 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
xxxstarmanxxx



Joined: 05 Jan 2006
Posts: 84

PostPosted: Sat Jun 03, 2006 3:14 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
magiK



Joined: 09 Apr 2006
Posts: 22

PostPosted: Sat Jun 03, 2006 5:06 am    Post subject: Reply with quote

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

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


with this:
Code:

   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 :(
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jonny



Joined: 22 Sep 2005
Posts: 351

PostPosted: Sat Jun 03, 2006 7:49 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
magiK



Joined: 09 Apr 2006
Posts: 22

PostPosted: Sat Jun 03, 2006 8:27 am    Post subject: Reply with quote

Try adding a sceKernelDcacheWritebackInvalidateAll() after the fread().
PS: Looks like sceCtrlReadBufferPositive is slowing things down a lot :)
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
groepaz



Joined: 01 Sep 2005
Posts: 305

PostPosted: Sat Jun 03, 2006 9:06 am    Post subject: Reply with quote

Quote:
Looks like sceCtrlReadBufferPositive is slowing things down a lot :)


it implicitly waits for vblank, try sceCtrlPeekBufferPositive instead
_________________
http://www.hitmen-console.org
http://hitmen.c02.at/files/yapspd/
Back to top
View user's profile Send private message Visit poster's website
jonny



Joined: 22 Sep 2005
Posts: 351

PostPosted: Sat Jun 03, 2006 5:37 pm    Post subject: Reply with quote

Quote:

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 :)
Back to top
View user's profile Send private message Visit poster's website
therock003



Joined: 23 Sep 2005
Posts: 96

PostPosted: Sun Jun 04, 2006 2:33 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
magiK



Joined: 09 Apr 2006
Posts: 22

PostPosted: Sun Jun 04, 2006 3:30 am    Post subject: Reply with quote

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).
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jonny



Joined: 22 Sep 2005
Posts: 351

PostPosted: Sun Jun 04, 2006 4:57 am    Post subject: Reply with quote

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

Code:

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


after:

Code:

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
Back to top
View user's profile Send private message Visit poster's website
jas0nuk



Joined: 27 Apr 2006
Posts: 137

PostPosted: Sun Jun 04, 2006 4:59 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
magiK



Joined: 09 Apr 2006
Posts: 22

PostPosted: Sun Jun 04, 2006 8:00 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jonny



Joined: 22 Sep 2005
Posts: 351

PostPosted: Sun Jun 04, 2006 6:07 pm    Post subject: Reply with quote

yep, tryed some clips around 10mins and no crashes so far, seeking everywhere also don't crash (fingers crossed too :)
Back to top
View user's profile Send private message Visit poster's website
digihoe



Joined: 14 May 2005
Posts: 108

PostPosted: Sun Jun 04, 2006 7:32 pm    Post subject: Reply with quote

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

Best regards!
Back to top
View user's profile Send private message
excalibur



Joined: 15 Jan 2006
Posts: 11

PostPosted: Mon Jun 05, 2006 8:13 pm    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
jonny



Joined: 22 Sep 2005
Posts: 351

PostPosted: Mon Jun 05, 2006 9:46 pm    Post subject: Reply with quote

Quote:

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
Back to top
View user's profile Send private message Visit poster's website
therock003



Joined: 23 Sep 2005
Posts: 96

PostPosted: Mon Jun 05, 2006 11:14 pm    Post subject: Reply with quote

So will this pmf player be better than our beloved pmp player?
Back to top
View user's profile Send private message
jonny



Joined: 22 Sep 2005
Posts: 351

PostPosted: Mon Jun 05, 2006 11:43 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Eingang



Joined: 04 Jan 2006
Posts: 59

PostPosted: Tue Jun 06, 2006 2:51 am    Post subject: Reply with quote

therock003 wrote:
So will this pmf player be better than our beloved pmp player?


Possibly performance of avc pmps will be better I guess.....
Back to top
View user's profile Send private message
Djakku



Joined: 30 Jan 2006
Posts: 45

PostPosted: Thu Jun 08, 2006 7:34 am    Post subject: Reply with quote

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!!
Back to top
View user's profile Send private message
digihoe



Joined: 14 May 2005
Posts: 108

PostPosted: Thu Jun 08, 2006 8:33 am    Post subject: Reply with quote

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

Best regards!
Back to top
View user's profile Send private message
magiK



Joined: 09 Apr 2006
Posts: 22

PostPosted: Fri Jun 16, 2006 7:07 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
0okm0000



Joined: 13 Jan 2006
Posts: 116

PostPosted: Fri Jun 16, 2006 1:00 pm    Post subject: Reply with quote

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/
Back to top
View user's profile Send private message Visit poster's website
jonny



Joined: 22 Sep 2005
Posts: 351

PostPosted: Fri Jun 16, 2006 5:28 pm    Post subject: Reply with quote

down to the metal :O :)
Back to top
View user's profile Send private message Visit poster's website
magiK



Joined: 09 Apr 2006
Posts: 22

PostPosted: Fri Jun 16, 2006 11:45 pm    Post subject: Reply with quote

Thanks a lot 0okm0000 ^^ Unfortunately it freezes with that sample as well so I'm back to the drawing board :(
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
magiK



Joined: 09 Apr 2006
Posts: 22

PostPosted: Sun Jun 25, 2006 9:29 pm    Post subject: Reply with quote

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 :)
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jonny



Joined: 22 Sep 2005
Posts: 351

PostPosted: Mon Jun 26, 2006 1:51 am    Post subject: Reply with quote

Quote:

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! :)
Back to top
View user's profile Send private message Visit poster's website
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Sun Aug 06, 2006 5:19 am    Post subject: Reply with quote

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:
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?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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