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 

Problem with screen when run .elf

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



Joined: 09 Apr 2006
Posts: 15

PostPosted: Sat Apr 15, 2006 8:04 pm    Post subject: Problem with screen when run .elf Reply with quote

Hello
I compile my own program use SDL already and have .elf file.
When i run program by InLink v1.3.7 then screen (on TV) is crash. What's happened ? Please suggest me.
best regards
wing64

SourceCode Program
Code:

#include <stdio.h>
#include "SDL.h"

int main(int argc, char *argv[])
{
   SDL_Surface *screen;

   /* Initialize SDL (Note: video is required to start event loop) */
   if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0 ) {
      printf("Couldn't initialize SDL: %s\n",SDL_GetError());
      exit(1);
   }

   /* Set a video mode to display joystick axis position */
   screen = SDL_SetVideoMode(640, 480, 16, SDL_SWSURFACE);
   if ( screen == NULL ) {
      printf("Couldn't set video mode: %s\n",SDL_GetError());
      return 0;
   }

   while( 1 )
   {
         SDL_FillRect(screen, NULL, 0);
         SDL_Flip(screen );
   }

   return 0;
}


Inlink v1.3.7 message
Code:

[NET] : Executing host:C:\cygwin\home\test100\test200.elf ...
Setting Curent Directory to C:\cygwin\home\test100\.
Executing Elf host:C:\cygwin\home\test100\test200.elf...
loadelf: fname host:C:\cygwin\home\test100\test200.elf secname all
loadelf version 3.30
Input ELF format filename = host:C:\cygwin\home\test100\test200.elf
0 00100000 000440d4 .....
Loaded, host:C:\cygwin\home\test100\test200.elf
start address 0x1000e0
gp address 00000000
[NET] : Sent test200.elf at 560KB/s
SDL: initializing gsKit in NTSC mode
SDL_Joystick: JoystickInit begins
loadmodule: fname rom0:XSIO2MAN args 0 arg
loadmodule: id 28, ret 0
loadmodule: fname rom0:XPADMAN args 0 arg
Pad Driver for OSD (2000/12/05 18:05) 392, 128
loadmodule: id 29, ret 0
loadmodule: fname rom0:XMTAPMAN args 0 arg
loadmodule: id 30, ret 0
SDL_Joystick: padInit: 0
SDL_Joystick: mtapInit: 1
SDL_Joystick: numports 2

SDL_Joystick: Port: 0  mtapPortOpen: 1
SDL_Joystick: Port: 0  mtapGetConnection: 0
SDL_Joystick: Port 0, MaxSlots: 1
SDL_Joystick: pad (0,0) is in state EXECCMD
SDL_Joystick: pad (0,0) is in state ERROR
SDL_Joystick: pad (0,0) is in state EXECCMD
SDL_Joystick: pad (0,0) is in state ERROR
SDL_Joystick: pad (0,0) is in state EXECCMD
SDL_Joystick: digital pad detected
JoystickInit: Request received
SDL_Joystick: pad (0,0) is in state EXECCMD
Joystick 0 at port=0 slot=0

SDL_Joystick: Port: 1  mtapPortOpen: 1
SDL_Joystick: Port: 1  mtapGetConnection: 0
SDL_Joystick: Port 1, MaxSlots: 1
SDL_Joystick: pad (1,0) is in state EXECCMD
SDL_Joystick: pad (1,0) is in state ERROR
SDL_Joystick: pad (1,0) is in state DISCONNECT
waited too long! giving up
SDL_Joystick: JoystickInit ends with 1 joysticks
SDL_SetVideoMode 640 x 480 x 16
SDL_Video: local texture allocated at 0x00294850
SDL_video: centered surface of (640, 480) onto a screen of (640, 448) at (21, 0)
SDL_video: ratio of 1:0.933, rastered surface is (597, 448)

_________________
kjdflkdfdfsdf
Back to top
View user's profile Send private message
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Sat Apr 15, 2006 9:08 pm    Post subject: Reply with quote

Don't use Inlink. It is old, outdated, buggy, and does not work correctly with a recent versions of PS2Link.

You also to to clarify "screen (on TV) is crash" and give more information. If you mean there is a lot of white text on the screen, it sounds like the exception handler, and there is a ton of useful information on the screen.
_________________
Shoot Pixels Not People!
Makeshift Development
Back to top
View user's profile Send private message Visit poster's website
wing64



Joined: 09 Apr 2006
Posts: 15

PostPosted: Sun Apr 16, 2006 3:47 pm    Post subject: screen image problem Reply with quote

Hello
First image is run .elf on InLink.



Second image is run .elf on Ps2Link.



I don't understand this problem with SDL lib or PS2SDK or GSKit. Please help..

best regards
wing64
_________________
kjdflkdfdfsdf
Back to top
View user's profile Send private message
wing64



Joined: 09 Apr 2006
Posts: 15

PostPosted: Mon Apr 17, 2006 1:03 pm    Post subject: Reply with quote

Hello
I don't know this's correct. I add this code to function PS2_UpdateRects() before call gsKit_sync_flip(gsGlobal); in SDL_ps2video.c then it work fine

Code:
/* execute render queue */
gsKit_queue_exec(gsGlobal);


but when run my screen have a black rectangle in left screen (see image below). What's black rectangle ? And how do i fix it ?



And when i init SDL by SDL_Init(SDL_INIT_TIMER |SDL_INIT_VIDEO | SDL_INIT_JOYSTICK ) it work ok but when i add flags SDL_INIT_AUDIO program will freeze at SDL: initializing gsKit in NTSC.
What happend with my program ? Please suggest me.

best regards
wing64
_________________
kjdflkdfdfsdf
Back to top
View user's profile Send private message
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Mon Apr 17, 2006 4:53 pm    Post subject: Reply with quote

Oy... oh yes... that is right..
GSKIT had some MAJOR changes, including some API changes, and AFAIK SDL has not been updated to work with the new GSKIT.
_________________
Shoot Pixels Not People!
Makeshift Development
Back to top
View user's profile Send private message Visit poster's website
evilo



Joined: 22 Apr 2004
Posts: 230

PostPosted: Mon Apr 17, 2006 8:30 pm    Post subject: Reply with quote

damn... yes... and this gonna be a problem if people want to enter the competition using SDL on PS2 ...

is the rigth (I mean the old one needed for SDL) version of gsKit tagged in SVN ??

wing64, you can try with my compiled version of SDL that should use the *old* gsKit 0.2 : http://psxdev.info/evilo/download/ps2_sdl_gsKit02.zip

I hope it will help you :)

[EDIT] also, 640x480x32 mode is causing pb with SDL on PS2, so try to avoid using it, if possible.


Last edited by evilo on Tue Apr 18, 2006 10:52 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Mon Apr 17, 2006 9:45 pm    Post subject: Reply with quote

GSKIT isn't tagged per se... However you can specify the revision to checkout with the -r option. (i.e. 'svn checkout -r 1258 ...')

The version I have saved and am using (I have numerous things that would break with new gskit I didn't want to bother fixing) seems to be based on 1258, which does seem to be the last revision before the changes that break SDL.

There are numerous bugs in revision 1258 of course, including startx/y being known to be off.
_________________
Shoot Pixels Not People!
Makeshift Development
Back to top
View user's profile Send private message Visit poster's website
wing64



Joined: 09 Apr 2006
Posts: 15

PostPosted: Tue Apr 18, 2006 10:44 pm    Post subject: Reply with quote

Thank you very much. It's work.
best regards.
wing64
_________________
kjdflkdfdfsdf
Back to top
View user's profile Send private message
wing64



Joined: 09 Apr 2006
Posts: 15

PostPosted: Tue Apr 18, 2006 11:32 pm    Post subject: Reply with quote

Hello
But when i set SDL_INIT_AUDIO flag in function SDL_Init() program will freeze and any flag SDL_INIT_TIMER , SDL_INIT_VIDEO , SDL_INIT_JOYSTICK it work fine. What's happened in my SDL lib ? :-(
beset regards
wing 64
_________________
kjdflkdfdfsdf
Back to top
View user's profile Send private message
evilo



Joined: 22 Apr 2004
Posts: 230

PostPosted: Wed Apr 19, 2006 12:38 am    Post subject: Reply with quote

Hi,

Which PS2 model do you own ? JAP one ?

have you defined a SDL_main ?
Back to top
View user's profile Send private message Visit poster's website
wing64



Joined: 09 Apr 2006
Posts: 15

PostPosted: Thu Apr 20, 2006 2:41 pm    Post subject: Reply with quote

Hi
- PSTwo model 70006 cb (NTSC/J)
- i define SDL_Main already and add sdl_main.a in EE_LIBS flags but it not work program freeze at SDL: initializing gsKit in NTSC mode (see message from inlink below)

Code:
[NET] : Executing host:C:\cygwin\home\m13sdl101\sources\m13sdl101.elf ...
Setting Curent Directory to C:\cygwin\home\m13sdl101\sources\.
Executing Elf host:C:\cygwin\home\m13sdl101\sources\m13sdl101.elf...
loadelf: fname host:C:\cygwin\home\m13sdl101\sources\m13sdl101.elf secname all
loadelf version 3.30
Input ELF format filename = host:C:\cygwin\home\m13sdl101\sources\m13sdl101.elf
0 00100000 000c025c .............
Loaded, host:C:\cygwin\home\m13sdl101\sources\m13sdl101.elf
start address 0x1000e0
gp address 00000000
[NET] : Sent m13sdl101.elf at 610KB/s
SDL: initializing gsKit in NTSC mode

best regards
wing64
_________________
kjdflkdfdfsdf
Back to top
View user's profile Send private message
wing64



Joined: 09 Apr 2006
Posts: 15

PostPosted: Thu Apr 20, 2006 2:54 pm    Post subject: Reply with quote

Hi
I trace SDL and found error at SDL_ps2audio.c in function spu2_init() when call audsrv_init() my program freeze in this function. So..How should i do fix it ?
best regards
wing64
_________________
kjdflkdfdfsdf
Back to top
View user's profile Send private message
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Thu Apr 20, 2006 2:58 pm    Post subject: Reply with quote

As I said earlier, don't use inlink. Seriously. It doesn't work correctly with any remotely modern versions of ps2link. While I can't say for sure it is causing a problem here, I do seem to remember people having problems with the elf getting corrupted in transfer when using inlink, which can cause all sorts of randomish crashes and glitches that will send people spinning for days on end until they reailze the elf is being corrupted.

So grab a copy of ps2client (or pksh should be up to date as well.. there might another couple PC side clients, I don't track them anymore) and check out the situation with that.
_________________
Shoot Pixels Not People!
Makeshift Development
Back to top
View user's profile Send private message Visit poster's website
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Thu Apr 20, 2006 3:03 pm    Post subject: Reply with quote

IIRC SDL has a build option for using freesd.
Make sure to build SDL with and use freesd ... libsd is horribly buggy, and there are different versions of it on different ps2s that have their own brokeness.
_________________
Shoot Pixels Not People!
Makeshift Development
Back to top
View user's profile Send private message Visit poster's website
wing64



Joined: 09 Apr 2006
Posts: 15

PostPosted: Thu Apr 20, 2006 5:49 pm    Post subject: Reply with quote

Hi
1. Now... SDL_INIT_AUDIO work ok. When program load my own sound (001.wav) ps2client said load successed (see message below) but sound not going out (i set volume to MIX_MAX_VOLUME by function Mix_Volume and Mix_VolumeMusic but i can't here any sound). How do i ?
2. How do i play mp3 , ogg and midi on SDL_Mixer (i download from web svn://svn.ps2dev.org/ps2/trunks/ps2sdk-ports) ?

Code:

$ make run
ps2client execee host:tester.elf
loadelf: fname host:tester.elf secname all
loadelf version 3.30
Input ELF format filename = host:tester.elf
0 00100000 0009c37c ..........
Loaded, host:tester.elf
start address 0x1000e0
gp address 00000000
Initialize the sdl library.
SDL: initializing gsKit in NTSC mode
loadmodule: fname rom0:LIBSD args 0 arg
loadmodule: id 33, ret 0
loadbuffer: addrres 55b00 args 0 arg
audsrv: greetings from version 0.90 !
audsrv_adpcm_init()
audsrv: rpc server thread 0x97b925 started
audsrv: creating rpc server
loadbuffer: id 34, ret 0
audsrv: sceSdInit(SD_INIT_COLD)
audsrv: sceSdInit(SD_INIT_COLD) OK
audsrv: transfer_sema = CreateMutex(0)
audsrv: transfer_sema = CreateMutex(0) OK
audsrv: queue_sema = CreateMutex(0);
audsrv: queue_sema = CreateMutex(0); OK
audsrv: freq 48000 bits 16 channels 2 ringbuf_sz 20480 feed_size 2048 shift 2
audsrv: play_tid = create_thread(play_thread, 39, 0);
starting play thread
audsrv: playing thread 0x97a027 started
audsrv: play_tid = create_thread(play_thread, 39, 0); OK
audsrv: kickstarted
Initialize the sdl library OK.
SDL_SetVideoMode 640 x 480 x 16
SDL_Video: local texture allocated at 0x002c16e0
SDL_video: centered surface of (640, 480) onto a screen of (640, 448) at (21, 0)

SDL_video: ratio of 1:0.933, rastered surface is (597, 448)
Loading audio
audsrv: freq 22050 bits 16 channels 2 ringbuf_sz 9400 feed_size 940 shift 2
SDL_SYS_CreateThread
SDL_SYS_CreateThread ends successfully
Thread started
Loading audio OK
open name host:001.wav flag 1 data 44078
open fd = 2
open name host:001.wav flag 1 data 44078
open fd = 2
Playing music...
Playing music...OK
open name host:media/image.jpg flag 1 data 44078
open fd = 3


best regards
wing 64
_________________
kjdflkdfdfsdf
Back to top
View user's profile Send private message
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Thu Apr 20, 2006 5:59 pm    Post subject: Reply with quote

Was the problem inlink then?
_________________
Shoot Pixels Not People!
Makeshift Development
Back to top
View user's profile Send private message Visit poster's website
wing64



Joined: 09 Apr 2006
Posts: 15

PostPosted: Thu Apr 20, 2006 6:21 pm    Post subject: Reply with quote

Hi
Inlink and ps2ling both work fine (for init audio system only) but load sound i have a problem (see question above post)
best regards
wing64
_________________
kjdflkdfdfsdf
Back to top
View user's profile Send private message
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Thu Apr 20, 2006 7:00 pm    Post subject: Reply with quote

I was asking about the problem with it locking up during init... from what your next post said I can see you switched to ps2client, and it loaded and ran correctly. If using inlink as the PC side client was indeed the cause of the problem I would like to know about it.
_________________
Shoot Pixels Not People!
Makeshift Development
Back to top
View user's profile Send private message Visit poster's website
wing64



Joined: 09 Apr 2006
Posts: 15

PostPosted: Fri Apr 21, 2006 5:49 pm    Post subject: Reply with quote

Inlink said message in status bar tranfering file 001.wav at 0% then i wait about 5 minute inlink not tranfer 001.wav file. What happen i don't understand ?


_________________
kjdflkdfdfsdf


Last edited by wing64 on Fri Apr 21, 2006 6:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Fri Apr 21, 2006 6:39 pm    Post subject: Reply with quote

What happened is that inlink is broken. Don't use it.

I have no idea what is wrong with your audio code TBH. Though I wouldn't be surprised if it's a problem with LIBSD being buggy.
_________________
Shoot Pixels Not People!
Makeshift Development
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 -> PS2 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