Hi there guys.
I have been messing with multiple sound card support for a bit now. I ran into this very weird problem. I want to make 4 different systems which can be selected to different sound cards independently and play streams. The problem is that it won’t work if I create 4 system variables and sound variables. If I select a device with the first initialized system and play a file and then select another device with the second system it begins to skip the song playing on system one as soon as I change the system 2 driver and I have to shutdown IDE hard.
I have poked around with it and came to the conclusion that it is always the first initialized system that messes things up. So I created a bogus system that I initialize right away and don’t touch it and then work with my 4 other systems as I want with no problems at all. When I shutdown the application I close my 4 systems and then close the bogus one and everything works great.
In order for this to make sense I have zipped two different projects. One project is the project that freezes and skips. The other project is identical to the first other than it creates a bogus system at startup and closes it at the end. If you have multiple sound cards in your system you can give it a try and see what I mean by the first one not working and the second one working flawlessly.
I hope I have explained myself well here on this. Anyways here are the links to the projects zipped.
Thanks for checking it out and I hope to hear soon from someone that tests or knows of a solution instead of the bogus system.
- Sentax asked 11 years ago
You don’t need more than 1 sound device to test this.
I believe there is a bug in FMOD when creating/managing systems. All you have to do is download the Freeze one.. open it up. put a test.mp3 in the directory. select your primary sound card. click play on the first system and select primary on second one system and within 1 sec it is skipping to the point you have to shutdown hard.
But with the Works one it has this bogus system that doesn’t do anything and it works just fine.
Give it a go anyone. All you need is one sound device not 4.
You’re right. Good test case!
On my box, the VC debugger shows all the running threads (i see a few FMod threads and some VB ones) locked in WaitForMultipleObjects. It looks like some sort of a synchronization issue?
One suggestion is to try triggering all the play events from within a single Timer control, instead of in the button press events. It’s theoretically possible that VB could be having some threading issues of its own when you play the sound/mess with systems from within a button click message.
[quote="Sentax":21kp99kb]I don’t think its the Button_Click message that is the problem. After you begin playing the song on system 1 and select a sound device for the second system it freezes even before pressing the play 2 button.
You get what I mean?[/quote:21kp99kb]Yeah, I understand. It doesn’t freeze that quickly for me, though – perhaps it just freezes after a certain amount of time depending on your system.
Please login first to submit.