(04-03-2011, 03:20 PM)Hykem Wrote: Hmm...
Looks like this game attempts to load audio streams using an archive format (.AFS). This format has been starting to show up a lot lately.
I'm guessing the failed attempts to load those files may be one of the causes for the massive consumption of memory, so I'll see if FFMPEG can parse this format properly and look for the right streams only.
I do understand that the memory leak will get fixed eventually when proper .AFS support is implemented, but would it be possible to make some temporary solution to prevent those leaks?
Could you check this game with the latest revision, r2068? The fact that the async IO thread is now handling the file closing may help some games that repeatedly attempt to open/close the same files, but I suspect this will only get properly fixed after getting the decoder to recognize .AFS files.
As a workaround, I believe there's a tool called adx2wav which may be capable of parsing the sound data from those archive files. But you would still have to replace all the files.
04-11-2011, 09:20 PM (This post was last modified: 04-11-2011, 09:26 PM by Szarikow.)
Same stuff happens in r2068. I'll try the adx2wav. There is something I don't understand here though. Both music and voices are in ASF files. The music does not work, but somehow the voices do.
04-11-2011, 10:20 PM (This post was last modified: 04-11-2011, 10:23 PM by hyakki.)
I took a quick look at OD_STREAM.AFS, and it seems adx2wave can do the simple files like battle victory (play once audio not the kind that loops) but the big files (i assume these are the bgm?) it cant decode
so i'm thinking Jpcsp can handle the simple files (i heard the battle victory one play in jpcsp when i beat the first battle) but it has the same problem that adx2wav has with the big files ..but i could be wrong
04-11-2011, 10:31 PM (This post was last modified: 04-12-2011, 08:13 AM by Szarikow.)
I'm surprised SEGA still uses same file formats on PSP as they did on Dreamcast. So I extracted the files but I am not exactly sure how to put the wav files back into an ASF file.
Edit: I got critical exception from adx2wav, but I converted those using adxutil (those tracks sure are the BGMs). There is a Winamp plugin (written in c or c++ with source avilable) which plays ADX files just fine, though I have no idea if it supports looping. The plugin is called "Rob's ADX Plugin", but "IN_ADX" is probably easier to find
Edit: All the ADX files in OD_Voice.ASF are tiny (and yes they contain the voices).
At least we learned something. We know jpcsp can't handle ADX files above certain size (somewhere around 1MB).
I wonder if ADX playback in general is causing the leaks or only those "big" files.
04-12-2011, 02:02 AM (This post was last modified: 04-12-2011, 07:07 AM by hyakki.)
(04-11-2011, 10:31 PM)Szarikow Wrote: I'm surprised SEGA still uses same file formats on PSP as they did on Dreamcast. So I extracted the files but I am not exactly sure how to put the wav files back into an ASF file.
Edit: I got critical exception from adx2wav, but I converted those using adxutil (those tracks sure are the BGMs). There is a Winamp plugin (written in c or c++ with source avilable) which plays ADX files just fine, though I have no idea if it supports looping. The plugin is called "Rob's ADX Plugin", but "IN_ADX" is probably easier to find
Edit: All the ADX files in OD_Voice.ASF are tiny (and yes they contain the voices).
At least we learned something. We know jpcsp can't handle ADX files above certain size (somewhere around 1MB).
I wonder ADX playback in general is causing the leaks or only those "big" files.
Interesting, I was fooling around with another game that uses AFS files (Hexyz force) , and found out all the battle voice files can also be converted to wav (these don't decode with jpcsp either), oddly enough only the adxutil or the winamp plugin can convert them to wav (adx2wav doesn't do anything) and they are small files.
Im going to look into ffmpeg and see if there is a better decoder for the format, I looks like the adx support in ffmpeg is based off the adx2wav source
Edit:::
I found a new adx2wav (DC/SS adx to wav converter by bero)(44kb filesize and command line - but its oblivious modified from beros adx2wav(11kb))
anyhow this one can convert to wav the problem files from before it can also do the hexyz force afs files too, maybe it could work as another external decoder like himd
04-12-2011, 09:01 AM (This post was last modified: 04-12-2011, 09:25 AM by hyakki.)
That screenshot was before I found the other program <but the gui was useful since it told me what files had audio in them>.
I wanted to temporarily swap HIMDRENDER with the cmd of adx2wav (and change the bat file to accommodate the program) to see if it would auto decode, but I guess the OMA files get the headers (and content?) modified by jpcsp so it didn't work like I planned...
not to mention avx2wav outputs the files at 22050 hz , when jpcsp needs them in 44100 hz (would of worked but sounded funny) ...
Long story short I manually renamed and re-encoded some files then moved them to the Atrac dir to test and it worked jpcsp played voices in Hexyz Force (using the decoded files) ....
(I couldn't do this game since it doesn't put the files in the Atrac dir)
I think Jpcsp is going to need another external decoder (or another way to decode these files) since some adx files ffmpeg can't handle
04-12-2011, 09:52 AM (This post was last modified: 04-12-2011, 03:39 PM by Szarikow.)
The command line ADXutil does output 44,1kHz and even handles ASF files. I wonder if it is possible to have jpcsp use decrypted wav files from outside the UMD image.
I managed to replace the ADX BGMs with wav ones in the AFS file and put it back onto the UMD image, but... jpcsp still tries to decode them as ADX files so there is no difference.
Oddly enough some of the wavs from the modified OD_STREAM.AFS file do play (same ones which played from the original AFS file in ADX format), but that's probably because those are small enough (like fanfares when you change class or win battle). Here is an INFO log (probably won't show anything new).
Maybe I should try using mp3 files and make all of them smaller than 1MB...
Edit: So I tested the mp3 files, but unlike the wav files thy are not played at all.