Decoding HCA CRI files by pengy at 1:17 AM EDT on May 18, 2011
CRI came out with a new High Compression Audio file for their ADX2 software, and I haven't found a way to decode it yet. Sample File: http://www.megaupload.com/?d=QMPZ2ZSK (From OreNoImouto PSP) Is there any way to get this into a playable format? It was originally in an AWB file (extracted by a version of utf_tab I found on here), and came out as a bin.
Doesn't seem to be the same scheme used in the previous "high compression", AHX, which was just foreshortened MPEG frames. I've tried reinterpreting these frames as MPEG a few different ways without success. Might be something new.
According to this, it seems like it is a sister/brother to AHX http://www.cri-mw.co.jp/product/lineup/audio/criadx2/2nt4hm000000xz63-img/2nt4hm000000xzb1.jpg
Well, maybe not like you think. This is like saying the PS3 can read ADX2, obviously. Probably runs apps that have an executable which contains a decoder and yada yada. But straight up Google Chrome probably can't read the file as-is.
It looks like this is using a proprietary codec called HCA-MX. If there was some way to dump that out of a game that may be a quicker way to get this streaming. The English brochure outlines this.
I can also confirm that HCA is now being used in Phantasy Star Online 2's character creator unlike previously where it was in a plain .adx format so that may help as well.
HCA and HCA-MX aren't (exactly) the same thing. If as I suspect HCA is similar to AAC, they are probably equivalent to AAC Low Complexity and some other profile.
I've started looking into the codec from an Xbox 360 game, but I encourage anyone else to also give it a shot as it'll be a long time before I get anywhere.
I have downloaded the Google Native Client Demo. It is true that the binary contains decoder and the new CPK format (known as AWB) analyzer. But I'm not good at reversing project.....Can someone help me?
Not likely to have any effect on anything at the moment. What probably happened was they got the code to execute the in-game decoder to function. Not as a standalone player.
To bxaimc: You are right. I found a new thread called "CRI Atom Sound Output" coming up. In-game decoder started to work. Maybe we can get memory dump to find something new? Or we can use the In-emulator Debugger for details? To snakemeat: Please use r2810. Hope you can do something helpful.
i'm highly interested in decoding these HCA files. There should be some Decoding DLL distributed with PC Games which use HCA. If someone would upload this DLL, i would write an simple hca2wav utility to convert a HCA file to a RIFF WAVE.
Or does somebody knows a location at which I can download the ADX2 SDK for PC ?
Unfortunately there aren't any DLLs with anything HCA/ADX2 related. The decoder is embedded in the EXE for every PC game. I have a bunch of executables from a few games that include PC, DS, PS3, and x360.
Debugging an x86 Windows Executable is the easiest one among the other systems..., since there are some (good) disassemblers.
But analyzing and generating working (C) high level code is a complex thing.
Hopefully the exe contains some debugging (symbol names) infos, so there's no need to find the HCA decoding routines.
I know that Street Fighter X Tekken and Binary Domains uses HCA files. If you have these PC games, would you please upload the exe+a hca file so i can take a quick look at it ?
To Moelli: Unfortunately I deleted that game... I'm using a very slow network connection so it may take a few hours to re-download it...Hope someone else uploads these files. But I have some HCA files (not AWB) that extracted from Ore no Imouto. Link
Let me know if you want to take a look at ATRAC3plus as well since I have the encoder/decoder and DLLs for that. As well as the encoder/decoder for XMA.
@OrangeC: I'm happy you ask... But I need more time... The code is quite complex, so please be patient... The DeCompiler of IDA Pro is buggy, so I need to re. the assembler code itself... The exe files use both awb and acb files. Somebody knows what .acb-files are ??
The Project is interesting, but everybody should understand that I cant spend my hole freetime for it...
To Moelli: I have both ACB and ACF files (for demo, not belong to the game). It seems that ACB is container for Cue's (?). As for ACF, I can't get any details about that. Link
What do you think the XBox 720 will use as primary encoding ?? Hopefully some kind of lossless audio !? Maybe instead of using WMA Pro they will use WMA Lossless in XMA.
It's an MPEG based codec. Probably similar to CRI's AHX codec which is slightly modified MP2. ADX2 might be more toward the MP4/AAC codec. According to what hcs found, an HCA frame has 1024 samples in it unless a loop is set, like AAC, vs 576 or 1152 for MP2/MP3. So far there are only 3 values for the 'ciph' chunk which are 0, 1, and 56. Most HCA is probably unencrypted at the moment but if we stumble upon one, it might be using DES encryption with the 56-bit key but this is optional, according to the parser. The 1 is probably the same encryption they use for ADX.
hca2wav by profrager at 2:40 PM EST on February 9, 2013
I get "Error reading HCA header" with SoulCalibur V files with more than 2 channels. Yes, this decoder does not yet support more than 2 channels. The reason for that - the decoder has been cuted from bionic commando, and it supports a maximum of 2 channels and the size of the input chunk to ~1024 bytes. This track has 4 channels and chunk size 2048 bytes. I'll try to fix it.
Hmm.....yea source would be nice I did not rewrite the code in C, just decompiled pieces of code in the. asm file and wrote a control program in C. I understand how it works, but I have no time to write it on a high-level language. Need .asm source?
Added support for multi-channel audio up to 6 channels; Added sources. HCA2WAV v 0.2
by pietastesgood at 7:42 PM EST on February 11, 2013
Hey, I'm pretty rusty with ripping these days, but this file from Binary Domain doesn't seem to wanna convert. It gives error code 8, and here's the file:
http://rghost.net/43733772
The first 12 seconds convert, but the rest is lost. There's a similar problem with other files from the game. Would appreciate someone looking into this!
I think the first 32-bit number after the "loop" marker in the header is the (start block - 1) and the second 32-bit number after the loop marker is (end block - 1). Multiply these values by 400 to get start and end sample counts.
www.packupload.com/889XYNTWEZ7 this hca file cant be decoded by hca2wav.exe This file has the tag "version" 2.0, but decoder supports only 1.3
I get an 'error reading header' for HCA files in PSO2. Included a sample file if anyone would like to check it. http://www.multiupload.nl/YP2QVGMFC0> This file contains invalid tag names in the header. For example, instead of "HCA" (in hex: 0x48, 0x43, 0x41) contains "ИГБ"(in hex: 0xC8, 0xC3, 0xC1). This looks like a simple xor 0x80. I tried to fix it but it seems that the remaining data is also encrypted (xored).
A user tried to access a file or directory that they did not have permission to access. Please check URL address." I can't download. And no time to search Japan proxy.
In archive i found only HCA encoder v 2.00 : hcaenc_lite.dll . It is easy to adapt for use. But it seems that the decoder is contained in some other dll or exe, written in C #. I have no experience of reverse engineering such programming languages.
I'm having a little problem converting HCA tracks from Naruto Shippuden Ultimate Ninja Storm 3, hca2wav converts them but also gives me this error message: "decoder return error code: 8" and there is a little bit of noise at the end of every converted wav.
It's not really a problem since i can remove the noise with audacity, but i thought i should've report the problem. :)
EDIT: soneek just told me that maybe the XML preset for VGMToolbox Cutter he gave me can be broken, so there is the chance that the HCA files are screwed up.
Is anyone else having trouble playing stuff with CRI Atom Viewer? I can sort of hear the sounds, but it's extremely staticky while playing them. Tried with ADX & HCA files, ACB and AWB archives.
As for CriAtomViewerClr.dll, I did some research. It was written in C++/CLI, decompiling it could be harder but we can find usage in CriAtomViewer.exe.
It seems it also contains some information about the new AFS2 format. I will check it later.
Just curious, determining the format type of .HCA, is it the data after that offset, which would be at offset 0x0000000C, or is it the data before that offset, which is otherwise offset 0x00000004?
I'm just looking into PSO2 .HCA, and notice that simple xor'ing (what profrager mentioned. I do not have a program that does this. A hex editing program with this feature would be very helpful) on ALL of the data definitely doesn't convert it correctly. Some parts of the data stays the same, while some require the offset to be subtracted by 80 (or 50 in hex.)
EX: Offset 0x00000000 through offset 0x00000002 as mentioned by profrager requires a subtractiong by -80 (or 50 in hex.) Offset 0x00000003 through offset 0x00000006, however, has the same values like other .HCA files and should stay the same.
Maybe someone can make a vgmstream patch or update it to work with newer HCA versions. All credit to the original poster, I just modified it to allow for larger headers and made a VC++ project out of it.
There is some useful header info there for making an extractor also.
Thanks for that submission! That app apparently can convert PSO2 .hca files into .wav perfectly with no adjustments... and in the end it turns out the game might be running in some sort of sequence? Hard to say how it works.
The question is, what's making the game decide what plays what in a sequential-like fashion? The only thing I see is that the character maker bgm should be at or around 100 BPM from adjustments with music production programs. Not sure if it's in the game's .exe or if it's in one of the ICE or CPK files. Of course the patterns randomize, but would be interesting to find leads on how it's being played.
I can confirm the program for the previous page works perfectly. As for sequencing, PSO2 is using an in-house proprietary sequencer called Sympathy.
Does anyone have a program that will convert from WAV to HCA? also is there a program somewhere that will pack up CPK files? I'd like to test something out.
by Ultrafighter at 10:16 PM EDT on October 5, 2013
I`m just wondering if anyone out here has taken a look at Ryu ga gotoku 5 HCAs yet? I`m interested in playing back or at least converting them anyhow as a greater amount of them (heck almost all of them actually!) still can`t be converted with either hca2wav or hcadec. Of course I can provide loads of seemingly differently encoded samples (stereo, 4ch, etc.). I guess that might prove useful for future aforementioned programs revisions as well as vgmstream implementation whenever it`s done.
Not yet but it`s positively doable. The only obstruction in the way of doing so is that there`re 682 files worth of 2.29 GB excessively representing all the track groups used in the game: multichannel ambiences, the ones from karaoke and all the remaining minigames, situational tracks (stingers and such) and that "usen" bunch of course. File sizes also vary starting with a few dozens of KB and ultimately reaching dozens of MB. Given the game`s age I`d suggest that all those files aren`t convertible because of v2.0 of HCA format which seems to be not implemented in either hca2wav or hcadec yet but there`s a supposedly typical "HCA" (0x48/0x43/0x41) header in every single file I mentioned.
Oh, I almost forgot that 2/682 might be converted but results of both decoders work are almost undoubtedly erroneous at least in the case with constantly skipping sound in one of resulting WAVs. Another one contains merely silence which cannot even be normalized to anything of musical type but it`s possible that the original HCA track was actually a silence one albeit being quite long. I guess that a look at these 2 files would be even more interesting for reversing and coding folks out here. Both files in question are not that big, just a very few MBs worth of size so that I can post both of them in one pack but separately from the samples of files which don`t convert at all.
And finally, is MF / SS fine for that?
error reading hca header by saeid_nejat at 10:09 AM EDT on November 2, 2013
hca2wav can not convert. error reading hca header how solve this problem?
error reading .HCA Header? by FinalBlast at 10:06 AM EST on December 22, 2013
I managed to extract from .awb getting these .hca/.neo files, none of which hca2wav works...?
I've provided a sample, if anyone knows anything check it out. http://filetrip.net/dl?VvMADVoqQ5
[img]http://i.imgur.com/Sn5Ovto.jpg[/img]
error reading .HCA Header by Calary at 10:46 AM EST on December 22, 2013
encounter the same problem with FinalBlast.
I've tred to read th source of the HCA decoder from 2ch, managed to understand the multiple attributes in the header of hca files.
I found that the decoder cannot recognize the "comp" attribute(maybe compress?). Same does hca2wav, I think.