Hi again,
thanks for the fast response! It was not much help, but motivating! ;-)
So I finally found the reason for the problem: as soon as the MAIN-Thread ends, the sounds go off and don't work anymore. If a sound is playing at this moment, it gets interrupted. As long as I keep the MAIN-Thread running, everything works fine. I fixed the problem for me by using the MAIN-Thread as GameLoop instead of starting a new Thread, but I don't know why the problem appears at all and why only in Webstart. It occurs with different configurations and the same code works even with Webstart on one Win98 machine. So I'm a bit confused!
I don't use a LWJGL Game-Window and have my own GameLoop Thread. Does this make a difference?
"FSound.FSOUND_Update()" is called every frame in the GameLoop, but FMOD normally works even without that.
Basically I do the following in the MAIN-Thread:
- init sound
- init graphic and load images
- init input devices
- start game loop thread
The same code works with Webstart for a Swing-based sound test and a few short demos, but doesn't want to work with that game I have. But there's not a big difference except the amount of images and sounds I load. I even tried to comment out everything in the game to get just the sound running, without any graphics and input, but the sound effects die as soon as the MAIN-Thread quits. I tried then to reproduce the error with a small test program, that does exactly the same, but it didn't work and everything stayed normal there!
Looking at the situation, I could imagine that it has something to do with the MAIN-Thread's context and Garbage Collection. Maybe some objects loaded with the MAIN-Thread's ClassLoader get deleted as soon as the MAIN-Thread quits. Or maybe some threads stop working.
How can I see if FMOD and the FMOD native threads are still running correctly?
Could it be that the ByteBuffers for the FSoundSamples are not valid anymore after the MAIN-Thread quits?
The sounds get loaded like this:
FSoundSample sound = FSound.FSOUND_Sample_Load(soundCounter,data,FSound.FSOUND_LOADMEMORY,0,data.capacity());
Which ClassLoader is used for loading a FSoundSample? Maybe it's the Classloader?!