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 

preview of my project

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



Joined: 25 Sep 2007
Posts: 48
Location: London

PostPosted: Mon Apr 28, 2008 10:46 pm    Post subject: preview of my project Reply with quote

I've been working for a few weeks now on a project about mixing video loops via the playstation 2.

So far, just the very basic function is completed: loading and displaying 4 video loops. Files are loaded from the USB storage, and it's very slow, I need to investigate into it!

a screenshot:


a video of the software running can be seen here:
http://pikilipita.com/vj/future/

I hope I'll be able to have a public presentation in a London club on 10th of May at:
Soxan party, the Big Chill House, King's Cross, London, UK !!

If you're London based, come and visit me at this event :)
_________________
softwares for artists on video game systems - http://www.pikilipita.com
Back to top
View user's profile Send private message Visit poster's website
Lukasz



Joined: 19 Jan 2004
Posts: 248
Location: Denmark

PostPosted: Mon Apr 28, 2008 11:54 pm    Post subject: Reply with quote

Nice to see new PS2 stuff, although a bit different from what we normally see :-)

I'm not familiar with the code for usbd and usb_mass, but usually when reading from I/O it best to do so in as large blocks as the hardware supports.

So if you are try to read for instance 4 bytes at a time in a loop, this will be much slower than just reading one big chuck. This is because it takes a long time (compared to a instruction cycle) to access the hardware, so you want to read/write as much data as possible for each I/O access.

Another thing to remember is that PS2 only has USB 1.1.
_________________
Lukasz.dk
Back to top
View user's profile Send private message Visit poster's website
kouky



Joined: 25 Sep 2007
Posts: 48
Location: London

PostPosted: Wed Apr 30, 2008 11:59 pm    Post subject: Reply with quote

Unfortunately, thtat exactly what I'm doing : loading one bit at a time in a loop...
I've been able to regroup some loading together to speed up a little bit the processus, but it's still slow...
_________________
softwares for artists on video game systems - http://www.pikilipita.com
Back to top
View user's profile Send private message Visit poster's website
Lukasz



Joined: 19 Jan 2004
Posts: 248
Location: Denmark

PostPosted: Thu May 01, 2008 5:44 am    Post subject: Reply with quote

If you need to transform the data as you load it and you therefor load 1 byte at a time, then I recommend loading the entire file into a memory buffer B with one read and then load the data from B and transform it. Eg. use memory as temporary buffer/cache.

I did this with the Doom port, the loading from host: went from minutes to a few seconds. It gave a ~100x speed or atleast that's what it felt like. :-)
_________________
Lukasz.dk
Back to top
View user's profile Send private message Visit poster's website
kouky



Joined: 25 Sep 2007
Posts: 48
Location: London

PostPosted: Thu May 01, 2008 5:55 am    Post subject: Reply with quote

Yeah, I thought about this solution but didn't liked the idea of having a buffer between 1 to 3 megs, but I guess I'll have to do it anyway.
What the function to know the size of a file?

The project is going pretty well, my last bug issue is I can't find a way to display and browse my USB stick folders via my software.

Which are the best examples/sources to look at?
( I launch my software using uLaunchElf, ny software is stored on the USB drive and the data I want to broswe is on this same usb drive)
_________________
softwares for artists on video game systems - http://www.pikilipita.com
Back to top
View user's profile Send private message Visit poster's website
Lukasz



Joined: 19 Jan 2004
Posts: 248
Location: Denmark

PostPosted: Thu May 01, 2008 6:02 am    Post subject: Reply with quote

To know the size of a file you need to use fseek(fd, 0, SEEK_END) and then use ftell()

http://www.cplusplus.com/reference/clibrary/cstdio/ftell.html

For loading from USB drive have a look at usb_mass and the included example.

Code:
svn co svn://svn.ps2dev.org/ps2/trunk/usb_mass

_________________
Lukasz.dk
Back to top
View user's profile Send private message Visit poster's website
kouky



Joined: 25 Sep 2007
Posts: 48
Location: London

PostPosted: Sat May 03, 2008 8:49 am    Post subject: Reply with quote

Thanks Lukasz,

the loading is much faster now!
But loading the complete file in one time freezes the whole software for a few seconds (as seen in the new video). I'm considering loading files in 5 or 10 parts.

The project is going really well, almost ready for a gig.

a new screenshot:


and a new preview video , showing the concept of video grid!

Watch the preview #2 from here:
http://pikilipita.com/vj/future/index.html

Questyion: is there a way to know how much RAM is still available while the software is running?
something simple like: u64 freeRAM= memoryAvailable(); ???
_________________
softwares for artists on video game systems - http://www.pikilipita.com
Back to top
View user's profile Send private message Visit poster's website
Lukasz



Joined: 19 Jan 2004
Posts: 248
Location: Denmark

PostPosted: Sat May 03, 2008 6:15 pm    Post subject: Reply with quote

kouky wrote:

Questyion: is there a way to know how much RAM is still available while the software is running?
something simple like: u64 freeRAM= memoryAvailable(); ???


I had a look inside malloc.c in PS2SDK and it does not keep track of how much memory has been allocated and freeed, so you need to keep track of this yourself.

Your program (ELF) along with the stack will most likely not take up more than 1 MB of memory and the EE kernel sits in the first 1 MB of memory, so I think it's safe to assume that you have 32 - 2 = 30 MB of memory which you can malloc.

I made a small HeapSize() function which tells you exactly how much memory you can avaliable before the first malloc of your program, eg. size of the heap.

Code:
#include <tamtypes.h>
#include <kernel.h>
#include <stdio.h>

extern void * _end;

u32 HeapSize()
{
   u32 endofprogram = (u32)&_end;
   u32 endofheap = (u32)EndOfHeap();   

   return endofheap - endofprogram;
}

void PrintSize(FILE *fd, u32 size)
{
   u32 mb = size / (1024*1024);
   u32 kb = (size - (mb*1024*1024)) / 1024;
   u32 b = size - (mb*1024*1024) - (kb*1024);
   
   fprintf(fd, "%i MB %i KB %i B\n", mb, kb, b);
}

int main(int argc, char *argv[])
{
   printf("HeapSize: ");
   PrintSize(stdout, HeapSize());

   return 0;
}


When running this program you get the following result.

Code:
HeapSize: 30 MB 839 KB 64 B

_________________
Lukasz.dk
Back to top
View user's profile Send private message Visit poster's website
TracerH



Joined: 24 Feb 2008
Posts: 5

PostPosted: Fri May 09, 2008 6:51 am    Post subject: Reply with quote

Nice work kouky! Have fun at the party.
Back to top
View user's profile Send private message
kouky



Joined: 25 Sep 2007
Posts: 48
Location: London

PostPosted: Sat Jul 26, 2008 8:51 pm    Post subject: Reply with quote

I've performed 3 sets of visuals with my PS2 last week at the Glade festival in UK, it was great! (apart from freezes every 15 minutes)
I've worked a lot on my project sine my last post.

An updated screenshot of the application:


And a video of the software running:
http://pikilipita.com/vj/flv-player.php?mov=17

The PS2 is sooooo cool :)
_________________
softwares for artists on video game systems - http://www.pikilipita.com
Back to top
View user's profile Send private message Visit poster's website
kouky



Joined: 25 Sep 2007
Posts: 48
Location: London

PostPosted: Sat Jul 26, 2008 9:00 pm    Post subject: Reply with quote

And finally, a photo of my last week live set :

Glade festival / Overkill stage
_________________
softwares for artists on video game systems - http://www.pikilipita.com
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