Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001710 [Croquet] Jasmine crash always 08-18-05 18:59 08-18-05 21:15
Reporter schwa View Status public  
Assigned To
Priority normal Resolution open  
Status new  
Summary 0001710: Reproducible OpenAL Walkbacks
Description The easiest way to reproduce this bug is to walk into an OpenAL space, and then collapse and expand the TeapotMorph. Another way is to save, quit, and restart an image where an OpenAL Teapot is open. Once these walkbacks occur, you can't even delete the teapot (just causes more walkbacks).

Ultimately, the problem is that an instance of the OpenAL class does not store a handle to an OpenAL context, so there is no way to tell whether OpenAL is in a valid state (contrast this with OpenGL>>destroy... it is clear that an OpenGL context is invalid when the 'handle' iVar is nil). The OpenAL code uses the deprecated function alutInit(), which does not do any error checking and does not return a handle to an OpenAL context. See the following links (search the latter for 'alut'): [^] [^]

Although alutInit() and alutExit() may be sufficient for a simple C program, they are not appropriate for a dynamic object environment that can be snapshotted and restarted. Instead, we should use functions like alcCreateContext() and alcDestroyContext() to explicitly manage the lifetime of OpenAL contexts (Jasmine's OpenGL support hides these in the plugin with #primDestroyRenderer: and #primCreateRenderer:x:y:w:h:).

Another example is the support that I have written for Nvidia's Cg. I haven't pushed this into Jasmine because DAS advised against major changes since Hedgehog is coming Real Soon Now, but I have added code to OpenGL to allow additional APIs to be supported without requiring further changes to OpenGL (only method additions, no new iVars necessary). If anyone wants to use this for OpenAL, too, let me know. Even though the lifetimes of a Cg and OpenGL are much more closely related than to that of an OpenAL context, I think that it would be quite reasonable to create/destroy/re-create OpenAL contexts at the same time as the other context types (eg: collapse/expand window, quit/restart image, etc.)
Additional Information
Attached Files

- Relationships

- Notes
(0002424 - 673 - 685 - 685 - 685 - 685 - 685)
08-18-05 21:15

alutInit() and alutExit() are never actaully called in the plugin. The plugin primitives primAlutInit and primAlutExit instead call alcCreateContext() and alcDestroyContext() directly. This hides the details of opening and closing devices and creating contexts much like the OpenGL methods you described above do. I agree that the names are confusing and poorly chosen. It should be fairly easy to have primAlutInit (or whatever the name should be) return the new context.

I would be very interested in seeing what youve done for Cg. As far as what is already in Jasmine, where should I be looking? I'm guessing that you are refering to OpenGLName and OpenGLNameManager.

- Issue History
Date Modified Username Field Change
08-18-05 18:59 schwa New Issue
08-18-05 21:15 pmoore Note Added: 0002424
08-18-05 21:17 pmoore Issue Monitored: pmoore

Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
34 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker