[Solved]Application crashes when listener attaches to a node

MusgooDKZ

22-01-2009 15:37:00

I did all as in a demo, all sounds playing but,

On this line the application is crashes:

mCamera->getParentSceneNode()->attachObject(mSoundManager->getListener());
without this line all works, but i cant setup a listener

The last log lines is this -
........
23:11:31: *** --- EAX 4.0 Detected
23:11:31: *** --- Created 63 sources for simultaneous sounds
23:11:31: *** --- Using BOOST threads for streaming
23:11:31: *** --- Recording devices available:
23:11:31: ***--- 'SB Audigy 2 Audio [D000]'
23:11:31: ***********************************
23:11:31: *** --- OpenAL Initialised --- ***
23:11:31: ***********************************

I assume that the reason not in a plugin.

I be grateful fore any help

stickymango

26-01-2009 15:18:58

Hi,

Are you certain the camera has a parent SceneNode? can you not run in debug and step through the init() function to trace the problem?

The Listener object is created within the init() function call, the OpenAL log messages are printed out from within this function, so that assumes its been called, therefore there is no reason why the listener object would be invalid, have you checked the Ogre.log file for an exception?

Regards, Sticky.

MusgooDKZ

26-01-2009 17:03:03

Camera have a parent scene node:

Node = mSceneMgr->getRootSceneNode()->createChildSceneNode("Node");
mCamNode = Node->createChildSceneNode("CamNode");
mCamNode->attachObject(mCamera);
then
mSoundManager = new OgreOggSound::OgreOggSoundManager();
mSoundManager->init();
mSoundManager->setDistanceModel(AL_LINEAR_DISTANCE);
mSoundManager->createSound("Two", "intro.ogg", false, true);
mSoundManager->getSound("Two")->setMaxDistance(50);
mSoundManager->getSound("Two")->setReferenceDistance(5);
//mCamera->getParentSceneNode()->attachObject(mSoundManager->getListener()); //with this line application crashes// without application runs, sound plays, the problem is app crashes and i can't attach listener to a node
mSoundManager->playSound("Two");

Here is the log:

21:33:56: Creating resource group General
21:33:56: Creating resource group Internal
21:33:56: Creating resource group Autodetect
21:33:56: SceneManagerFactory for type 'DefaultSceneManager' registered.
21:33:56: Registering ResourceManager for type Material
21:33:56: Registering ResourceManager for type Mesh
21:33:56: Registering ResourceManager for type Skeleton
21:33:56: MovableObjectFactory for type 'ParticleSystem' registered.
21:33:56: OverlayElementFactory for type Panel registered.
21:33:56: OverlayElementFactory for type BorderPanel registered.
21:33:56: OverlayElementFactory for type TextArea registered.
21:33:56: Registering ResourceManager for type Font
21:33:56: ArchiveFactory for archive type FileSystem registered.
21:33:56: ArchiveFactory for archive type Zip registered.
21:33:56: FreeImage version: 3.10.0
21:33:56: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
21:33:56: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2
21:33:56: DDS codec registering
21:33:56: Registering ResourceManager for type HighLevelGpuProgram
21:33:56: Registering ResourceManager for type Compositor
21:33:56: MovableObjectFactory for type 'Entity' registered.
21:33:56: MovableObjectFactory for type 'Light' registered.
21:33:56: MovableObjectFactory for type 'BillboardSet' registered.
21:33:56: MovableObjectFactory for type 'ManualObject' registered.
21:33:56: MovableObjectFactory for type 'BillboardChain' registered.
21:33:56: MovableObjectFactory for type 'RibbonTrail' registered.
21:33:56: Loading library .\RenderSystem_Direct3D9
21:33:56: Installing plugin: D3D9 RenderSystem
21:33:56: D3D9 : Direct3D9 Rendering Subsystem created.
21:33:56: D3D9: Driver Detection Starts
21:33:56: D3D9: Driver Detection Ends
21:33:56: Plugin successfully installed
21:33:56: Loading library .\OgreOggSound
21:33:56: Installing plugin: OgreOggSound
21:33:56: MovableObjectFactory for type 'OgreOggISound' registered.
21:33:56: Plugin successfully installed
21:33:56: *-*-* OGRE Initialising
21:33:56: *-*-* Version 1.6.0 (Shoggoth)
21:33:56: Creating resource group Bootstrap
21:33:56: Added resource location 'C:/OGG/release/media/packs/OgreCore.zip' of type 'Zip' to resource group 'Bootstrap'
21:33:56: Added resource location 'C:/OGG/release/media' of type 'FileSystem' to resource group 'General'
21:33:56: Added resource location 'C:/OGG/release/media/sounds' of type 'FileSystem' to resource group 'General'
21:33:56: Added resource location 'C:/OGG/release/media/fonts' of type 'FileSystem' to resource group 'General'
21:33:56: Added resource location 'C:/OGG/release/media/materials/programs' of type 'FileSystem' to resource group 'General'
21:33:56: Added resource location 'C:/OGG/release/media/materials/scripts' of type 'FileSystem' to resource group 'General'
21:33:56: Added resource location 'C:/OGG/release/media/materials/textures' of type 'FileSystem' to resource group 'General'
21:33:56: Added resource location 'C:/OGG/release/media/models' of type 'FileSystem' to resource group 'General'
21:33:56: Added resource location 'C:/OGG/release/media/overlays' of type 'FileSystem' to resource group 'General'
21:33:56: Added resource location 'C:/OGG/release/media/particle' of type 'FileSystem' to resource group 'General'
21:33:56: Added resource location 'C:/OGG/release/media/gui' of type 'FileSystem' to resource group 'General'
21:33:56: Added resource location 'C:/OGG/release/media/packs/cubemapsJS.zip' of type 'Zip' to resource group 'General'
21:33:56: Added resource location 'C:/OGG/release/media/packs/skybox.zip' of type 'Zip' to resource group 'General'
21:33:56: D3D9 : RenderSystem Option: Allow NVPerfHUD = No
21:33:56: D3D9 : RenderSystem Option: Anti aliasing = Level 0
21:33:56: D3D9 : RenderSystem Option: Floating-point mode = Fastest
21:33:56: D3D9 : RenderSystem Option: Full Screen = No
21:33:56: D3D9 : RenderSystem Option: Rendering Device = Radeon X1950 Pro
21:33:56: D3D9 : RenderSystem Option: VSync = No
21:33:56: D3D9 : RenderSystem Option: Video Mode = 1024 x 768 @ 32-bit colour
21:33:56: D3D9 : RenderSystem Option: sRGB Gamma Conversion = No
21:33:56: CPU Identifier & Features
21:33:56: -------------------------
21:33:56: * CPU ID: GenuineIntel: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
21:33:56: * SSE: yes
21:33:56: * SSE2: yes
21:33:56: * SSE3: yes
21:33:56: * MMX: yes
21:33:56: * MMXEXT: yes
21:33:56: * 3DNOW: no
21:33:56: * 3DNOWEXT: no
21:33:56: * CMOV: yes
21:33:56: * TSC: yes
21:33:56: * FPU: yes
21:33:56: * PRO: yes
21:33:56: * HT: no
21:33:56: -------------------------
21:33:56: D3D9 : Subsystem Initialising
21:33:56: D3D9RenderSystem::_createRenderWindow "OGGApp", 1024x768 windowed miscParams: FSAA=0 FSAAQuality=0 colourDepth=32 gamma=false useNVPerfHUD=false vsync=false
21:33:56: D3D9 : Created D3D9 Rendering Window 'OGGApp' : 1024x768, 32bpp
21:33:56: D3D9 : WARNING - disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
21:33:56: Registering ResourceManager for type Texture
21:33:56: Registering ResourceManager for type GpuProgram
21:33:56: RenderSystem capabilities
21:33:56: -------------------------
21:33:56: RenderSystem Name: Direct3D9 Rendering Subsystem
21:33:56: GPU Vendor: ati
21:33:56: Device Name: Radeon X1950 Pro
21:33:56: Driver Version: 6.14.10.6891
21:33:56: * Fixed function pipeline: yes
21:33:56: * Hardware generation of mipmaps: yes
21:33:56: * Texture blending: yes
21:33:56: * Anisotropic texture filtering: yes
21:33:56: * Dot product texture operation: yes
21:33:56: * Cube mapping: yes
21:33:56: * Hardware stencil buffer: yes
21:33:56: - Stencil depth: 8
21:33:56: - Two sided stencil support: yes
21:33:56: - Wrap stencil values: yes
21:33:56: * Hardware vertex / index buffers: yes
21:33:56: * Vertex programs: yes
21:33:56: * Fragment programs: yes
21:33:56: * Geometry programs: no
21:33:56: * Supported Shader Profiles: hlsl ps_1_1 ps_1_2 ps_1_3 ps_1_4 ps_2_0 ps_2_a ps_2_b ps_2_x ps_3_0 vs_1_1 vs_2_0 vs_2_a vs_2_x vs_3_0
21:33:56: * Texture Compression: yes
21:33:56: - DXT: yes
21:33:56: - VTC: no
21:33:56: * Scissor Rectangle: yes
21:33:56: * Hardware Occlusion Query: yes
21:33:56: * User clip planes: yes
21:33:56: * VET_UBYTE4 vertex element type: yes
21:33:56: * Infinite far plane projection: yes
21:33:56: * Hardware render-to-texture: yes
21:33:56: * Floating point textures: yes
21:33:56: * Non-power-of-two textures: yes (limited)
21:33:56: * Volume textures: yes
21:33:56: * Multiple Render Targets: 4
21:33:56: - With different bit depths: no
21:33:56: * Point Sprites: yes
21:33:56: * Extended point parameters: yes
21:33:56: * Max Point Size: 256
21:33:56: * Vertex texture fetch: no
21:33:56: * Render to Vertex Buffer : no
21:33:56: * DirectX per stage constants: no
21:33:56: ***************************************
21:33:56: *** D3D9 : Subsystem Initialised OK ***
21:33:56: ***************************************
21:33:56: ResourceBackgroundQueue - threading disabled
21:33:56: Particle Renderer Type 'billboard' registered
21:33:56: Parsing scripts for resource group Autodetect
21:33:56: Finished parsing scripts for resource group Autodetect
21:33:56: Parsing scripts for resource group Bootstrap
21:33:56: Parsing script OgreCore.material
21:33:56: Parsing script OgreProfiler.material
21:33:56: Parsing script Ogre.fontdef
21:33:56: Parsing script OgreDebugPanel.overlay
21:33:56: Texture: New_Ogre_Border_Center.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
21:33:56: Texture: New_Ogre_Border.png: Loading 1 faces(PF_A8R8G8B8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
21:33:56: Texture: New_Ogre_Border_Break.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
21:33:56: Font BlueHighwayusing texture size 512x512
21:33:56: Info: Freetype returned null for character 127 in font BlueHighway
21:33:56: Info: Freetype returned null for character 128 in font BlueHighway
21:33:56: Info: Freetype returned null for character 129 in font BlueHighway
21:33:56: Info: Freetype returned null for character 130 in font BlueHighway
21:33:56: Info: Freetype returned null for character 131 in font BlueHighway
21:33:56: Info: Freetype returned null for character 132 in font BlueHighway
21:33:56: Info: Freetype returned null for character 133 in font BlueHighway
21:33:56: Info: Freetype returned null for character 134 in font BlueHighway
21:33:56: Info: Freetype returned null for character 135 in font BlueHighway
21:33:56: Info: Freetype returned null for character 136 in font BlueHighway
21:33:56: Info: Freetype returned null for character 137 in font BlueHighway
21:33:56: Info: Freetype returned null for character 138 in font BlueHighway
21:33:56: Info: Freetype returned null for character 139 in font BlueHighway
21:33:56: Info: Freetype returned null for character 140 in font BlueHighway
21:33:56: Info: Freetype returned null for character 141 in font BlueHighway
21:33:56: Info: Freetype returned null for character 142 in font BlueHighway
21:33:56: Info: Freetype returned null for character 143 in font BlueHighway
21:33:56: Info: Freetype returned null for character 144 in font BlueHighway
21:33:56: Info: Freetype returned null for character 145 in font BlueHighway
21:33:56: Info: Freetype returned null for character 146 in font BlueHighway
21:33:56: Info: Freetype returned null for character 147 in font BlueHighway
21:33:56: Info: Freetype returned null for character 148 in font BlueHighway
21:33:56: Info: Freetype returned null for character 149 in font BlueHighway
21:33:56: Info: Freetype returned null for character 150 in font BlueHighway
21:33:56: Info: Freetype returned null for character 151 in font BlueHighway
21:33:56: Info: Freetype returned null for character 152 in font BlueHighway
21:33:56: Info: Freetype returned null for character 153 in font BlueHighway
21:33:56: Info: Freetype returned null for character 154 in font BlueHighway
21:33:56: Info: Freetype returned null for character 155 in font BlueHighway
21:33:56: Info: Freetype returned null for character 156 in font BlueHighway
21:33:56: Info: Freetype returned null for character 157 in font BlueHighway
21:33:56: Info: Freetype returned null for character 158 in font BlueHighway
21:33:56: Info: Freetype returned null for character 159 in font BlueHighway
21:33:56: Info: Freetype returned null for character 160 in font BlueHighway
21:33:56: Texture: BlueHighwayTexture: Loading 1 faces(PF_BYTE_LA,512x512x1) with 0 generated mipmaps from Image. Internal format is PF_BYTE_LA,512x512x1.
21:33:56: Texture: ogretext.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
21:33:56: Parsing script OgreLoadingPanel.overlay
21:33:56: Finished parsing scripts for resource group Bootstrap
21:33:56: Parsing scripts for resource group General
21:33:56: Parsing script sample.fontdef
21:33:56: Finished parsing scripts for resource group General
21:33:56: Parsing scripts for resource group Internal
21:33:56: Finished parsing scripts for resource group Internal
21:33:56: ***********************************
21:33:56: *** --- Initialising OpenAL --- ***
21:33:56: ***********************************
21:33:57: *** --- OpenAL version 1.1
21:33:57: *** --- AVAILABLE DEVICES --- ***
21:33:57: *** --- SB Audigy 2 Audio [D000]
21:33:57: *** --- Generic Hardware
21:33:57: *** --- Generic Software
21:33:57: *** --- Choosing: SB Audigy 2 Audio [D000] (Default device)
21:33:57: *** --- OpenAL Device successfully created
21:33:57: *** --- OpenAL Context successfully created
21:33:57: *** --- SUPPORTED FORMATS
21:33:57: *** --- EFX Detected
21:33:57: *** --- 2 Auxiliary Effect Slot(s)
21:33:57: *** --- 2 Auxiliary Send(s) per Source
21:33:57: *** --- EFFECTS SUPPORTED:
21:33:57: *** --- 'Reverb' Support: YES
21:33:57: *** --- 'EAX Reverb' Support: YES
21:33:57: *** --- 'Chorus' Support: YES
21:33:57: *** --- 'Distortion' Support: YES
21:33:57: *** --- 'Echo' Support: YES
21:33:57: *** --- 'Flanger' Support: YES
21:33:57: *** --- 'Frequency shifter' Support: YES
21:33:57: *** --- 'Vocal Morpher' Support: YES
21:33:57: *** --- 'Pitch shifter' Support: YES
21:33:57: *** --- 'Ring modulator' Support: YES
21:33:57: *** --- 'Autowah' Support: YES
21:33:57: *** --- 'Compressor' Support: YES
21:33:57: *** --- 'Equalizer' Support: YES
21:33:57: *** --- FILTERS SUPPORTED:
21:33:57: *** --- 'Low Pass' Support: YES
21:33:57: *** --- 'High Pass' Support: NO
21:33:57: *** --- 'Band Pass' Support: NO
21:33:57: *** --- XRAM NOT Detected
21:33:57: *** --- EAX 4.0 Detected
21:33:57: *** --- Created 61 sources for simultaneous sounds
21:33:57: *** --- Using BOOST threads for streaming
21:33:57: *** --- Recording devices available:
21:33:57: ***--- 'SB Audigy 2 Audio [D000]'
21:33:57: ***********************************
21:33:57: *** --- OpenAL Initialised --- ***
21:33:57: ***********************************

stickymango

26-01-2009 17:33:57

Can you debug whats not valid at that point?

I've just tried a quick test with your code and its fine, it looks like your mCamera variable might be invalid, try:mCamNode->attachObject(mSoundManager->getListener());

MusgooDKZ

26-01-2009 18:46:16

Thanks for reply

I tried

mCamNode->attachObject(mSoundManager->getListener());

but the same result- crash (((

stickymango

26-01-2009 19:20:03

Can you put together a test app and upload it somewhere so I can have a look?

MusgooDKZ

27-01-2009 15:30:30

http://depositfiles.com/files/6d0xd757y

source+exe

stickymango

27-01-2009 16:05:43

Okay, had a quick look and noticed your loading the library as a plugin but also creating the OgreOggSoundManager with new, you DON'T need to do that,

change:mSoundManager = new OgreOggSound::OgreOggSoundManager();
tomSoundManager = OgreOggSound::OgreOggSoundManager::getSingletonPtr();
also remove:delete mSoundManager;
from your destructor.

HTH

MusgooDKZ

27-01-2009 17:08:05

ok, I have replaced lines as you said:



change:mSoundManager = new OgreOggSound::OgreOggSoundManager();
tomSoundManager = OgreOggSound::OgreOggSoundManager::getSingletonPtr();
also remove:delete mSoundManager;
from your destructor.



But nothing has changed, it's still crashes on mCamNode->attachObject(mSoundManager->getListener());

stickymango

27-01-2009 17:11:37

I don't know then, your example you sent me works fine here, maybe its elsewhere..

MusgooDKZ

27-01-2009 17:45:24

Try to compile and run with mCamNode->attachObject(mSoundManager->getListener()); the example i sent

it's works fine ?

stickymango

27-01-2009 19:23:54

yep, only after i changed the code but yes it loaded and ran fine...

[edit] If I'm honest though, I only compiled and ran the debug version which worked, looking at the release version it seems you have the 'Runtime Library' set wrong, it should be Multi-threaded dll NOT mulithreaded..
Have you applied SP1 for visual studio? are you using express? It seems like your setup seems incorrect somewhere...

MusgooDKZ

28-01-2009 13:17:39

thanks again stickymango

I have VS 2005 t.s. SP1
also i set Multi-threaded dll in project options and this has not solved a problem ((

can you put somewhere project (which I have sent) recompiled by you in release o debug mode with .exe and all dlls ?

stickymango

28-01-2009 14:11:20

Okay, finally got release and debug working, although I had to switch to Multithreaded /MT for it not to complain about MSVCP80.dll :?

Download the latest SVN to fix the stream crash you highlighted..

http://www.megaupload.com/?d=9035UB9C

HTH.

MusgooDKZ

29-01-2009 17:29:45

Ok, i got some result here
example compiles, works normally in debug mode
but, release mode still craches with mCamNode->attachObject(mSoundManager->getListener());

stickymango

29-01-2009 20:57:40

I don't know what to suggest, I'm certain its nothing to do with the library, as I use it daily across a number of applications and attach and detach the listener frequently and have no problems.

Sorry I can't think of anything else :(

MusgooDKZ

30-01-2009 21:23:48

Thank you for help stickymango !

Problem solved. I had change some compiling options in the VS and finally release get works fine !

stickymango

30-01-2009 23:02:46

Woohoo!

Glad its sorted now :D

sinop6

07-04-2009 16:50:14

Hi there,

I've got exactly the same problem here... could you tell me what are the compiling options you've changed MusgooDKZ ?

stickymango

09-04-2009 16:37:44

Make sure your compiling with the /MD (Multithreaded dll) option set.

sinop6

10-04-2009 08:46:35

Thanks for your reply,

the /MD Option is set.
I've read the forum before posting, and i've already try many options.

Any other idea to fix this problem?

MusgooDKZ

10-04-2009 09:22:02

Try this options

Linker->General->Enable Incremental Linking->Yes(/Incremental)
Linker->General->Link Library Debendencies->Yes
Linker->General->Use Unicode Response Files->Yes

If still doesn't work, try this

Linker->Optimization-> (All)->Default
C/C++->Optimization->Optimization->Disabled(/Od)
C/C++->Optimization->Whole program Optimization->No

sinop6

10-04-2009 18:19:43

Thank you guys for your reply.

I finally made it work by compiling the dll with VS 9. I hadn't noticed that the dll's were compilied under VS 8, it's my fault, sry.

(by the way, you've made a good work with this dll. This is he first time i'm working on a sound engine, and I really enjoy using OgreOggSound)

PS : sry about my english talking but I'm french :P

stickymango

10-04-2009 23:02:31

Ah yes, I still use vc2005 for now so I'll try and make that more obvious in the documentation to prevent a recurrence, sorry about that :oops:

Thanks for the kind words :)

chaosavy

30-11-2010 21:35:10

thanks to this thread and specifically the info copied/pasted my release build works as well.

thanks to all

Try this options

Linker->General->Enable Incremental Linking->Yes(/Incremental)
Linker->General->Link Library Debendencies->Yes
Linker->General->Use Unicode Response Files->Yes

If still doesn't work, try this

Linker->Optimization-> (All)->Default
C/C++->Optimization->Optimization->Disabled(/Od)
C/C++->Optimization->Whole program Optimization->No