Skip to content

Web version of vgmPlay

Technical discussion about the VGM format, and all the software you need to handle VGM files.

Moderator: Staff

  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

The latest stable version can be found here but I suggest you go with the development version as it fixes some bugs that were found.
  • tinyrsid Offline
  • Posts: 35
  • Joined: 2015-05-19, 22:03:39

Post by tinyrsid »

I just tried the latest vgmplay-0.40.6.. unfortunately it seems to be unuseably slow :-( where playback of Doom uses 35% CPU with the old 0.40.6 version, the same song now uses 55-60% with the 0.40.6 based version.. under the circumstances there is really no point for me to switch to the new version.. something seems to have gone terribly wrong with vgmplay's performance...
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

There really should be no reason to. Have you tried using a profiler? If you find anything, check if it matches with the commit history.
  • tinyrsid Offline
  • Posts: 35
  • Joined: 2015-05-19, 22:03:39

Post by tinyrsid »

indeed I saw nothing suspicious while merging.. I now recompiled using the old Emscripten version that I'd been using originally and the preformance seems to be back to normal.. I uploaded the new 0.40.6 based version on my webpage..

@vampirefrog: here is a respective stripped version: http://www.wothke.ch/download/backend_vgm.js (let me know if it now handles the fadeout stuff correctly..)

Post by vampirefrog »

tinyrsid wrote: @vampirefrog: here is a respective stripped version: http://www.wothke.ch/download/backend_vgm.js (let me know if it now handles the fadeout stuff correctly..)
Yep, fade-out works fine now. CTRL+F5 http://project2612.org/details.php?id=6

Thanks!
  • tinyrsid Offline
  • Posts: 35
  • Joined: 2015-05-19, 22:03:39

Post by tinyrsid »

@vampirefrog nice work :-)
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Maybe you get some performance back if you replace the new 0.40.6 opl.c with the old 0.40.5 opl.c.
I modified some of the macros there to fix a few bugs, so maybe it can't optimize the fixed code as well now. (Admittedly, those are very obscure bugs related to OPL3 panning.)
  • tinyrsid Offline
  • Posts: 35
  • Joined: 2015-05-19, 22:03:39

Post by tinyrsid »

@ValleyBell: I guess I'll stick to the regular 0.40.6 version - compiled with the older Emscripten version I no longer see a big difference and the biggest speedup is to use FF instead of Chrome..

Would you mind to merge my EMSCRIPTEN-#ifdefs into your codebase? I'd rather not have to merge each new release...

Post by vampirefrog »

I was thinking maybe it's possible to shrink the resulting js file even more if we remove the alternative chip cores and the INI file parsing code, and the command-line parsing code as well. For the INI stuff, we can just hardcode some values or make them somehow configurable from the calling JS code. Most useful are the sample rate, the loop number and mostly stuff in the [General] section of vgmplay.ini. The per-chip enable/disable flags, the hardware output support, sound logging, DRO and CMF file support, and perhaps more can be disabled with #ifdefs.

Post by vampirefrog »

I'm getting some errors in the firefox console, you might want to take a look at them:

Image
TypeError: asm.js type error: expecting argument type declaration for 'e' of the form 'arg = arg|0' or 'arg = +arg' or 'arg = fround(arg)' scriptprocessor_player.min.js:9

Successfully compiled asm.js code (total compilation time 130ms; not stored in cache) backend_vgm.js

mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create backend_vgm.js:170
Also, sometimes on firefox the sounds just stops. it still looks like it's playing, the progress bar is advancing, but no sound is coming out. I can duplicate this by merely maximizing and unmaximizing the window a couple of times.
  • tinyrsid Offline
  • Posts: 35
  • Joined: 2015-05-19, 22:03:39

Post by tinyrsid »

regarding scriptprocessor_player.min.js:9 - I had experimented with a little hand written asm.js and it seems your current browser version complains about something that earlier versions had no problem with.. in any case it should make no difference since the respective code is currently unused.

The "mutating the [[Prototype]] " message is probably more relevant but it is originating from code that has completely been generated by Emscripten, i.e. it is not the kind of code that you'd want to debug. Also the problem with these kind of things is that they tend to disappear as soon as you turn off the optimizer and enable the debug info.. :-(

Regarding Firefox: From my experience there indeed seems to be some bug in Firefox's WebAudio implementation. I've observed the very same effect in all of my players and it's been some month that I've filed a respective bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1152863 - unfortunately the Firefox guys don't seem to give a shit.
Post Reply