Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Random Crashes in play3D

cliffski
Registered User
Quote
2016-12-03 18:11:15

I seem to be getting random crashes in this function with the following errors:

First-chance exception at 0x10001112 (irrKlang.dll) in Release.exe: 0xC0000005: Access violation reading location 0xABABABAF.

here is a code snippet:

vec3df position(pos.X, pos.Y, 0);
ISound* psnd = GUI_GetSounds()->PEngine->play3D(fullpath, position, bloop, true, true);

Looking at my variables I pass in, they all seem reasonable, the sound file plays most of the time, but not always. The 3D positions are large
example: X=-1536, Y = 1792, but I cant see how that matters?

Could I be playing too many sounds at once (I very much doubt it).?
Any help much appreciated.


niko
Moderator
Quote
2016-12-04 07:17:34

Hm, difficult to say, I have a few ideas what could be the reason for that:

- I saw on your twitter that you are using lots of threads: If you start sounds or the sound engine from one thread and end or manipulate them from another one, then this could cause problem like this. Like for example you are trying to stop a sound and manipulating its content at the same time. Maybe this is the reason already?
Be sure to do this from a single thread. Usually the one where you created the sound engine.

- Sure, maybe you are trying to play too many sounds, but this should only be a problem if you are running out of memory, or getting very close to running out, and the memory is very fragmented with lots of small chunks. But this usually doesn't happen unless you have memory related problems at other parts of your game as well.

- Maybe it is just the usual problem that you are dropping() (calling ->drop()) to an ISound* too many times. So that it gets deleted anlthough it is still being used. You can easily check if this is the case if you can reproduce this bug easily, then outcomment all (->drop()) calls and see if it still crashes. Note that irrKlang will use lots of memory then (and probably even run out of it)


Hope this helps.


cliffski
Registered User
Quote
2016-12-04 11:22:13

Ha! Yes I think it is (as I suspected) my own stupid fault. I'm making a few calls from a different thread, so I need to re-engineer that! Thanks for the advice.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "I?ternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact