Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (564)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Crash on alDeleteSources  (Read 1981 times)
0 Members and 1 Guest are viewing this topic.
Offline runevision

Junior Newbie




Java games rock!


« Posted 2004-09-25 21:25:24 »

Hi, I'm having a problem with Joal. The code below crashes Java when I run it. If I change it, so that the sources are deleted in the same order as they are created then there are no problems, but when I delete the sources in a different order than they were created in, then an Java crashes with the error "java.exe has encountered a problem and needs to close. We are sorry for the inconvenience.". Is there anything I can do? Since my system is to be dynamic, I need to be able to delete sources at any point in time, and thus not just in the order they were created...

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
import net.java.games.joal.*;
import net.java.games.joal.util.*;

public class TestSound {
   
    private AL al;
   
    public static void main(String[] args) {
        TestSound se = new TestSound();
    }
   
    public TestSound() {
        try {
            ALut.alutInit();
            al = ALFactory.getAL();
        } catch (OpenALException e) {
            e.printStackTrace();
            System.exit(1);
        }
        al.alGetError();
       
        int[] source0 = new int[1];
        al.alGenSources(1, source0);
        if (al.alGetError() != AL.AL_NO_ERROR) {
            System.err.println("Error generating source0."); System.exit(1);
        }
       
        int[] source1 = new int[1];
        al.alGenSources(1, source1);
        if (al.alGetError() != AL.AL_NO_ERROR) {
            System.err.println("Error generating source1."); System.exit(1);
        }
       
        al.alDeleteSources(1, source1);
        if (al.alGetError() != AL.AL_NO_ERROR) {
            System.err.println("Error destroying source1."); System.exit(1);
        }
       
        al.alDeleteSources(1, source0);
        if (al.alGetError() != AL.AL_NO_ERROR) {
            System.err.println("Error destroying source0."); System.exit(1);
        }
       
        ALut.alutExit();
    }
}



Offline runevision

Junior Newbie




Java games rock!


« Reply #1 - Posted 2004-09-25 21:33:28 »

Ah, it also comes with this error information when I remove the System.exit(1) method calls:


An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x2CD9D94
Function=alDistanceModel+0x1814
Library=D:\WINDOWS\System32\OpenAL32.dll

Current Java thread:
     at net.java.games.joal.ALCImpl.destroyContextNative(Native Method)
     at net.java.games.joal.ALCImpl.alcDestroyContext(ALCImpl.java:112)
     at net.java.games.joal.util.ALut.alutExit(ALut.java:127)
     at TestSound.<init>(TestSound.java:44)
     at TestSound.main(TestSound.java:9)

Dynamic libraries:
0x00400000 - 0x00406000       D:\Program Files\j2sdk_nb\j2sdk1.4.2\jre\bin\java.exe
0x77F50000 - 0x77FF7000       D:\WINDOWS\System32\ntdll.dll
0x77E60000 - 0x77F46000       D:\WINDOWS\system32\kernel32.dll
0x77DD0000 - 0x77E5D000       D:\WINDOWS\system32\ADVAPI32.dll
0x78000000 - 0x78087000       D:\WINDOWS\system32\RPCRT4.dll
0x77C10000 - 0x77C63000       D:\WINDOWS\system32\MSVCRT.dll
0x08000000 - 0x08136000       D:\Program Files\j2sdk_nb\j2sdk1.4.2\jre\bin\client\jvm.dll
0x77D40000 - 0x77DCC000       D:\WINDOWS\system32\USER32.dll
0x7E090000 - 0x7E0D1000       D:\WINDOWS\system32\GDI32.dll
0x76B40000 - 0x76B6C000       D:\WINDOWS\System32\WINMM.dll
0x10000000 - 0x10007000       D:\Program Files\j2sdk_nb\j2sdk1.4.2\jre\bin\hpi.dll
0x003E0000 - 0x003EE000       D:\Program Files\j2sdk_nb\j2sdk1.4.2\jre\bin\verify.dll
0x008A0000 - 0x008B8000       D:\Program Files\j2sdk_nb\j2sdk1.4.2\jre\bin\java.dll
0x003F0000 - 0x003FD000       D:\Program Files\j2sdk_nb\j2sdk1.4.2\jre\bin\zip.dll
0x02CA0000 - 0x02CAF000       C:\Programming\sound\joal.dll
0x02CD0000 - 0x02DA0000       D:\WINDOWS\System32\OpenAL32.dll
0x771B0000 - 0x772D4000       D:\WINDOWS\system32\ole32.dll
0x7C890000 - 0x7C911000       D:\WINDOWS\System32\CLBCATQ.DLL
0x77120000 - 0x771AB000       D:\WINDOWS\system32\OLEAUT32.dll
0x77050000 - 0x77115000       D:\WINDOWS\System32\COMRes.dll
0x77C00000 - 0x77C07000       D:\WINDOWS\system32\VERSION.dll
0x51080000 - 0x510DD000       D:\WINDOWS\System32\dsound.dll
0x72D20000 - 0x72D29000       D:\WINDOWS\System32\wdmaud.drv
0x72D10000 - 0x72D18000       D:\WINDOWS\System32\msacm32.drv
0x77BE0000 - 0x77BF4000       D:\WINDOWS\System32\MSACM32.dll
0x77BD0000 - 0x77BD7000       D:\WINDOWS\System32\midimap.dll
0x5EF80000 - 0x5EF84000       D:\WINDOWS\System32\KsUser.dll
0x76C90000 - 0x76CB2000       D:\WINDOWS\system32\imagehlp.dll
0x6D510000 - 0x6D58D000       D:\WINDOWS\system32\DBGHELP.dll
0x76BF0000 - 0x76BFB000       D:\WINDOWS\System32\PSAPI.DLL

Heap at VM Abort:
Heap
def new generation   total 576K, used 404K [0x10010000, 0x100b0000, 0x104f0000)
 eden space 512K,  79% used [0x10010000, 0x10075380, 0x10090000)
 from space 64K,   0% used [0x10090000, 0x10090000, 0x100a0000)
 to   space 64K,   0% used [0x100a0000, 0x100a0000, 0x100b0000)
tenured generation   total 1408K, used 0K [0x104f0000, 0x10650000, 0x14010000)
  the space 1408K,   0% used [0x104f0000, 0x104f0000, 0x104f0200, 0x10650000)
compacting perm gen  total 4096K, used 1150K [0x14010000, 0x14410000, 0x18010000)
  the space 4096K,  28% used [0x14010000, 0x1412fb30, 0x1412fc00, 0x14410000)

Local Time = Sun Sep 26 01:26:37 2004
Elapsed Time = 0
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2-b28 mixed mode)
#
Offline runevision

Junior Newbie




Java games rock!


« Reply #2 - Posted 2004-09-26 08:43:52 »

If you want to investigate the problem not with basis in my minimal example code, but rather with basis in the demo file MultipleSources.java, then you the crash occurs if you replace the line

       al.alGenSources(NUM_SOURCES, sources);

with these lines that create the sources one by one:

       int[] source0 = new int[1];
       int[] source1 = new int[1];
       int[] source2 = new int[1];
       // not the same order as they will be deleted in:
       al.alGenSources(1, source0);
       al.alGenSources(1, source2);
       al.alGenSources(1, source1);
       sources = new int[] {source0[0],source1[0],source2[0]};

Is there anything I can do to be able to dynamically create and delete sources then?

Rune
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Grunnt (22 views)
2014-09-23 14:38:19

radar3301 (14 views)
2014-09-21 23:33:17

BurntPizza (31 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (29 views)
2014-09-20 20:14:06

BurntPizza (34 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (75 views)
2014-09-10 13:57:51

TehJavaDev (108 views)
2014-09-10 06:39:09
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!