Announcing SMS project

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

bix64
Posts: 38
Joined: Mon Oct 17, 2005 6:40 am

Post by bix64 »

Hello, EEUG

Can you put your IF.bin file some where, to compare it whit other, extract whit virualDu*, GSpo*, ACIDDra*, ... ?

Question, IPU Display a Framebuffer ? So we have to display lpFrame -> m_pBuf ?

Bye
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

Here you can find my 'IF.bin'. IPU performs colorspace conversion (YUV->RGB) first and then displays conversion's result. lpFrame -> m_pBuf points to decoded macroblocks. IPU takes them, converts to RGB format and sends result to the GS. At the end IPU displays textured sprite in full screen maintaining aspect ratio of source picture (so depending on it you can experience "black bars" at the top and at the bottom of screen).
bix64
Posts: 38
Joined: Mon Oct 17, 2005 6:40 am

Post by bix64 »

Thank's for your file and your explication.

But I don't understand.

You write:

Code: Select all

   SMS_Frame* lpFrame = NULL; 

   lCodecCtx.m_pCodec -> Decode ( 
      &lCodecCtx, ( void** )&lpFrame, lpData, lSize 
     ); 

     if ( lpFrame ) { 

      if ( !lpFrame -> m_pData ) lpFrame = &g_MPEGCtx.m_CurPic; 

      lpIPUCtx -> Display ( lpFrame -> m_pData );
m_pData doesn't exist in lpFrame structure cause it's initialized whit SMS_Frame*, and not whit SMS_FrameBuffer*.

And I saw in IPU.h void ( *Display ) ( struct SMS_FrameBuffer* );

So I have to write:

Code: Select all

   SMS_Frame* lpFrame = NULL; 

   lCodecCtx.m_pCodec -> Decode ( 
      &lCodecCtx, ( void** )&lpFrame, lpData, lSize 
     ); 

     if ( lpFrame ) { 

      if ( !lpFrame -> m_pBuf ) lpFrame = &g_MPEGCtx.m_CurPic; 

      lpIPUCtx -> Display ( lpFrame -> m_pBuf );
I'm right or not?

Bye
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...this is because I've used older version of SMS (that I use on PC), sorry :). I've "invented" SMS_FrameBuffer a bit later, so now "lpFrame" variable has to have "SMS_FrameBuffer*" type like this "SMS_FrameBuffer* lpFrame;", so the code would be like this:

Code: Select all

   SMS_FrameBuffer* lpFrame = NULL; 

   lCodecCtx.m_pCodec -> Decode ( 
      &lCodecCtx, ( void** )&lpFrame, lpData, lSize 
     ); 

     if ( !lpFrame ) { 

      lpFrame = g_MPEGCtx.m_CurPic.m_pBuf; 

      lpIPUCtx -> Display ( lpFrame ); 

...sorry again...
bix64
Posts: 38
Joined: Mon Oct 17, 2005 6:40 am

Post by bix64 »

Hey, sorry for what???

You give me the code, and all explication.
You're a very good teacher!!!

Thanks for all.
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...for desinformation ;)...
bix64
Posts: 38
Joined: Mon Oct 17, 2005 6:40 am

Post by bix64 »

Hello EEUG,

I didn't find any tool which can extract a IF whit the same structure of your, so I wrote some code line to done that whit SMS, and inserted them to _sms_play_v fonction, (cause I make none audio avi file).

Can you take a look and tell me if it's OK or not?

Code: Select all

static void _sms_play_v ( void ) {

 int              NbIFrame = 0;
 int              lSize;
 SMS_FrameBuffer* lpFrame;
 SMS_AVPacket*    lpPacket = s_Player.m_pCont -> NewPacket ( s_Player.m_pCont );
 float            lFrameRate = ( float )s_Player.m_pCont -> m_pStm[ s_VideoIdx ] -> m_RealFrameRate / ( float )s_Player.m_pCont -> m_pStm[ s_VideoIdx ] -> m_RealFrameRateBase;
 float            lDiff;
 float            lNextFrame = g_Timer;
 float            lFrameTime = 1000.0F / lFrameRate;
 char             lBuff[ 128 ];

 sprintf ( lBuff, "Buffering %s file (video only)...", s_Player.m_pCont -> m_pName  );

 s_Player.m_pGUICtx -> Status ( lBuff );
 s_Player.m_pFileCtx -> Stream ( s_Player.m_pFileCtx, s_Player.m_pFileCtx -> m_CurPos, 384 );

 _prepare_ipu_context ( 1 );

 while ( 1 ) {

  int lButtons = GUI_ReadButtons ();

  if ( lButtons & PAD_SELECT ) {

   lNextFrame = g_Timer;
   _draw_text ( "Pause" );
   GUI_WaitButton ( PAD_START, 0 );

  } else if ( lButtons & PAD_TRIANGLE ) {

   s_Player.m_pIPUCtx -> Sync ();
   _draw_text ( "Stopping" );
   break;

  }  /* end if */

  lSize = s_Player.m_pCont -> ReadPacket ( lpPacket );

  if &#40; lSize < 0 &#41;

   break;

  else if &#40; lSize == 0 &#41; continue;

  if &#40; lpPacket -> m_StmIdx != s_VideoIdx &#41; continue;

  if &#40;  s_pVideoCodec -> Decode &#40;
         &s_Player.m_pCont -> m_pStm&#91; s_VideoIdx &#93; -> m_Codec, &#40; void** &#41;&lpFrame, lpPacket -> m_pData, lpPacket -> m_Size
        &#41;
  &#41; &#123;

   s_Player.m_pIPUCtx -> Sync &#40;&#41;;

   lDiff = lNextFrame - g_Timer;

   if &#40; lDiff > 0.0F &#41; Timer_Wait &#40; lDiff &#41;;


// Debut ajout Extract IF

if &#40; g_MPEGCtx.m_pCurPic -> m_KeyFrame == SMS_FT_I_TYPE &#41; &#123;
  
	NbIFrame++;
	
	if &#40; NbIFrame == 2 &#41; &#123;

   lNextFrame = g_Timer;
   _draw_text &#40; "Extracting IFrame" &#41;;

	FILE* lpFile = fopen &#40; "mc0&#58;SMS/skin.bin", "wb" &#41;; 
	fseek &#40; lpFile, 0, SEEK_SET &#41;; 
	fwrite &#40; lpPacket -> m_pData, 1, lpPacket -> m_Size, lpFile &#41;;
	fclose &#40; lpFile &#41;; 

   s_Player.m_pIPUCtx -> Display &#40; lpFrame &#41;;

   _draw_text &#40; "End Extracting IFrame Press START" &#41;;
   GUI_WaitButton &#40; PAD_START, 0 &#41;;

&#125;  /* end if NbI-Frame */

&#125;  /* end if I-Frame */

// Fin ajout Extract IF


   s_Player.m_pIPUCtx -> Display &#40; lpFrame &#41;;

  &#125;  /* end if */

  lNextFrame = g_Timer + lFrameTime;

 &#125;  /* end while */

 lpPacket -> Destroy &#40; lpPacket &#41;;

&#125;  /* end _sms_play_v */
So I extract the twice I-Frame in this fonction.

Bye
Bixente
bix64
Posts: 38
Joined: Mon Oct 17, 2005 6:40 am

Post by bix64 »

Note: This version of SMS is just for me and poeple who want to work on skin integration.
Bye
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...I'll get back to you tomorrow, since I left the code which extracts I-Frame from AVI file at work. Maybe it would be great to make an utility on PC which can extract I-Frame from avi file (also with preview :))...
bix64
Posts: 38
Joined: Mon Oct 17, 2005 6:40 am

Post by bix64 »

News:

Version Extract I-Frame: It's OK for extracting, creation of a skin.bin file in directory mc0:SMS.

Version Draw Skin: For the moment, my code draw a green skin at initialization and a real skin when it redraw GUI ( at the end of avi playing, or when stopping ).
I think there is an initialized parameter, so i'm tring to find which one.

bye.
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...this

Code: Select all

 memcpy &#40; SMS_DSP_SPR_CONST, &g_DataBuffer&#91; SMS_IDCT_CONST_OFFSET &#93;, SMS_IDCT_CONST_SIZE &#41;;

 SMS_DSP_Init &#40;&#41;;
performs DSP stuff initialization. It's executed inside "SMS_Initialize" after initialization of the GUI, so that causes green screen. I think it's safe to move these two lines somewhere before "GUI_InitContext" call...
bix64
Posts: 38
Joined: Mon Oct 17, 2005 6:40 am

Post by bix64 »

Thank you "BOSS".

That's why it doesn't work.

I've put this two lines at the top of GUI_Stub.c and now every think is OK.

I'm going to create some other skin with my own version of SMS cause the color of caracter in SMS flash a little bit to much with my skin.

I give you the file in next post.

Bye
bix64
Posts: 38
Joined: Mon Oct 17, 2005 6:40 am

Post by bix64 »

Hello

Here the file which contain GUI_Stub.c ( a very good code wrote by EEUG. ;) )
And a skin.bin file which contain a I-Frame extract from a avi file.

http://www.fileshack.us/files/131/SKIN.rar

I'm now working on a WIN tool which can extract I-Frame from avi file. ( With preview ;) )

Bye
Bix
bix64
Posts: 38
Joined: Mon Oct 17, 2005 6:40 am

Post by bix64 »

Re Hello,

Here 6 Skins extracted with my own version of SMS.

http://www.fileshack.us/files/131/6_SKIN.rar

See you.
bix64
Posts: 38
Joined: Mon Oct 17, 2005 6:40 am

Post by bix64 »

Other Note:

I didn't modified any other file of SMS 1.4 rev5, just GUI_Stub.c

Bye
Bixente
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...your pictures look quite cool, really :). I'll try to integrate skin support as soon as I'll have time for it. Just one remark: maybe it would be easier to make image converter instead of I-Frame extractor? I don't know the details, but I think it's quite easy. Win32 has quite rich API for bitmap processing (IPicture COM stuff, for example, to load jpeg/gif etc. images). So, the whole process would be just like "load bitmap -> use DivX/XviD codec ("encore" API?)" to generate I-Frame file. Maybe this will give you more information? Anyway, it's just a suggestion, if you don't feel like learning this stuff just forget about it.
Best regards
Eugene
bix64
Posts: 38
Joined: Mon Oct 17, 2005 6:40 am

Post by bix64 »

Hello EEUG,

Thanks for your link, very usefull.
I'm working with the help of VirtualDu* source code, and DX50 encoding.
I've got some "problems", but I think I'm on the right way.

That's not why, i send you this post.

A freind want to use his remote controle, so we search how-to, and find libpad and padman work whit official remote controle.
So we modified GUI.c to add support of pad 2 (without test for port 2).
Now 2 pads work and the remote controle work find, there is just a think : we can't push 2 buttons at the same time with RM, so init screen (pal, ntsc,...) , save config, reset, and power off, don't work with RM, but with pad.

We've test all possibility and it fill good.

Here the GUI.c modified file:

http://www.fileshack.us/files/131/GUI.rar

Bye
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

because rm doesn't support more than 1 button pressed, another way should be using the rmman iop driver but it needs to use xpadman to work togheter with pad,
so first you load ADDRV from rom0 then XPADMAN and RMMAN from rom1 then you need to link correct library and in this way you can use full remote control buttons, but there's still two problem
1-i don't know if it work with consoles that require dvd player update
2-rmman library isn't compatible with never builtin ir
you can use a newer remote control with older and new console using the rm adapter in it's full function (at least from the view of your software, but you can't eject or power off without a handmade implementation of them in older console)
bix64
Posts: 38
Joined: Mon Oct 17, 2005 6:40 am

Post by bix64 »

@weltall

I've worked a little bit on librm, and it's very complicate to add support of rmman in SMS, cause rmman don't work on the same way with all consol version.
So i've just add support of 2 pad, which meen, you can control SMS with pad 1 or pad 2, if you put an official RM instead of pad 2, that ok for navigate, playing, stopping, ... , SMS.
RM send 0 when we push 2 buttons, so RM can't use some fonctionnality of SMS, but pad 1 can.

That's all.
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

yeah that's why i left the idea of implementating it into ps2mp3...
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...new revision is in SVN. README contains explanations.
Best regards
Eugene
bix64
Posts: 38
Joined: Mon Oct 17, 2005 6:40 am

Post by bix64 »

Very GOOOOD job EEUG for forward/backward.

Here some skins:

http://www.fileshack.us/files/131/9_SKIN.rar

My prefered, the 6.


I'm still on my tool, but it's a little bit boring, I don't obtain the right format. :(


Something else, what do you think about drawing an other icon at the end of device section, witch permit to acces to a screen ( normal GUI ) with some option ( instead of file ), like, screen setting, ip setting, save conf, reset, poweroff. That allow people to do that with remote controle.

BEST BEST regards

Bye Bix
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...that would be the easiest way to implement the configuration screen (I think it's not the nicest one). Well, let's wait while "BraveDog" will implement a new font (from FNTIMAGE) drawing functions (it's almost done), so we can create fully functional setup screen with this new font (16x20), so it will be overlayed with browser :). I can't help you with the tool since I'm noob in that at the moment, so I should start from scratch anyway...
bix64
Posts: 38
Joined: Mon Oct 17, 2005 6:40 am

Post by bix64 »

No problem at all.

Thanks for all ( Yeah, I'm now in the README file ;) )

Bye
dlanor
Posts: 258
Joined: Thu Oct 28, 2004 6:28 pm
Location: Stockholm, Sweden

Post by dlanor »

All the new improvements to video rendering and the GUI are great, of course, but I've just noticed that something odd has happened to the sound. I haven't noticed it much in recent tests because I wasn't testing the sound, so having it low was what I wanted anyway to decrease distractions. But it is clear to me now that the sound level is much lower than it ought to be.

To hear what people are saying, in normal conversations of a movie, I have to turn up the TV volume control way beyond its normal settings. Then, if I play a game with those same settings, and an ingame conversation occurs that 'should' have similar volume to that of the movie, then the result will be deafening... I think that the recent SMS versions have lost appx 20 dB (just a rough guess) of sound level, as compared to some older versions.

I haven't saved copies of all old versions, so I'm not sure exactly when this happened, but it was after v1.4 Rev.2 which has good sound level, whereas v1.4 Rev.4 and later revisions all have too low levels.

Quite probably this is not due to any change in your own code, EEUG, but due to some change in the sound driver, so perhaps you should check that possibility first.

Best regards: dlanor
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

bix64 wrote:
Something else, what do you think about drawing an other icon at the end of device section, witch permit to acces to a screen ( normal GUI ) with some option ( instead of file ), like, screen setting, ip setting, save conf, reset, poweroff. That allow people to do that with remote controle.

BEST BEST regards

Bye Bix
could be good also a disable lan or use ps2link already installed lan.
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

@dlanor: maybe it's because volume control? (formely SMS set full sound at startup, now it's < 1/2 and it's adjustable via up/down buttons). Anyway, thanks for the remark, I'll try to check that...
dlanor
Posts: 258
Joined: Thu Oct 28, 2004 6:28 pm
Location: Stockholm, Sweden

Post by dlanor »

EEUG wrote:@dlanor: maybe it's because volume control? (formely SMS set full sound at startup, now it's < 1/2 and it's adjustable via up/down buttons).
You're right that this was my main 'problem'. When I boost the internal volume gauge of SMS to nearly its maximum, I get what I consider a 'normal' level (appx). However, to get the maximum usefulness out of this control, it really needs to be centered at a level that corresponds to average levels produced by most games at default settings. Otherwise most of the range of that control will be wasted, producing sound levels so near silent as to be useless (except near the top end).

I realize that there is no absolute standard for these things, but I still think the level needs to be raised a bit.

Btw:
I second the motion bix64 made, for adding a 'dummy' device icon to the GUI, and using this to enter a setup screen of some kind. As SMS continues to grow in capabilities and complexity, users will need some way to check on current settings, and to change them without relying entirely on their memory of the button combos needed. Such a setup screen could not only contain the major settings as adjustable numbers, but also provide a simple means of bringing up a help text for the button combos. That feature alone might eliminate lots of redundant questions both here and in other forums.

Best regards: dlanor
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...yes, sound stuff is quite difficult as there're no documentation about SPU2 unit. Maybe this could be solved by adjusting signal magnitude inside MP3 decoder (same way as in AC3), but I don't know at the moment how to do that :(. Setup screen is definitely needed. I'll try to implement it one day (or, maybe, someone else will try to do it ? ;)). Just hold on some days till I'll make some demo proggy to show the new font, so, again, democracy can help to make a choice :)...
bix64
Posts: 38
Joined: Mon Oct 17, 2005 6:40 am

Post by bix64 »

Hello

EEUG, what is the icon format ? How-to obtain it ?
unsigned char g_Img[ 9216 ] __attribute__( ( aligned( 16 ) ) ) for 48*48 ?
unsigned char g_Img[ 4096 ] __attribute__( ( aligned( 16 ) ) ) for 16*16 ?
I read in GUI_data.c, Icon design: (c) David Vignoni, but in his web site, I didn't find anything.
Had he created icon for you ? or had you done it ?

I know I ask a lot of questions!!! ;) Sorry to be curious. ;)

Bye

Bixente
Post Reply