I Bin2h'ed An Ogg And It Took 6 Hours To Compile :-\


Alex.

Retired
Joined
Aug 24, 2005
Messages
4,616
Yesterday I decided to start playing a bit with SDL_RWops and reading graphics and sound files from program data rather than from external sources. I used bin2h to convert them to C data. The music file was a 1.8Mb OGG that converted to a 9Mb file of data. It took 6 hours to compile. Six hours. It should be noted that I used a 700mhz Pentium 3 with 128Mb of RAM, but still, it took a lot longer than I expected. And this is for a small game, what will I do for a larger one that needs two or three music tracks? Am I doing something wrong here?

Now I live under the fear of accidentally hitting the "Rebuild" button :D

- Alex
 
Now I live under the fear of accidentally hitting the "Rebuild" button :D
:lol:
I know how everyone of us loves his PC, but I think you should be aware that P3 with 128 MB of RAM is far beyond new PCs, guess it will take less than 15 minutes on one of the newest PCs with 766 mhz ram bus instead of the old 133 mhz (trust me it makes a HUGE difference)

I am wondering what is the benifit of not having it as an external file, guess if increased perfromence the decrease in ram and sd speeds will get you back were you already started, or am I missing anything? :huh:

edit: typo
 
Last edited by a moderator:
I know the computer's not exactly top-notch ;)

As for the advantage, I figured it would be nice to have the whole game under one single file rather than 3 or 4. Now however I'm having trouble with Mix_LoadWAV_RW(), so I'll go back to using external files.

- Alex
 
if you kept the .o (object) for the file you wont need to compile it again unless you change it, but yeah 6 hours is way too long maybe ask on here if someone can compile it for you and send the .o after.
 
The file is too big and the compiler is swapping ram to the hdd causing this time to compile. (at least this is what i've found to be the case when including huge files even on my 1gig ram takes about 10 mins to compile)

It isn't anything to do with the speed of your machine rather the RAM.

Why do you need the ogg as a C file anyway? I highly recommend just using a tarball or some such if you are trying to keep it all in one gpe file then just loading it on the fly.

Don't worry you can fix this compile time with ease.
 
There are programs that convert binary data directly to object code directly in a matter of minutes - no need for converting to C and then compiling.

I forget which one I used in the past though :(

However, if it can output an ELF object file, it should work.
 
Hmm a tarball? Is that doable under Windows? I searched the forums and didn't find any tips on achieving this. I think I read somewhere that's how you got all those games on the Value Pack nand, correct? Would you mind posting some tips on that, if you have the time? Thanks! :)

- Alex
 
Compressing all those games onto the nand was a fucking NIGHTMARE there are 2 or 3 levels of compression on each game, in some cases the game loads further compressed files.

GPH would not allow any kind of compressed file system so everything had to be done from within the game gpes.

Here is the method I used:

Recompile the game in question with everything included in the gpe, the gpe then spits it out to tmp and loads from there on execution.

Then the GPE itself (with all its included files is compressed with rlyehs compressor)

Then it is all put in a tarball

the tarball is then Gzipped.

A script opens it all back up into ram when executed.

On exit everything is cleaned up and the menu reloaded.

I also tweaked some of the games music and graphics so they compressed better, ed resampled the ogg files down on some games to a lower bitrate too.

Almost every last byte which could be compressed was :)
 
That sounds like a massive effort, and for so many games too!

Thanks for sharing your method Craig :)

- Alex
 
does distcc work in cygwin ?
if it does then you could "borrow" cpu power from other computers in your lan. and thus speedup compilation times
 
One can play with objcopy:

Code:
[laurent@localhost Obj]$ /usr/local/gp2xsdk-old/Tools/bin/arm-gp2x-linux-objcopy -I binary -O elf32-littlearm raw.bin raw.elf
[laurent@localhost Obj]$ file raw.elf
raw.elf: ELF 32-bit LSB relocatable, no machine, version 1 (ARM), not stripped
[laurent@localhost Obj]$ /usr/local/gp2xsdk-old/Tools/bin/arm-gp2x-linux-nm raw.elf
0000000000000008 D _binary_raw_bin_end
0000000000000008 A _binary_raw_bin_size
0000000000000000 D _binary_raw_bin_start
You probably can put some correct names for the symbols and create sections with a linker file.
 
Compressing all those games onto the nand was a fucking NIGHTMARE there are 2 or 3 levels of compression on each game, in some cases the game loads further compressed files.

GPH would not allow any kind of compressed file system so everything had to be done from within the game gpes.

Here is the method I used:

Recompile the game in question with everything included in the gpe, the gpe then spits it out to tmp and loads from there on execution.

Then the GPE itself (with all its included files is compressed with rlyehs compressor)

Then it is all put in a tarball

the tarball is then Gzipped.

A script opens it all back up into ram when executed.

On exit everything is cleaned up and the menu reloaded.

I also tweaked some of the games music and graphics so they compressed better, ed resampled the ogg files down on some games to a lower bitrate too.

Almost every last byte which could be compressed was :)
could you please upload a tarball of all the stuff you compressed, before you compressed it (as in, using rlyehs stuff and such, but still with the downsampled music files., i'd also like a copy of the non-downsampled audio files.)

purpose? i'd like to see how much i can get the stuff compressed :)
 
Last edited by a moderator:
Back
Top