Skip to content

Instantly share code, notes, and snippets.

@vitorio
Created November 8, 2013 09:18
Show Gist options
  • Save vitorio/7368467 to your computer and use it in GitHub Desktop.
Save vitorio/7368467 to your computer and use it in GitHub Desktop.
JSMESS audio notes
9:00 PM <•SketchCow> #define SDL_XFER_SAMPLES (512)
9:01 PM <•Vito`> right
9:02 PM <•Vito`> and now set that library_sdl.js line to allow 512
9:03 PM ⇐ BlueMaxim quit (~guy@ppp59-167-136-105.static.internode.on.net) Ping timeout: 265 seconds
9:03 PM <•SketchCow> if (SDL.audio.samples < 512 || SDL.audio.samples > 524288 /* arbitrary cap */) {
9:03 PM <•SketchCow> So, just as trivia
9:04 PM <•SketchCow> I do see some 1024 settings in that file
9:04 PM <•SketchCow> So this might break shit
9:04 PM <•SketchCow> But I agree, set to 512
9:04 PM <•SketchCow> Make 1024 if needed
9:05 PM <•Vito`> it's called an adventure
9:06 PM <•SketchCow> If it wasn't called a rathole, everyone would go down it!
9:10 PM <•SketchCow> http://jsmess.textfiles.com/messloader.html?module=coleco&game=Smurf%20-%20Rescue%20in%20Gargamel%27s%20Castle%20%281982%29.col&autostart=true&scale=2
9:10 PM <•SketchCow> Sound works
9:10 PM <•SketchCow> It's like before, but it works
9:11 PM <•Vito`> hahahaha holy shit
9:11 PM <•Vito`> I remember this music
9:11 PM <•SketchCow> Ok, next, setting to 1024.
9:11 PM <•Vito`> it's running at 100% for me in chrome with audio
9:12 PM <•SketchCow> With crunch sound, though, right?
9:13 PM <•Vito`> it's a little glitchy but not terrible
9:13 PM <•SketchCow> I consider it glitchy and terrible
9:13 PM <•SketchCow> Not ready for prime time
9:13 PM <•SketchCow> HOWEVER
9:13 PM <•SketchCow> It's working in Chrome. We never had that before.
9:14 PM <•DFJustin> not in firefox though :(
9:15 PM <•Vito`> I'll record it
9:15 PM <•DFJustin> god this is such a crap game
9:15 PM <•SketchCow> It's working in firefox
9:15 PM <•SketchCow> For me
9:16 PM <•DFJustin> I'm on aurora so maybe it's a weird limbo thing where emscripten is trying to give it poop sound but it wants the new thing
9:17 PM <•DFJustin> "Initializing SDL audio threw an exception: "[Exception... "Failure" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://jsmess.textfiles.com/messloader.html?module=coleco&game=Smurf%20-%20Rescue%20in%20Gargamel%27s%20Castle%20%281982%29.col&autostart=true&scale=2 :: _SDL_OpenAudio :: line 5747" data: no]"! Continuing without audio."
9:18 PM <•Vito`> http://s3.amazonaws.com/vitorio/colecoaudio.mov is it in Chrome
9:18 PM <•DFJustin> also somehow it's slower in firefox despite chrome not using asm.js
9:18 PM <•SketchCow> http://jsmess.textfiles.com/messloader.html?module=coleco&game=Smurf%20-%20Rescue%20in%20Gargamel's%20Castle%20(1982).col&autostart=true&scale=2 made it a LOT better
9:18 PM <•SketchCow> I'm going to try a little more.
9:19 PM <•Vito`> yeah that sounds better
9:20 PM <•DFJustin> ah
9:21 PM <•Vito`> huhn when I die it horks the game and I can't move my Smurf on my next life
9:21 PM <•SketchCow> http://jsmess.textfiles.com/messloader.html?module=coleco&scale=2 with burgertime is pretty good
9:21 PM <•SketchCow> Still recompiling, not swapped yet
9:21 PM <•DFJustin> how the frack am I supposed to get onto the skull
9:21 PM <•Vito`> double-jump
9:22 PM <•SketchCow> Again, when it starts to shove out music, and lots happens, we get the framekilling
9:25 PM <•SketchCow> What does MAX_AUDIO_LATENCY do
9:26 PM <•SketchCow> I'm tweaking this thing to 16384
9:26 PM <•SketchCow> After that, I will double MAX_AUDIO_LATENCY
9:27 PM <•DFJustin> forums.bannister.org/ubbthreads.php?ubb=showflat&Number=23903
9:27 PM <•DFJustin> sounds like increasing it decreases lag, but probably at the expense of smoothness
9:27 PM <•DFJustin> so you may want to try halving it instead
9:28 PM <•SketchCow> 16384 SDL now in
9:30 PM <•SketchCow> Ha ha OK not a good idea
9:31 PM <•SketchCow> Don't run it
9:31 PM <•SketchCow> It freezes everything
9:32 PM <•SketchCow> Went to 2048 and set latency to 2
9:35 PM <•SketchCow> http://jsmess.textfiles.com/messloader.html?module=coleco&game=Smurf%20-%20Rescue%20in%20Gargamel%27s%20Castle%20%281982%29.col&autostart=true&scale=2
9:35 PM <•SketchCow> Sound is perfect. Perfect. But lags on firefox.
9:35 PM <•SketchCow> Glithcless
9:37 PM <•SketchCow> so.
9:39 PM <•Vito`> maybe put it back to 1024 and 5 so it's reasonable in both?
9:39 PM <•Vito`> until that new FF comes out
9:40 PM <•Vito`> and then you can talk with whoever on the emscripten team did sound, and the mess people, about the right numbers
9:40 PM <•SketchCow> That's me
9:40 PM <•SketchCow> waiting
9:42 PM <•Vito`> it's not like smurfette is going to get antsy
9:42 PM <•Vito`> exhuming the coleco is like the aliens reviving the robot boy at the end of AI
9:43 PM <•Vito`> YOU CAN LIVE FOR ONE BROWSER INSTANCE
9:43 PM <•SketchCow> I am kidding
9:43 PM <•SketchCow> I am going to keep fucking
9:44 PM <•SketchCow> Setting it to 8
9:45 PM <•SketchCow> 2048 definitely does the trick
9:50 PM <•SketchCow> Setting it to 8 makes it go molasses
9:56 PM <•SketchCow> Working with my local genius
9:56 PM <•SketchCow> We're going to tweak a bit
9:56 PM <•SketchCow> Sound is potentially good, though!
9:56 PM <•SketchCow> This could be exciting and then I make the atari 800 work and shit howdy
9:58 PM <•Vito`> next week, listen to Rat Hole and the Shit Howdies play their classic 8-bit tunes
10:02 PM <•DFJustin> https://www.youtube.com/watch?v=tQHAwqfmCHk
10:06 PM <•Vito`> neeeeeeat
10:06 PM <•DFJustin> as noted in the comments mess was fixed right after that came out so it should be good in the jsmess version
10:07 PM <•Vito`> I like people who are rigorous like that
10:12 PM ⇐ godane quit (~slacker@c-24-62-246-85.hsd1.nh.comcast.net) Leaving.
10:13 PM <•SketchCow> So far
10:13 PM <•SketchCow> 512 + 1 = Frame hell, buzzing, but synchronized
10:13 PM <•SketchCow> 1024 + 5 = Normal
10:14 PM <•SketchCow> 2048 + 5 = Better sounding, latency
10:14 PM <•SketchCow> 8192 + 1 = (100%) Smooth - but lagged sound
10:14 PM <•SketchCow> 8192 + 512 = Crash Out
10:14 PM <•SketchCow> 16384 + 2 = Crash Out
10:14 PM <•Vito`> you said 2048 + 2 was perfect in Chrome but laggy in FF
10:14 PM <•Vito`> what does 2048 + 3 or 4 do?
10:18 PM <•SketchCow> 8192 + 6 = (50%) No Sound
10:22 PM <•SketchCow> So, 2048 seems to be optimum buffer
10:22 PM <•SketchCow> Tweakin' tweakin
10:22 PM <•SketchCow> I don't mind if frames drop while you're off focus
10:22 PM <•SketchCow> That's your fault for thinking anything is more important than the apple ii
10:25 PM <•SketchCow> 8192 + 6 = (50%) No Sound
10:25 PM <•SketchCow> Whoops
10:25 PM <•SketchCow> 2048 + 3 = (100%) Smooth, VERY close but off by a few frames
10:25 PM <•SketchCow> Try it
10:26 PM <•SketchCow> Genius says 4096 + 3.
10:26 PM <•SketchCow> Sound good to try?
10:27 PM <•Vito`> can't hurt
10:27 PM <•Vito`> try 2048 + 4 too
10:32 PM <•SketchCow> 4096 + 3 = (100%) Smooth, VERY close but then crashes after a bit.
10:34 PM <•SketchCow> Doing 2048 + 4
10:38 PM <•SketchCow> Almost perfect
10:39 PM <•SketchCow> Now going to try 1024 + 4 ?
10:40 PM <•Vito`> yeah, and maybe + 3 and + 2 if you haven't
10:40 PM <•Vito`> maybe making them faster will beat out having more samples
10:40 PM <•SketchCow> 2048 + 4 could almost work in a demo environment
10:40 PM <•SketchCow> That's my fallback
10:41 PM <•SketchCow> It 'feels' right
10:46 PM <•SketchCow> 1024 + 4 = (100%) Smooth, VERY close but off by a few frames.
10:46 PM <•SketchCow> Now doing 1024 + 3
10:50 PM <•SketchCow> 1024 + 4 = (100%) Smooth, VERY close but off by a few frames.
10:51 PM <•SketchCow> So then the question is:
10:51 PM <•SketchCow> 1024 + 4 = (100%) Smooth, VERY close but off by a few frames.
10:51 PM <•SketchCow> I mean
10:51 PM <•SketchCow> 2048 + 4 = (100%) A little choppy (slightly) but synchronized. (BEST CASE SO FAR)
10:51 PM <•SketchCow> Does anything else I do kill the chop in the sound
10:52 PM <•Vito`> I'm surprised the 1024 never got synched
10:53 PM <•Vito`> maybe 1024+6 or 2048+6?
10:55 PM <•SketchCow> 6 crashes everything, trust me
10:57 PM <•SketchCow> Might have been hitting buffering
10:57 PM <•SketchCow> Redoing 2048 + 3
10:57 PM <•Vito`> I thought you only tried 6 with the bigger numbers
10:59 PM <•SketchCow> Will try, then.
11:01 PM ↔ tephra nipped out
11:04 PM <•SketchCow> Doing 2048 + 6
11:07 PM <•Vito`> brb
11:08 PM <•SketchCow> http://jsmess.textfiles.com/messloader.html?module=coleco&game=Smurf%20-%20Rescue%20in%20Gargamel%27s%20Castle%20%281982%29.col&autostart=true&scale=2
11:08 PM <•SketchCow> Try it.
11:12 PM <•SketchCow> So, I'm inclined to do 2048+4
11:13 PM <•SketchCow> This very definitely puts a load on the system
11:13 PM <•SketchCow> I think we have to accept it will buffer out
11:13 PM <•SketchCow> Except on faster machines
11:19 PM <•SketchCow> Hmm
11:19 PM <•SketchCow> 2048+4 is full speed on Firefox, half speed on chrome
11:21 PM <•SketchCow> Whatever firefox does, it does better here
11:32 PM <•SketchCow> Goddamnit, it's been hours.
11:32 PM <•SketchCow> Hmm.
11:43 PM <•SketchCow> Ok. So.
11:43 PM <•SketchCow> http://jsmess.textfiles.com/messloader.html?module=a800&game=Atari%20Dealer%20Demo%20(1980)(-).atr&autostart=true&scale=2
11:44 PM <•SketchCow> Runs 100% in Firefox
11:44 PM <•SketchCow> Runs 50% in Chrome
11:44 PM <•SketchCow> If anyone has any ideas, I'd love to hear them. I could demo with this even with the lag
11:44 PM <•SketchCow> But I think we have, all the pieces here.
11:44 PM <•SketchCow> If someone with a little more knowledge of SDL looked at this, I bet we could get something good.
11:45 PM <•Vito`> back
11:47 PM <•SketchCow> yeah, so I'm in the poking stick voodoo portion of the show.
11:47 PM <•SketchCow> So I'm going to step back for the evening because I made good headway
11:47 PM <•SketchCow> And I don't want to go into an incremental bender.
11:47 PM <•SketchCow> Maybe if you have some thoughts, let me know.
11:47 PM <•SketchCow> That last link of mine shows the weirdness.
11:47 PM <•SketchCow> Older Firefox slow too
11:48 PM <•Vito`> okay that coleco smurf link gives me sound and 100% in chrome
11:48 PM <•Vito`> but the atari demo is basically static
11:48 PM <•SketchCow> That is 2048 + 5
11:48 PM <•SketchCow> Atari is not
11:49 PM <•Vito`> I think we have good data to talk with MESS and emscripten people
11:50 PM <•Vito`> you should pick whichever you like the best for your presentation next week
11:50 PM <•SketchCow> Agreed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment