[00:36] Reading over eating is how I learned about why the British subjugated india [00:37] Spices, baby [00:37] Also, there was a secret spice island [00:38] spices, drugs, and tea - the cornerstones of an empire [00:40] I bet every time db48x reads about the panama canal, he imagines boxes of PCE [00:41] each ship going through the locks is like one simulator cycle being passed through the synchronous processing thread [00:42] the stationmaster has to blow the horn for 30 seconds, and while he's blowing the horn he can't operate the locks, so there's a delay while the sound plays [00:42] *** Panasonic has joined #jsmess [00:58] And we're like a bunch of longshoremen running along throwing bricks onto the boats to see if they make it through the locks faster [01:14] *** phe has quit IRC (Quit: Leaving) [01:49] I think Dan has (wisely) decided to run off to join the panama canal [02:58] heh [04:31] *** pfalleno1 has quit IRC (Ping timeout: 250 seconds) [08:37] *** pfallenop has joined #jsmess [09:01] *** pfalleno1 has joined #jsmess [09:01] *** pfallenop has quit IRC (Write error: Connection reset by peer) [10:11] *** phe has joined #jsmess [13:34] https://lolcommits.github.io/ [14:35] https://archive.org/details/softwarelibrary_mac officially has descriptions or has had quality checks for all items. [14:41] So, regarding sound. Are we stalled? [14:41] Do we need to bring in more people to look at it? Or something else? [17:34] all we need to do is bring in someone who already knows how to fix it [17:38] *** Panasonic has quit IRC (Ping timeout: 244 seconds) [18:48] *** azakai has joined #jsmess [18:49] SketchCow: hi [19:04] right on schedule [19:05] alon, we're tryibg to make a javascript emulator not suck at sond. [19:05] sound [19:05] db48x can give some insight [19:06] emulator is at http://archive.org/detaild/softwarelibrary_mac [19:06] details [19:07] azakai: howdy [19:19] so i know there is some work on audio workers in browsers, but otherwise I don't think there is much new stuff usable right now [19:19] the best person to ask about how to optimize sound in the current tech is clb on #emscripten, but he's on vacation atm [19:22] I'll keep an eye out for him then [19:22] in the mean time, do you know much about the SDL port? [19:23] I've not yet looked into how it's implemented, but what we've noticed is that it seems to play the entire sound buffer every frame [19:25] db48x: sdl1 or sdl2? [19:26] sdl1 [19:27] but let me double-check that [19:30] yea, 1.3.0 [19:35] ok, then clb is again the best to ask, as he's worked on it more recently then me. but i did work on it earlier. let me take a look [19:36] db48x: sdl1 has a few ways to play audio, which api is this using? [19:38] (raw audio vs an audio file to be decoded) [19:39] raw audio [19:39] so Mix_QuickLoad? [19:40] here's where we open the device: https://github.com/db48x/retroweb-pcejs-jsdf/blob/pcejs-cycles-per-frame/src/drivers/sound/sound-sdl.c#L248 [19:41] or OpenAudio perhaps [19:41] OpenAudio [19:41] yeah, openAudio [19:42] ok, i remember clb rewrote this a lot, to try to optimize it. [19:42] might be best to read the code inside SDL_OpenAudio in src/library_sdl.js in emscripten. there are a bunch of parameters there like when to queue more to play etc [19:46] the pushAudio functions etc look like the relevant parts [19:58] bah, here's something I should have checked earlier: [19:58] requested audio format: freq=22255; format=32784; channels=1; samples=1024 pce-macplus.js:1:367033 [19:58] obtained audio format: freq=32000; format=32784; channels=1; samples=1024 pce-macplus.js:1:367033 [20:01] I require comestibles; backson [20:03] probably a lot of work to convert pce to sdl2 right [20:36] *** Ravenloft has joined #jsmess [21:09] Vito`: no idea [21:09] Hampa Hug has sent me some helpful emails, however [21:10] "At every horizontal blank, one byte is read out of the sound buffer and buffered in mac_sound_t.buf[]. At every vertical blank one packet of 370 samples is written to the sound driver using snd_write()." [21:10] that's how the original hardware worked [21:36] *** azakai has quit IRC (Read error: Operation timed out) [21:48] I have one other question which maybe jvilk can answer. [21:48] is it possible to compress the hd images? [21:48] they load in seconds in .gz but 40mb of hard drive is a loy [21:48] lit [21:49] lot. [21:49] and when this is announced, people will go crazy on that one. [21:50] the ZipFS can't deal correctly when a zip contains only a single file, rather than a directory full of files [21:50] (or we're using it wrong, of course) [21:52] brb, rachel birthday dinner [21:52] thabks so much for all this work, dan [22:01] yw [22:01] enjoy dinner :) [22:09] db48x: wait, really? I thought I'd used single-file zips before [22:10] but, that being said, if the web server is configured properly, it'll be sent gzipped over the wire anyway [22:10] bai: yep [22:11] bai: and I've mentioned that before, but somehow IA hasn't fixed it. [22:14] just rename the .img or whatever as .html, maybe it's configured to do that by default :D [22:25] lol [22:59] oops, that loop is slightly infinite [23:12] hrm, not really an improvement: http://erebor.db48x.net:8000/example_macplus.html [23:20] ok, that's annoying [23:20] which loop are you changing here? [23:22] in snd_sdl_callback I'm resampling the audio to match what SDL has asked us to output [23:22] I left in the outer while loop, but didn't decrement cnt [23:29] ah ok. can't we also just tell sdl the format we'll be outputting? or does it only accept one rate? [23:32] we do tell it what format we want, but it pushes back and tells us what we're allowed to do [23:39] I see [23:40] so PCE asks for a sample rate of 22255 (yes), and SDL says "well, 32000 would be nicer" [23:40] "look, if you're going to make me run in this weirdo frankenstein environment, the least you could do is speak to me at a rate I can understand" [23:40] yea [23:40] I dunno why it doesn't just resample it for us [23:59] hrm [23:59] for some reason, I'm getting -32768 every time I read from the source buffer :P