vgmstream by hcs at 6:57 PM EST on February 5, 2008
I've been talking about doing a rewrite of in_cube for a long time, I'm finally getting around to it now. The decoding library itself is called vgmstream, I have a SourceForge.net project set up for it. I'm adding newer formats at the moment but I expect to eventually get all of in_cube stuff in there.
I'm keeping the code in SourceForge's subversion repository, so those interested can take a look at the code as it develops.
Question: Would anyone be interested in builds of the command line decoder that I'm using to test? It'll be a while before I get this into a Winamp plugin or anything like that. vgmstream has accurate .brstm looping which in_cube isn't going to have (I'd have to rewrite it and that's sort of the point of vgmstream). It wouldn't be too hard to put up some mingw32 builds when I update.
I, for one, would find that pretty awesome. I'd like to hear improvements in current formats as they come and I'm sure everyone will want new builds of vgmstream as formats get added which aren't currently in in_cube. Granted, I'm the only person responding in about a week, but I say: Do it.
I also did^^ by Bugger at 4:32 PM EST on February 13, 2008
I also was interested, BUT, I didnt know anything about it, but since my "... dll" Thread on this page I do, so PLEASE DO IT.
But what is brstm looping? Maybe make it to a simple wav? [I mean the decode]
.brstm is a format used by some Wii games. A very similar format, but with reversed endianness, is used on DS titles in files with a .strm extension. The test decoder does just decode to a .wav. I'll ses if I can figure out the sourceforge.net file release system.
Ok, now up in the sourceforge file release thing. You'll want vgmstream-test-r27 for the Windows executable. You can sign up for release announcements for the vgmstream package, if you like, as I may not announce every time I post a build.
edited 12:26 AM EST February 14, 2008
\\\\\\\"Little things\\\\\\\" by Bugger at 1:06 PM EST on February 14, 2008
The error "either -p or -o, make up your mind" the "either" is written lowercase^^ [I know I overdo it]
YOU FORGET TO MAKE AN EXAMPLE, I cannot play something, with this:
test.exe -p -l 1 test.adx
The dos thing outputs data trash and my hardware speaker goes blee blee blee, only to stop the cmd it can be quit...
But this works fine for me: test.exe -o test.wav -l 1 test.adx
FEATURE REQUEST, can you make a parameter that does output all things [sample rate, loop point and so on] in a file? and doesnt decode the file? So its easyer to write a GUI...
I made a proper helpfile[also in german]
==========================================
=====English=====[By hcs]
Vgmstream
This is vgmstream, a library for playing streamed audio from video games.
It is very much under development. The only end-user part right now is the test program, simply called "test" (test.exe for Windows), which decodes a file to a standard .wav output file.
Formats supported by this version of vgmstream (r27):
Das ist vgmstream, eine Bibliothek um Streamed Audio von Videospielen [GC,Wii,Ds...] abzuspielen / zu encoden. [.wav]. Derweil wird viel daran gearbeitet. Das einzige was zu sehen ist ist dieses Testprogramm, der Einfachheithalber "test" [test.exe für Windows], die Ausgabe ist standard wav.
As I said I have NO idea about C++ or anything similar, I just deal with this noobish programming language DarkBASIC, I can make an interface, but not a bit more, thats why I`m only in doing an interface.
I want to learn it, but I`m not the type to be a good learner, I lack in everything of motivation...
I've sworn off adding new features to in_cube, sorry. These don't loop, anyway, so just decoding them once should be all you need. [edit] Rather, they don't loop with any information in the .rsf. I think there might be loop information in the video files associated with these, though.
edited 11:11 PM EST February 14, 2008
by Only3Penguins at 8:33 AM EST on February 15, 2008
So you're not adding more to in_cube, but... is a Winamp plugin for vgmstream planned?
hcs said "It'll be a while before I get this into a Winamp plugin or anything like that."
Only3Penguins, thanks for reading (NOT!)
edited 10:32 AM EST February 15, 2008
by Only3Penguins at 11:53 AM EST on February 15, 2008
D'oh. You know, I remember reading that too. Guess I just forgot afterwards. Sorry.
But... there's supposedly a problem with brstm looping in in_cube? What is this problem supposed to be? Because I've got the Super Paper Mario brstms and there's nothing wrong with them that I can tell.
I noticed in a few Super Smash Bros Brawl tracks a pop at the loop point. For instance, A09.brstm at 1:30, particularly noticeable in the right channel. Also C09.brstm (1:52) and C05.brstm (1:09), probably many others but I stopped listening after finding those.
There will, ultimately, be a Winamp vgmstream plugin. I intend it to be a replacement for in_cube, though, so I'm really not planning on working on it until I have have all of in_cube's formats supported.
It decodes to standard output, yeah, so you have to have another program that accepts .wav files as standard input. I don't know of any Windows programs that do this. I use it with sox in Linux. It does seem that they have a win32 version, try that out. I don't know how you'd get it outputting to the sound device, though. Ah, mplayer has a Windows port. So this should work: test -p blah.adx | mplayer -demuxer audio -
However, it doesn't, as redirection in Windows is broken (it does stupid things if it encounters newlines). So you're kind of stuck unless there's an mplayer switch that can handle this somewhere.
I just didnt know that you normally try on Linux... I thought that this IS already normal Output to the speakers that`s why I was irritaded. However, thanks.
KEEP ON, it`s not far away that you support most of the gc formats, but what about the DS and Wii Formats, do you know anything about them? [exept brtsm]
C:\vgstream\test.exe -o outfile 1.wav C01.brstm will not work without me removing the space in the output file name. all it does is show me the parameters that vgstream supports then exits.
i use a batch file and i believe batch files use command.com instead of cmd.exe (or cmd.com?) edited 2:55 AM EDT March 10, 2008
Yes, otherwise it interprets the space as separating two arguments. "It" being your shell, iirc (or is it the C runtime?), the test program doesn't do the parsing of the command line into arguments.
.dsps, .kRAWs and .gcms do not work. (I assume that they are not implemented yet.) Additionally, the Super Monkey Ball: Banana Blitz .brstms do not work, but the Wii Play ones do That's all that I see at the moment. I'll do more thorough testing later.
Right you are, .brstms over 32khz were broken. Fixed that bug in a few other places as well, r49 is now up. And you're correct that the others simply aren't supported yet, a list of supported formats is in the readme.txt.
edited 1:48 AM EDT March 11, 2008
@Franpa: You should remove in_cube while testing in_vgmstream, because they support some of the same formats. in_usf, however, is not related at all.
I've been looking at making a gstreamer element from vgmstream but it seems a bit difficult. vgmstream reads from files, but gstreamer likes "streams" (some other one reads the file). I think a element that both reads the file and outputs wav could be done, but I don't think rhythmbox (playbin) would like that.
Any gstreamer expert would like to do a plugin? :)
@Peppyman: The wii play files that don't play have > 2 channels (typically 6). These need to be split out by a tool I haven't written yet.
@javispedro: vgmstream does all file access through the functions in streamfile.c, this was abstracted away precisely so that it could be replaced as needed. So feel free to replace it with something more appropriate for gstreamer. The buffer argument when opening streams is advisory and you could ignore it if you don't have an obvious way to set the buffer size.
@whoever first used this format here: thanks, it's handy
play a ADX file like one from Sonic Heroes (32khz) then close winamp. winamp crashes. this may be known tho.
Yes... by Bugger at 12:43 PM EDT on March 15, 2008
Yes... Because MAYBE there is a command that has the name "outfile" and has as a Parameter 1.wav, to avoid this complication you do the stuff with spaces.
Edit: Ups, that was the stuff from two pages ago, sorry... -.-, dont mention this posting...
You may know adxencd.exe , the very old maker for adx files, I try to get the output like I do by your test.exe, but it doesnt work...
The -m switch makes it possible that it only writes in the file, is that correct?
So, if you dont understand what I mean now: If I call your test only with "test > test.txt" it only will output in the console but not in the file, is there no other way to catch the output to the console?
I am making some progress with the gstreamer plugin (I just want to learn about gst).
I was scratching my head debugging the thing because I noticed brstm's (in fact, "Super Dimentio", the one I use for testing) played at double the original speed. Then I realized it failed too with a pristine copy of vgmstream r52 (using the test app). This didn't happen at all in a previous revision, I don't exactly remember which one.
Does this happen on win32 too? Can you test it for me, please? I can't easily setup mingw right now.
The rest of formats work ok (in the test app, because my gstreamer plugin only plays brstm yet ;) and it doesn't loop very well). EDIT: Brawl brstm's play fine too. It only happens with Super Paper Mario.
@javispedro: Super Paper Mario has broken files which say they are 44100 Hz when they are really 22050 Hz. I haven't added the hack to fix that into vgmstream yet.
@Bugger: I am very confused. test > test.txt will write the metadata to test.txt and the sound to dump.wav. test -m > test.txt will only write the metadata to test.txt. I don't know how adxencd is related to this discussion.
@Franpa: That is odd, I don't notice anything with Winamp 5.24 in Wine. What version are you running? I'll try to run it under Windows and see what happens.
edited 6:57 PM EDT March 15, 2008
I can't seem to reproduce this ADX issue, with a few versions of Winamp on Windows XP. Could you give me some more details of your setup (what specific file are you using)? Are you using the r49 release? Do you maybe have other conflicting plugins?
Oh... does it happen consistently? I really need consistent steps to follow to cause the crash (which exact files you used). And if it doesn't happen all the time when you follow those steps I need to know how frequent it is.
FROM HCS: @Bugger: I am very confused. test > test.txt will write the metadata to test.txt and the sound to dump.wav. test -m > test.txt will only write the metadata to test.txt. I don't know how adxencd is related to this discussion. ----------------------------------------
adxencd is just a command line tool, you can replace it with any... I mean, try it, type it in: "test > test.txt" the result is a blank test.txt . But with the -m switch it suddenly works... "test blah.adx -m > test.txt" then I have the proper medtadata in the file... I`m also confused...
Another thing I've noticed: in most Brawl songs (esp F05.brstm), it doesn't play the first samples at all (it skips them). You can hear them however using in_cube. It seems to happen with Galaxy's ast too.
The gstreamer plugin I've been doing is nearly usable -- It can already play & N-loop brstm, adx using Rhythmbox or Totem -- no infinite loop, no seeks yet. I might clean it up a little and release it.
... Say, what is the new -x option good for? [REV44] Can you give me an example, it confuses me really... And I wonder, you take all my requests so far, thanks very much hcs.
Edit: What is the output line when decoding with -x for? What is that?
@javispedro: Hum, that's bizarre, I'm not really sure what you mean. How many samples are skipped?
@Bugger: The -x option outputs a command line for the ADX encoder, so that you can then reencode the output to ADX with the correct loop points.
uf jumps aboard the vgmstream bandwagon by unknownfile at 11:09 PM EDT on March 16, 2008
i am now doing some tweaking to the code on svn with winamp and visual c in mind. don't expect anything major from me though as i suck with code ports (and in_cube is a mess anyway).
Oops. I noticed that even vgm-generated dump.wav plays fine in Winamp, so it must be that I borked my sound system somehow. Sorry.
Indeed, switching to pulseaudio fixed the problem. Rhythmbox's working now. Going to test seeking...
EDIT: First release of the gstreamer plugin is up! vgmgstream-0.1.0.1.tar.gz (source file) Includes patched vgmstream-r53, so all you need is "./configure --prefix=/usr && make && make install".
It is both my first gstreamer plugin and my first autoconf project, so there may be lots of bugs.
Currently, it can only play brstm & ast files, but it is very easy to add support for more extensions -- next release will have them all (TM). Seeking does not work yet.
If anyone is interested in it, tell me if it works for you.
I didn't see this brought up in this thread (I probably brought it up in #usf), so I thought I'd put it here. When the VGMstream Winamp plugin gets some settings, I would suggest that there be multiple options. Specifically, some ADXs have data after the loop point. In its current iteration, this data is never heard. For the settings, I would like to see not only "Loop [x] times" and "Fade [x] length" but also "If data exists past the loop point, use that instead of using "Fade Length.'"
I'm not sure how to make that into a menu entry (I don't know how to shorten it), but I figured I'd let you know that a feature like that would b pretty cool. Basically a "If data exists past the end loop, play it. Else use FadeLength."
Anyway, I've been using VGMstream instead of in_cube for a few days now, and I haven't run into any problems. That is, excluding the noticeable decrease in available formats. Nice job! I look forward to more releases/formats. Your work is appreciated. Mouser X over and out.
My take on the "data past the loop end point" situation is to have it so that if fade delay and fade length are set to 0 while loop count is NOT set to 0, the data after the loop point is heard rather than having an abrupt stop at the loop point after x loops. That seems the easiest and most logical to me...but that might just be me.
What about when ADXs don't have any data past the end loop point? If you have fade and fade delay set to 0, and it's not looping infinitely, you're going to end up with an abrupt end. Not all ADXs have data after the end loop. A few do, but definitely not all. With the options as I said, if there's data after the end loop, then the fade delay and fade time are ignored. If there *isn't* data after the end loop, it falls back on the fade delay and fade time.
However, if someone wants an abrupt end (for whatever reason), then leave fade delay and fade time empty/0, and turn off "play data past the end loop." With that option off, you'll essentially have in_cube as it now stands. With that option on, you're afforded more abilities. I don't see how your method improves things, most because not every file contains data past the end loop. I think that most *don't* contain data past the end loop, but I'm not certain. I haven't looked at a ton of files to find out. But if that's correct (that most don't have data past the end loop) then I would think that with your method, you'd end up with an abrupt end more often than not, which is something I'd prefer to avoid.
Besides, what's the harm in providing an extra option? I'd rather be able to set it specifically, than have to do some oddball combination thing (set both fade delay and fade length to 0) to get it to play past the end loop (which would then often result in abrupt ends for files that don't have data past the end loop).
Anyway, it's HCS's work, not mine. I only provided the info. as I thought it would be useful. Mouser X over and out.
I do think I like the separate option better, it makes things more consistent. Hidden logic is to be avoided unless it is to provide something that should be genuinely transparent to the user (i.e. all the gyrations that have to be done for loop calculation, or the Super Paper Mario 22/44khz hack that I still haven't implemented in vgmstream, or how nonlooped tracks don't loop while it might strictly make sense for them to loop if a loop count is specified).
It's been a little while, here's another version of vgmstream. Added standard DSP (with dual stereo), Cstr and RS03. No configuration for the Winamp plugin still.
Ah, crud, just remembered that I didn't add the .dsp extension for the Winamp plugin.
r64 now up with .dsp supported in in_vgmstream.
edited 1:04 PM EDT April 2, 2008
r68 SVN now builds with Microsoft Visual Studio 2005. You should be able to just open vgmstream.sln and get building.
I put up a new version a few days ago that supports > 2 channel brstms (though the Winamp plugin still only works with stereo). And there was some other odd format supported, GCSW. Other than that, no.
edited 3:51 AM EDT April 22, 2008
vgmstream by neothe0ne at 10:31 PM EDT on April 28, 2008
Were there any problems with formats looping or otherwise in in_cube besides the looping issue with BRSTM files that vgmstream fixes?
I do fill out change logs for the releases, just take a look at those. For r89 it was: A few more formats (npsf, rwsd, ads/ss2), a winamp fix (on output plugin open failure), and some more options for the command line decoder. For r91 I added rwsd to the winamp plugin's extension list and fixed a bug in calculating rwsd length and loop points.
The multi brstm files aren't going to be too useful in Winamp, they're a bunch of variations, not surround sound audio or something like that.
So since in_cube is not being worked on any more the other formats like MIB etc.. will be added to it.. I like using vgm now but yeah still is short on format support compared with in_cube, but it will be better than in_Cube .Great work so far !
Been messing around with the new version, and I have a quick question. Is seeking broken, or has it not been implemented yet? The seek bar seems to function properly while the music is playing, but it does nothing when you try to seek.
As I said, I am not sure if it is a bug or if it is just unfinished, but I thought that I would point it out anyway.
Also, is there a way to make vgmstream the default handler for all of the files that it supports? I would use vgmstream instead of in cube, but I won't be able to do so until kRAW and gcm are supported by vgmstream. What I would like to do is have vgmstream installed, but when I load a kRAW or gcm, in_cube comes in and plays them. Right now if I have both installed, in_cube just plays everything.
I still have yet to contribute something to this project so I might end up just adding some tweaks to the base code instead of writing shitty decoders, so...
No, seeking is not yet implemented. Also, for Winamp at least, renaming the plugin to "in_!vgmstream.dll" works. For XMplay you have to internally rename it (use a hex editor) to "!gmstream". I've got both installed, and it loads the VGMstream supported formats with VGMstream, and the in_cube ones with in_cube. It's extension based though. As such, if it has *.dsp as the extension, it will attempt to load it in VGMstream. But VGMstream currently has limited DSP support, so there might be some formats it skips over that in_cube would actually play (specifically, THP audio, as seen in many Wii games/rips).
That did it. I had a feeling that there was some way to reorder the plugin loading order, but I figured that Winamp loaded the plugins based on an internal name in the plugin. Thanks Mouser.
You are correct. That game was ripped from 2 sources. The Gamecube, and the PS2. Sadly, I can't remember which version was ripped from which console, but one of them had extra information in the header. That's the one on HCS's site. It works with in_cube, because HCS included a work-around. I think if you remove the first 32 bytes, or 32 KB (I can't remember which. You'll need to use a hex editor to do this) then it should be a "proper" ADX file. It's somewhat annoying, since the files won't play in Rockbox either.
In other words, that one should probably be reripped, so that the files are correct (or, the ones currently available should be fixed). Mouser X over and out.
Yep, and I regretted putting the hack in in_cube, so I left it out of rockbox and vgmstream. It can be argued that that extra header shouldn't be ripped out, though. Like the AINF stuff...
If it is evident that the Super Paper Mario files are at fault, maybe it would be better to just patch them instead of cluttering the vgmstream source more and more.
in_cube had a hack specifically for those troublesome Super Paper Mario files; after trying a bunch of ways to tell when 22050 Hz should be used when the file says 44100 Hz based on something in the file, I finally gave up and just hard coded a list of the file names. This is a lousy hack, and I am really not comfortable with putting it into vgmstream.
Would you be satisfied if I force you to simply rename the files (to .spm or something)? That would be at least a simpler hack to add, and such a thing has been done in the past when there isn't really a better way to identify things.