Sound issue with Blitzmax 1.35
Archives Forums/BlitzMax Bug Reports/Sound issue with Blitzmax 1.35
| ||
Can anyone help me figure out why this code crashes after pressing the space bar 16 times in Multithread? Works fine in non-Multihread. Also works fine in multithread for 1.34. |
| ||
Dies on me at 28. Probably running out of Channels on the sound card. |
| ||
@TaskMaster Strange, does it happen in non-thread mode also? I think in my other test I tried clearing the channel with stopChannel and it still crashed. Thanks for checking it out. |
| ||
Well... You probably shouldn't be loading the load everytime (not to say nothing is messed up though). |
| ||
@Plash Actually in real life it a different sound file from a list of about a 100 and I don't think they should all be preloaded. Something about 1.35 and threads. Worked fine with 1.34 with/without threads. |
| ||
That was non-thread mode for me. Dies at 16 in threaded mode. Moving the loadsound outside of the loop solves the problem. So, it has something to do with the loading. |
| ||
@TaskMaster Yeah, it sucks cause I'm trying to load multiple sounds over time. Can't do much with 16. Definitely a blitzmax 1.35 issue. |
| ||
I wonder if there is a way you can wait and make sure it is finished loading before you play it? I did notice that if I put GCCollect() at the end of the loop, then it crashed after just 2 presses of the space key. :) I am guessing you have race condition. |
| ||
My machine crashes after 10 plays, multithreaded on XP with following change: Global base:String = "c:\windows\media\ding.wav" |
| ||
@TaskMaster race condition with what? I also did a test and hit the space bar at a slower pace like once every 2sec. This should be enough to load and play the sound(click is less than 1sec). But it still crashed after 16 hits. |
| ||
I think, on windows, default sound driver was FreeAudio on 1.34 (still) and it's now DirectSound. You could try using different sound drivers to see if it helps finding where the issue comes from. |
| ||
Hi, Actually, it's a threaded garbage collection problem, quite an interesting one too! Looks like it only affects the DirectSound audio driver though, try switching to another for now. |
| ||
Is there no reference remaining within the thread after the sound start is given? |
| ||
@marksibly & ziggy Thanks The FreesAudio driver works fine. |
| ||
Hi ! i've just recompiled my project with bmax 1.35 i've a menu to choose the sound driver For Local t$=EachIn AudioDrivers() AddGadgetItem cobComboBox2, t$ Next freeaudio, freeaudio multimedia, freeaudio direct sound, direct sound and 'null' are listed My game crash with all the drivers listed ! (also 'null') No problem with 1.34. My os is XP PRO |
| ||
Similar problems here when building a multi threaded program, crash when I try to playSound() tried all drivers as mentioned in hub's post and all crashed, if I remove my call to SetAudioDriver() The sound plays correctly without error. |
| ||
Hi, Can someone post some runnable code? Just tried rockout with both "OpenAL" and "FreeAudio" drivers and it worked OK. |
| ||
Hi, Ok, there is a similar issue to do with OpenAL. Will fix...good to see people actually using threaded mode too! |