Bug hunting in DirectSound

11/2/2009 2:48:50 AM

By RetroRalph

So I spent a few hours today trying to track down a few issues people have been having in RetroCopy.

Firstly I must say besides a few NES issues with corrupt headers I never get a crash in RetroCopy, it runs very nicely. The same with most of my testers too. But anyhow I have managed to find a bug or two. Now I should have been handling DirectSound errors a bit more gracefully, that is my own fault, so if you were getting a crash when you tried to reload a game you will now get no sound in some instances (which is better than a crash I must admit).

It is related to "releasing" DirectSound resources. If you release the resources then SOME sound drivers start giving error messages when you try and create NEW buffers after this event. Silly me to think if they worked once they would work again. Not with DirectSound.

Now this could have something to do with using 3D sound, and it could be some Windows XP/2000 only bug (I don't know anyone on Vista/Win7 who has got it). But it sure is interesting. I will try and find a work around because at the moment it would be annoying to only hear sound in the first game you run. I already know of one work around but it's ugly, and that is don't free up the resources you use. Provided you don't try and release the resources back there are no issues what-so-ever. This is tested in VMWare which manages to get this bug others have got (verified from crash reports), my main machines don't experience it. I have an inkling that some sound drivers may be having issues with the 3D aspect, so playing around with how I'm using that may also end up in a workable solution.

There is still another bug to track down to do with converting games. The hard thing is I cannot reproduce this one and there are no crash reports for it either. Without some address to track down it makes it very hard to try and find the cause.

*UPDATE* I managed to find a solution to the sound problem, at least on my virtual machine. Appears some sound drivers don't like any of the 3D flags/values being changed and then trying to release the resources. If you set them all back to default values then try and release the resources the problem goes away. A very odd and undocumented bug that it appears they fixed in Vista, but hopefully this will allow most people on WinXP/2000 to not have any issues.

0 responses to Bug hunting in DirectSound

Add Comment
RetroCopy: Making emulation easy and fun.
  |   RetroCopy © 2011