Announcing SMS project

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

Moderators: cheriff, Herben

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

Announcing SMS project

Post by EEUG »

Features:
- PS2 optimized DivX/XviD decoder;
- MP3 decoder;
- File system on audio CD;
etc.

Refer CVS (README file) for details.
Regards to all
EEUG
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post by pixel »

Glad you finally put it up :)

And again, very, very nice work.
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Duncan Idaho
Posts: 1
Joined: Fri Jun 10, 2005 11:58 am

Simple Media System... Not so simple

Post by Duncan Idaho »

I've tried it but couldn't manage to read a single divX on my PS2. I Hope A tutorial will soon come.

Nevertheless, this seems to be very great if it works ! I've been waiting for such a tool for very long now ;)
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

. . .well, everything is written in README ;). There's a 'bin' directory in CVS with CDXplorer.exe. Use it to make cue/bin. Burn a CD. Change filename in 'main.c'. There's also 'aursrv.irx'. Change SPU.c if you want to load it from a different location. Yet again, I've only tried this on my PS2 (SCPH-30000R PAL). It works also on Windows, so you can try to debug it there :o). SMS is not a final product yet. At the moment it oriented to programmers rather than users. Use e-mail if you want more details. I'll try to answer all questions.
Best regards,
Eugene
zerocom
Posts: 12
Joined: Tue Jun 08, 2004 7:45 am

Post by zerocom »

Great work EEBUG....

What about VCD/SVCD/DVD support using libps2mpeg2? I'm willing to help integrate it.
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...I think that before making any "integrations" etc. we have to see if the existing stuff works elsewhere. Second, we have to decide: what it's going to be? Will it be just a library or a product? At the current state whole SMS looks more like a library which has been tested only on my PS2. So, first, I'd like to know if someone else succeeded to run it with any results. If results will be positive than it makes sense to continue with it. If not then there're two ways: a). Forget about it. b). Fix it and decide what to do further. Point ;)
Regards
Eugene
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

is it possible to use a DVD in place of an audio cd with the current bin/cue creator (ie "audio" dvd)? Or would that require alot of changes and using dvd video format to store data instead?

I hate the noise my ps2 makes with cds, I doubt I could watch 600mb of xvid with that noise going (think chalkboard+fingernails), but for test purposes I am willing to use up a cd and suffer for a few minutes.

Just out of curiosity, is the app region coded (ntsc/pal) or is it using the new stuff in the sdk that doesn't care/is automatic?

Thanks for the new vid cvs stuff though EEG, PS2 has been lacking somewhat in players that are full source...
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

1. no. Only CD at the moment ;);
2. no. Source code modifications are required to change PAL/NTSC
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

so

Code: Select all

GSContext* GS_InitContext ( GSDisplayMode aMode )
(in GS.c) isnt going to automatically set it to pal/ntsc? Where o where then is aMode set? Or is it relative to the type of video on the disk?
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...look at the occurences of the following line:

Code: Select all

GSContext* lpGSCtx = GS_InitContext ( GSDisplayMode_PAL_I );
...and replace it, for example, by:

Code: Select all

GSContext* lpGSCtx = GS_InitContext ( GSDisplayMode_NTSC_I );
or

Code: Select all

GSContext* lpGSCtx = GS_InitContext ( GSDisplayMode_NTSC );
good luck ;)
[/code]
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

Thanks EEUG, I will get back to you tommorow morning with the results, btw as far as I can tell (without testing the resulting elf) it compiles fine under debian with 1 change in the make file:

Code: Select all

clean:
	del *.elf *.o *.a
to

Code: Select all

clean:
	rm -f *.elf *.o *.a
:D
blender
Posts: 1
Joined: Fri Apr 01, 2005 3:19 am

Just an Idea

Post by blender »

Do you want to know what i'm dreaming for ?

Just a way for playing DivX on USBmass like PS2Mp3SE plays mp3.

If you integrate this function to your SMS... you will be my Jesus or Moise or Allah or just a man... but a very great coder. ;)

Greetings for your SMS. See you.
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

EEUG, couldnt get it done and have no more time with the comp today, will recompile and try tomorrow on NTSC with changes you suggested above (at least, I think I have a good disk burned for it at any rate - took me a while to find a decent xvid for it as I didnt want to reenc anything)
dlanor
Posts: 258
Joined: Thu Oct 28, 2004 6:28 pm
Location: Stockholm, Sweden

Post by dlanor »

EEUG wrote:...I think that before making any "integrations" etc. we have to see if the existing stuff works elsewhere. Second, we have to decide: what it's going to be? Will it be just a library or a product?
Since you seem open to both options, I suggest we keep it so. We don't have to choose just one of them. A product is definitely motivated, as no really versatile open source media player exists for the PS2 at present. A lib on the other hand is also strongly motivated, as it allows others to use the same display routines for other purposes than a dedicated media player. (eg: File managers with display capability.)

Edit: What I really meant to suggest here is that we do make a lib, but also make a good media player as the 'example' application for the lib. And come to think of it, there really should be two libs here. One for XviD/DivX playing, and another for generic CDDAFS support. Having CDDAFS work only in a single media player would be a great waste, as it would be a good format for many other purposes too.
At the current state whole SMS looks more like a library which has been tested only on my PS2. So, first, I'd like to know if someone else succeeded to run it with any results. If results will be positive than it makes sense to continue with it. If not then there're two ways: a). Forget about it. b). Fix it and decide what to do further. Point ;)
I have successfully used it, and have also recompiled it with some changes to make it independent of 'host:' (embedded audsrv.irx). In this form I tested it from MC, HDD, and USB (all via LaunchELF). I did have some 'glitches' and 'lockups' with some videos, but I suspect this says more about the dying laser of my PS2 than it does about your program...

As for the project's future, that remains to be seen, but it should most definitely HAVE a future, there's no doubt about that.

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

Post by EEUG »

...OK, thank you for having interest.
...I did have some 'glitches' and 'lockups' with some videos, but I suspect this says more about the dying laser of my PS2 than it does about your program...
These "glitches" and "lockups" are most probably due to the bugs in ring buffers in SMS_AVIPlayer.c :) (I've made that stuff very quickly without proper testing, so I saw that on some videos it crashes). I didn't have much time these days to fix it. I hope that I'll fix it next week. There's another problem with audio preload in videos that have something I don't know yet (VirtualDub says that there's "improper VBR audio encoding in source AVI..."). I'll contact you later (It's quite busy at work these days) to discuss the things. Thank you.
Best regards
Eugene
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

using this line in roughly 3 places in main.c: (to others, it was easiest to search for PAL in the code)

Code: Select all

GSContext* lpGSCtx = GS_InitContext ( GSDisplayMode_NTSC_I );
here is my results,
video and audio were out of sync, but did not crash - out of sync meaning at one point the vid was going double time, and the audio was about 1/2 time, then they seemed to sync up and go normal together for about 1 sec of every 10, and go opposite (vid slow audio fast).

the black bars were actually blue (top and bottom of a letterbox playing WS format vid)

The drive did not screek like it does when reading other cd's, I have not tried regular CDDA disks to find out (use an xbox for mp3 and cd player mostly)

Nice work EEUG, it took very few changes to get it to work on the NTSC V5 I have here, and I suspect that if I used a different/better video encode it would work flawlessly with it. I am impressed, for whatever thats worth.

the info on the vid I tested since I have it handy
(a hdtv rip from satellite of a smallville episode I missed)
Video : XviD at 983 kbps
Audio : MP3 128kbps 2ch 48khz
Aspect Ratio : 16:9
Resolution : 624x352
Frame Rate : 23.976024 fps
Byte Size : 364,462,080
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...OK, thank you too. Blue bars are "by design" at the moment ;). This is far not a player yet. A/V sync is not implemented (this is, actually quite a work that requires an experience of some AVI experts (I'm not the one) (especially for VBR audio)). I hope that someone will take care about it :P.
I really, really can't do all that alone :(...
Best regards,
Eugene
Steve F
Posts: 75
Joined: Wed Apr 27, 2005 2:30 am
Location: Texas USA

Post by Steve F »

How did you implement the 'blue bars' and 16:9 screen format? I looked through gs.c, main.c and sms_avi.c but didn't see anything I could recognize as code for setting 'letter box' type screen.
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...well, blue bars is just a result of 'ClearScreen' call to the GS. Look for this call and change blue color to whatever you like. Current implementation displays a movie in the original format (maintaining aspect ratio). If you want to crop it (or resize) take a look at 'IPU_InitContext' function. Image on screen is a textured sprite. So it's quite easy to adjust output by playing with texture UV coordinates and sprite coordinates. Perhaps, it would be nice to add a parameter block to argument list of 'IPU_InitContext' which configures display parameters in more advanced ways (display movie in a small "window", for example :)). Currently there're only width and height of the original picture. Note, that it's possible to draw anything else at the same time, BUT there're two things: call 'Sync' method of 'IPUContext' before performing your drawing and call 'SetTEX' method after your drawing if it changes TEX0/TEX1 registers of the GS ('DrawText', for example, does).
Best reagrds,
Eugene
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...I've made some changes. Now it's seems to be possible to load files from alternate locations (STIO_XXX routines: they call 'fileio' routines from 'ps2sdk'). In my configuration I've played the movie from 'host:' (I don't have 'pfs0:' (anybody who has it can test this functionality. Use 'STIO_InitFileContext' instead of 'CDDA_InitFileContext'))).
Some bugs are fixed also (I hope so :)).
Good luck
Eugene
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...new project structure, HDD support etc. Refer README for details...
Regards
Eugene
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Wow! You've really been working on this. Sorry I haven't been more of a help... been busy. I'm sure you know what that's like. :) I'm getting the latest code. I'll have to give it a try.

Edit: Wow! Again! I can't believe how much you've done. I compiled it just fine. I changed the test filespec to "host:test.avi" and put an anime music video in the bin directory. Here's a few observations:

- I forgot to change all the PAL constants. Luckily I have my PS2 hooked to a multimedia monitor. I plan to make sure SMS supports all different modes, including VGA modes. I switched it to NTSC and tried again. Both seem to work fine.

- It seems to pause every minute or so to refill the buffers. That really needs to be double-buffered and asynchronous to the main task. Maybe I'll look into that.

- You're definitely not synced to the vertical blank. You can see tearing as it updates, but it's not bad. The regular FFMPEG player has this problem as well.

- Your font kerning is a little off. "i" and "l" are particularly bad, being squashed together.

It's really coming along though. A little more work and it'll be better than PS2Reality. :D
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...thanks for trying :). I've already made NTSC/PAL region recognition (copied from ps2sdk:)) (this is not in the CVS yet). Well, the code actually does use doublebuffer and async I/O. Here not much I can do (data consumed by decoders faster than data supplied by I/O interface). Yes, the drawing is not VBlank synchronized (it's quite easy to implement, but I think it is not an issue now). Same for font. Now I'm trying to play with A/V sync.
Best regards
Eugene
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

EEUG wrote:...thanks for trying :). I've already made NTSC/PAL region recognition (copied from ps2sdk:)) (this is not in the CVS yet). Well, the code actually does use doublebuffer and async I/O. Here not much I can do (data consumed by decoders faster than data supplied by I/O interface). Yes, the drawing is not VBlank synchronized (it's quite easy to implement, but I think it is not an issue now). Same for font. Now I'm trying to play with A/V sync.
Best regards
Eugene
I'm not worried by the font or vsync. The data buffering is a little more interesting. I should check it out. The data isn't being consumed faster than the ethernet can supply - it's idle most of the time. The ethernet won't be doing anything, then the video and audio pauses for a few seconds while data is fetched. The ethernet goes idle again and the video and audio plays for about a minute, then pauses as more data is loaded. Maybe there is a priority issue between the player and the ethernet driver.
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...here're some pointers :): all I/O code resides inside FileContext.c. Threr're two API there: one is for CD I/O (these CDDA_XXX routines) and another one is a "standard" I/O (STIO_XXX). CD I/O operates with raw sectors. Standard I/O uses fileXio from ps2sdk. Threre's a 'Stream' method of 'FileContext' "class" which makes doublebuffer. Last parameter of this method is a doublebuffer size (number of sectors (2352 bytes) for CD I/O and number of blocks (4096 bytes) for "standard" I/O). The whole process looks like this:
1. Call 'Stream' method. Doublebuffer is created. First buffer is filled with data. Async read call is issued to fill the second buffer.
2. Call 'Read'. If there's enough data in the first buffer then get data from it and return else wait for I/O completion, get data, issue async read and return.
3. Repeat 2 until EOF or 'Stream' call with last parameter set to '0' (stop streaming).
This FileContext.c is almost standalone entity, so you can make just a small test program to try it ;).
Best regards
Eugene
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Thanks. I was going to ask about that. I had already discovered it was all in FileContext.c, but wasn't certain about particulars.

I'll play around with the code I have now until I figure out why it isn't streaming across the net like it should, then let you know what I found.
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...new "service pack" ;) is available (README)...
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...well, I've finally got a new version with GUI working. Just a simple filebrowser (HDD (with partition browsing - no more hardcoded names) and CDDAFS are supported) and pause/stop functionality were added. I'll commit it to C...eh...SVN as soon as I'll get an acconut to access SVN. Stay tuned ;).
Best regards
Eugene
strikeuk
Posts: 4
Joined: Thu Jul 14, 2005 7:01 pm

Post by strikeuk »

Nice! much progress has been made in just over a month, i tried messing around with the pause function on the previous version but it obviously didn't work as well as i expected. Great work
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...thanks. Btw., you can try a new version (I've built it by demand yesterday, it's shared by someone who asked me) http://rapidshare.de/files/3032631/SMS.elf.html
. This is from README that will be available as soon as SVN/CVS will work:
Short manual:
- SMS screen is divided in 3 areas: device menu at the top, file menu in the middle and
status line at the bottom;
- each area is bounded by a red rectangle with round corners;
- device menu and file menu can be activated;
- active menu is bounded by a white rectangle;
- device menu is navigated by "left" and "right" pad buttons;
- "down" pad button switches from device menu to the file menu;
- file menu is navigated by "up" and "down" pad buttons;
- "left" or "right" pad button switches from file menu to the device menu;
- active item in both menus is highlighted by semitransparent rectangle;
- selection is made by pressing "cross" pad button;
- "triangle" pad button navigates one level up (directory->parent directory->partition list)
in the file menu;
- menu items with different contexts (file/directory/partition) are represented by
different icons;
- CDDAFS disks are recognized automatially (just insert it and wait for a while);
- during playback use "select" pad button to pause, "start" to resume and "triangle"
to stop and return to the filebrowser;
- press "select" and "circle" pad buttons in the filebrowser to switch PS2 off;
That's it. Note, that during that "harsh stop action" no IOP reset, program restart etc.
is performed. So, memory and other resource leaks etc. are possible (I've tried to be
as accurate as possible but who knows ). No USB mass-stoarge device support, since my
only USB memory stick doesn't work with ps2sdk tests. Note also, that I've changed that
magic MAGV, MAGH and other numbers in GS.c to get nice aligned picture on my TV and TV
tuner card (SMS in NTSC mode also works there). So, if anyone has a problems with improperly
aligned picture - just play around with these numbers.
I didn't tested it well (no time), but from the first sight it works (I'm using ps2link to launch it).
Best regards
Eugene
Post Reply