Open BeezBumba opened 8 months ago
I was also on safari if that helps with anything.
Were you able to fix this? I didn't test on 17.4 yet
No, but it might need tweaking on the webkit feature flags for safari I believe. I’m not sure but it might be a way.
Yeah I just tried it this morning on 17.4 on my iPhone 13 mini and can confirm it is really laggy now. Seems like Apple changed something in Safari. I will also play around with the feature flags and see if there is any workaround for this.
I know they added WebGPU, WebRTC stuff, and 2 or more WebGL settings. It was not talked about in the update and it’s probably something directly on the webkit website. I might be wrong and it might be something else though.
Did you find anything that may help yet?
Nope nothing yet
I have sent a website issue note to apple because now I'm not really sure what could be the issue. I am suspecting its memory only because when I was editing a Google Slides presentation, whenever I would copy and paste, it can take a while for it to paste.
Great - let me know if they come back with anything. Yeah my guess is there's not much we can do unless Apple fixes the issue.
I now know that it’s not something with the feature flags. I tried enabling/disabling all of them to see if there is a difference, but there was no difference.
One more thing. My app store is not working for some reason, so can you try to see if the website works for other browsers?
I tried in Chrome but it's the same result. All iOS browsers use the same engine.
Quick question: Is there any part of your scripts that tries to sync the gameplay with the audio if the audio is acting slow? I saw a part in the script.js script that is highlighted and says that it’s outdated and use a different one.It suggested AudioWorkletNode instead of the deprecated ScriptProcessorNode.
It also has benefits like working on a separate thread instead of the main thread.
it only tries to sync to the audio if you uncheck this box - but that code isn't super reliable. I probably need to remove it anyway in a future update (it should always just use vertical sync for the timing). Yes over time if I can figure out web workers I want to try and offload the audio stuff to a separate thread.
17.4.1 has just been released. Have you tried it yet to see if it fixed the issue?
Also, I did find something intresting. On this website running Banjo-Kazooie, It ran much smoother than this one. Here is the website: https://selenite.is-a.dev/semag/banjokazooie/index.html. It seemed like the code did not get affected by the new update. Maybe there was something outdated that just made it slower?
17.4.1 did not help - for me I've tried other emulators they all run slow for me. Seems to be a wider issue.
What were the other emulators you’ve tried?
the one you linked to. if you wait a minute after the intro screen it starts lagging
For me, the save select screen in the game runs faster. Did you get there?
point being I wouldn't call it "playable". perhaps some screens with less geometry run ok, but get to the outside and its very bad. this really needs to be fixed on Apple's side, I don't think any little optimizations here are sufficient.
Did you find this blog: https://webkit.org/blog/15063/webkit-features-in-safari-17-4/ ? If it’s a problem that Apple has to fix. It might be helpful to find the issue anyways.
nothing in the article really sticks out to me unfortunately
I just found this website https://demo.emulatorjs.org/ that ran fullspeed for me. It uses Retroarch as the emulator. This might have to do with the Webkit engine, Since that actually runs and renders the web pages. They could of changed something up with the power some libraries use, most likely the deprecated ones.
Runs just as slow for me for some reason. I tried Mario 64 and only the save select screen runs fast, everything else slow.
That’s weird. my Ipad 8th generation is running smoothly on that website I gave you.
Do you have any ideas still? Apple has not responded back yet and I'm completely oblivious of what could be the issue.
Nope - does not seem to be much we can do unless Apple hopefully fixes this some day.
@BeezBumba ok I may have a fix, stay tuned...
ok I made some updates can you try this version and let me know how it runs for you?
It works! The only thing you have to do is request the mobile website by clicking the Aa on the left hand side on the address bar. But, thank you so much! What did you change?
Take a look at my last commit - you can see the changes I had to make to fix it.
https://github.com/nbarkhina/N64Wasm/commit/aca7b9846cae3da1e1d46c5e63503c3ee983cf8f
For iOS devices I switched it to use something called "vertex buffer objects" which seems to resolve the rendering lag introduced in Safari.
Awesome, I'm putting the changes in the codespace so it can generate the new js and wasm files right now.
Can I also ask how you though of vertex buffer objects?
I did some experimentation and isolated the slowness to the glDrawArrays call in geometry.c - that is where it draws all the triangles for the scene. So I was looking at ways to speed that up or make it more efficient. I remembered seeing the VBO code before but I wasn't sure what it did at the time so I commented it out. So I tried adding it back and to my surprise it worked. My understanding is that vertex buffer objects offer certain performance gains.
What if i were to change the vertex buffer size. what would that do?
Not sure - give it a shot and let me know
So doubling it to 3000 did not impact the issue a lot so i saw the todo stuff on the top
/* TODO: get rid of glitch_vbo */
/* TODO: try glDrawElements */
/* TODO: investigate triangle degeneration to allow caching GL_TRIANGLE_STRIP */
What were you going to use these for?
I can't even remember if those were my todos - it sounds like I may have been experimenting with performance
yeah those were the original page's todos
Was it just the glDrawArrays that you found that was slow?
I'm not sure what aspect specifically was slow. My iPhone is on 18.1 - I just tried it and it runs fine for me.
It just that most games run full speed except for these ones that I’ve tried: NFL QB CLUB 2000 & 2001, and some sm64 mods. There might be more, but I’m pretty sure all of them have the same issue. Summing it up some games are still laggy and I’m wondering if there was anything else other than the glDrawArrays.
When I updated my Ipad to 17.4 I went to my remixed emulator of yours and it started to lag much more than last time. I even tried yours, but it still resulted into a really laggy experience. I don’t know if it’s the update or if it’s something else.