@Raziel
Getting back to the topic of Myst III, I'm now pretty certain that the stuttery audio is residualVM's own fault. I ran a test where I disabled glTexSubImage2D(), thereby completely eliminating the overhead of uploading the video frames to VRAM for display. The stuttering remained.
ResidualVM uses SDL for audio, right? Well, that could be part of the problem. Here are three reasons why I think this:
1) ResidualVM's own FAQ mentions possible stuttering on Windows, with an SDL workaround (
link).
2) When I tried the WIP Homeworld port (also SDL based), disabling the AHI driver caused Homeworld's framerate to jump from 2 to 20 fps on my system. That's a pretty extreme change.
3)
Quote from Spirantho on aw.netQuote:
The real problem I have with MAME is a lack of time to dedicate to it..... the sound stutters badly on SDLMAME quite often and I really want to fix that before doing a proper release again.
Now, the above doesn't guarantee that SDL's audio is the cause, but it does indicate that SDL audio may be problematic.
Of course, I still think that it would be worth looking at optimising the bink video decoder, including using altivec. The CPU usage remains unchanged even with glTexSubImage2D() disabled when video clips are playing (it's clamped at ~90% in both cases). I think that the video decoder could do better than that; the resolution isn't that high.
Hans
P.S., I randomly get the game failing on startup with an assertion failure at line 679 of engines/myst3/state.cpp. This suggests that there's an uninitialised variable bug somewhere (other OSes zero newly allocated memory, which makes it easy for such bugs to remain hidden).