Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (731)
Games in Android Showcase (217)
games submitted by our members
Games in WIP (800)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Java Sound & OpenAL / Re: Choose audio device from list on: 2005-12-30 21:13:08
yeah, i read that thread and responded about that on my earlier thread
i get a nullpointer when I try to do "the hack"
i think that bug has been fixed in JOAL, but i'm still using the old joal build so i guess i must upgrade at this point  Undecided

i had the feeling that my hardware may not have been used correctly (since i have a good soundcard, or so i thougt) as 30 sources are the max for my system, and i read about one guy who was getting 256 on his laptop...

at any rate, i have my system working bug-free
but if there are more than 30 sounds playing at once, i have to steal a source that's playing and stop it and recycle it for the latest request

i'm sticking with that and looking into other issues at this point, but please let me know if you think i'm confused about what i'm doing

and thanks for you help this week, it's been invaluable!  Cheesy
2  Java Game APIs & Engines / Java Sound & OpenAL / Choose audio device from list on: 2005-12-30 19:57:49
How can I programatically get a list of available audio devices with JOAL?

I looked at the demos and even the Jake2 source and they are all doing it the same way:

        String deviceName = "DirectSound3D";
        device = alc.alcOpenDevice(deviceName);
        deviceSpecifier = alc.alcGetString(device, ALC.ALC_DEVICE_SPECIFIER);

the problem is that (at least for my system) the deviceSpecifier always returns "Generic Hardware". Meanwhile, I have a great sound card that i'd like to use, but I have no idea if JOAL is using it or not. Additionally, I'd like to choose which audio device to use if there are more than one. Please advise.
3  Java Game APIs & Engines / Java Sound & OpenAL / Re: Error generating lots of Sources on: 2005-12-29 23:07:49
Thanks for all your help. I finally got the code working, whew! I'm reusing the sources and simply binding them to new buffers as needed, and pooling my resources of course. But I'm still using the old jar/dll for now. I just don't feel like changing the code now that it works.  Grin
4  Java Game APIs & Engines / Java Sound & OpenAL / Re: Error generating lots of Sources on: 2005-12-29 21:41:20
> I don't see the problem you're seeing wtih the SourcesSharingBuffers demo.

Well, I found other people with the same problem and there seems to be a definite limit to how many sources you can create, and they should be reused from what I can tell

> What is the device name reported by that demo?

"Generic Hardware" - which isn't good because I have a NICE sound card and cannot find out how to get an enumerated list of available devices or select one or what not. Here's the code I'm using:

        ALC.Device device = null;
        ALC.Context context;
        String deviceSpecifier = null;
        String deviceName = "DirectSound3D";
        device = alc.alcOpenDevice(deviceName);
        deviceSpecifier = alc.alcGetString(device, ALC.ALC_DEVICE_SPECIFIER);
        context = alc.alcCreateContext(device, null);

... I don't like the idea of hard coding "DirectSound3D", but when I do this: device = alc.alcOpenDevice(null) I get a NullPointerException, which I shouldn't be getting, or at least OpenAL won't blow up on that call (from what I can tell).

> Using the "Generic Software" driver and the OpenAL 1.1 binaries from I was easily able to add 100+ water drops without any errors being reported from alGenSources. I don't know whether there might be a bug in the glue code for the version of JOAL you're using but I'm using the gluegen-branch-1-0 branch in which all of the JNI code, etc. has been rewritten. If you would like me to post a test binary for you to try let me know which platform you're on.

Well, again, I think all I need to know is how to attach a source to a buffer (without using al.alGenSources()). That and how do I get a list of available devices?

But any help is greatly appreciated.

Intel P4 3gHz
Creative 5.1 Soundcard
5  Java Game APIs & Engines / Java Sound & OpenAL / Re: Error generating lots of Sources on: 2005-12-29 21:11:58
okay, i know what i need to do. i found this in another thread:

1. Generate about 16 sources in an array.
2. Create an array of bool values to track which one is in use and which are free.
3. When you want to play a buffer, a sound, find a location using the bool lookup array. Send the buffer to that source.
4. Once every so often, every frame if you want, check the state of each source. Any state that reports a stopped state, set the bool flag in the array to 0 so you know that you can use it again.

here's my problem: i have no idea how to bind/rebing a source to a buffer. i don't see anything in the api that will bind an existing source to a different buffer for reuse. anyone?
6  Java Game APIs & Engines / Java Sound & OpenAL / Re: Error generating lots of Sources on: 2005-12-29 19:51:34
Okay, I just ran the demo and it does the exact same thing.

So then I tried calling alDeleteSources() before calling alGenSources() again, to see if that would fix the problem, but it STILL broke on the 30th sound.

What's the proper way to delete/release and/or reuse Sources?
7  Java Game APIs & Engines / Java Sound & OpenAL / Error generating lots of Sources on: 2005-12-29 19:07:32
I'm trying to load and play many sources. Everything runs fine until I hit sound #30. Trying to generate Source #30 (and all subsequent Sources) throws this error:

Here's what I'm getting:
Error Code = 40963

and I'm calling this method each time:
al.alGenSources(1, source.sourceId);

My question is, can I query the device/context to see how many sounds it supports? Maybe I'm going over my limit (shouldn't be though). Any ideas? I can't find anything in the docs/api.

8  Java Game APIs & Engines / Java Sound & OpenAL / Re: reading wav files located in in a jar file on: 2005-12-28 19:37:05
couldn't you just write your own loader and pass the bytes off to JOAL in some fashion?
9  Java Game APIs & Engines / Java Sound & OpenAL / Object pool for Sources on: 2005-12-28 18:08:06
I'd like to make an object pool of sources and as they get recycled, detach and reattach them to existing buffers on the fly. Anyone see any problems with that?
10  Java Game APIs & Engines / Java Sound & OpenAL / Web Start - JOAL on: 2005-12-27 16:11:36
I apologize in advance if this has been touched upon here. I'm looking for a JOAL web start demo/example. I haven't found anything yet. Any help appreciated.
11  Java Game APIs & Engines / Java Sound & OpenAL / EXCEPTION_ACCESS_VIOLATION running demos on: 2005-04-13 20:57:28
Cheesy I'm new to JOAL, so let's get that out right away. Okay, I downloaded the lessons and got everything configured properly (Im pretty sure anyway), but only two of the four demos run. Here is the list

SingleStaticSource (runs)
LoopingAndFadeaway (crashes)
MultipleSources (crashes)
SourcesSharingBuffers (runs)

My configuration for all 4 is the same, yet only two of them work. Here is my system configuration:

Intel P4 3 gHz with hyperthreading
Creative Labs SBLive 5.1 Soundcard

Any thoughts? Here is the error I get for the two that crash:


    [java] Go TEAM!
    [java] Entering alutInit()
    [java] In alutInit(): Device Name = null

    [java] An unexpected exception has been detected in native code outside the VM.
    [java] Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x0
    [java] Function=[Unknown.]
    [java] Library=(N/A)

    [java] NOTE: We are unable to locate the function name symbol for the error
    [java]       just occurred. Please refer to release documentation for possible
    [java]       reason and solutions.

    [java] Current Java thread:
    [java]     at Method)
    [java]     at
    [java]     at
    [java]     at LoopingAndFadeaway.main(Unknown Source)

    [java] Dynamic libraries:
    [java] 0x00400000 - 0x0040B000     C:\j2sdk1.4.2_05\jre\bin\java.exe
    [java] 0x7C900000 - 0x7C9B0000     C:\WINDOWS\system32\ntdll.dll
    [java] 0x7C800000 - 0x7C8F4000     C:\WINDOWS\system32\kernel32.dll
    [java] 0x77DD0000 - 0x77E6B000     C:\WINDOWS\system32\ADVAPI32.dll
    [java] 0x77E70000 - 0x77F01000     C:\WINDOWS\system32\RPCRT4.dll
    [java] 0x77C10000 - 0x77C68000     C:\WINDOWS\system32\MSVCRT.dll
    [java] 0x08000000 - 0x08139000     C:\j2sdk1.4.2_05\jre\bin\client\jvm.dll
    [java] 0x77D40000 - 0x77DD0000     C:\WINDOWS\system32\USER32.dll
    [java] 0x77F10000 - 0x77F56000     C:\WINDOWS\system32\GDI32.dll
    [java] 0x76B40000 - 0x76B6D000     C:\WINDOWS\system32\WINMM.dll
    [java] 0x10000000 - 0x10007000     C:\j2sdk1.4.2_05\jre\bin\hpi.dll
    [java] 0x00390000 - 0x0039E000     C:\j2sdk1.4.2_05\jre\bin\verify.dll
    [java] 0x003B0000 - 0x003C9000     C:\j2sdk1.4.2_05\jre\bin\java.dll
    [java] 0x003D0000 - 0x003DD000     C:\j2sdk1.4.2_05\jre\bin\zip.dll
    [java] 0x02C60000 - 0x02C6F000     C:\j2sdk1.4.2_05\jre\bin\joal.dll
    [java] 0x02C90000 - 0x02CA4000     C:\WINDOWS\system32\OpenAL32.dll
    [java] 0x72D20000 - 0x72D29000     C:\WINDOWS\system32\wdmaud.drv
    [java] 0x76C30000 - 0x76C5E000     C:\WINDOWS\system32\WINTRUST.dll
    [java] 0x77A80000 - 0x77B14000     C:\WINDOWS\system32\CRYPT32.dll
    [java] 0x77B20000 - 0x77B32000     C:\WINDOWS\system32\MSASN1.dll
    [java] 0x76C90000 - 0x76CB8000     C:\WINDOWS\system32\IMAGEHLP.dll
    [java] 0x72D10000 - 0x72D18000     C:\WINDOWS\system32\msacm32.drv
    [java] 0x77BE0000 - 0x77BF5000     C:\WINDOWS\system32\MSACM32.dll
    [java] 0x77BD0000 - 0x77BD7000     C:\WINDOWS\system32\midimap.dll
    [java] 0x59A60000 - 0x59B01000     C:\WINDOWS\system32\DBGHELP.dll
    [java] 0x77C00000 - 0x77C08000     C:\WINDOWS\system32\VERSION.dll
    [java] 0x76BF0000 - 0x76BFB000     C:\WINDOWS\system32\PSAPI.DLL

    [java] Heap at VM Abort:
    [java] Heap
    [java]  def new generation   total 576K, used 249K [0x10010000, 0x100b0000, 0x104f0000)
    [java]   eden space 512K,  48% used [0x10010000, 0x1004e6c8, 0x10090000)
    [java]   from space 64K,   0% used [0x10090000, 0x10090000, 0x100a0000)
    [java]   to   space 64K,   0% used [0x100a0000, 0x100a0000, 0x100b0000)
    [java]  tenured generation   total 1408K, used 0K [0x104f0000, 0x10650000, 0x14010000)
    [java]    the space 1408K,   0% used [0x104f0000, 0x104f0000, 0x104f0200, 0x10650000)
    [java]  compacting perm gen  total 4096K, used 1122K [0x14010000, 0x14410000, 0x18010000)
    [java]    the space 4096K,  27% used [0x14010000, 0x14128ad0, 0x14128c00, 0x14410000)

    [java] Local Time = Wed Apr 13 18:48:29 2005
    [java] Elapsed Time = 0
    [java] #
    [java] # The exception above was detected in native code outside the VM
    [java] #
    [java] # Java VM: Java HotSpot(TM) Client VM (1.4.2_05-b04 mixed mode)
    [java] #
    [java] # An error report file has been saved as hs_err_pid3884.log.
    [java] # Please refer to the file for further information.
    [java] #
    [java] ALFactory.init - Native: Enter
    [java] ALFactory.init - Native: Exit
    [java] Java Result: 1
12  Game Development / Game Play & Game Design / Re: JDBC in Games on: 2003-12-21 21:35:14
To go in another direction: If you're going to do something large-scale, networked/distributed, then you might want to leverage EJB technology as well. Entity EJB's wrap (basically implementation of DAO pattern) the database using using JDBC at the lower levels, and you don't have to write SQL or JDBC code. The EJB container manages reads/writes for you, and can even manage transactions.

JBoss is a free J2EE environment and comes with okay EJB support, although I'd suggest using WebLogic if you had the money. Not sure what is quality enough for MMOG. In any case, EJB's give you a managed environment. Either that, or check out JMS. JMS introduces the concept of MBeans (managed beans). Point is, for something large-scale, you need container management, proven scalability and reliability, and all that you might find in the J2EE (fault-tolerance, fail-over, clustering).
13  Game Development / Game Play & Game Design / Re: JDBC in Games on: 2003-12-12 00:36:20
I agree with shawnkendall. An ad hoc  solution can be tough, introducing bugs, etc. I'd say it's safer (more cost-effective?) to leverage something like JDBC, which is a  proven and mature technology. JDBC has a great track record, running in mission critical enterprise software.

Also, using a database is MUCH FASTER than accessing flat files! And if you need, JDBC can access flat files, too. ;-)

My quick thoughts are:
- Use a type 4 driver  (no client install)
- Don't use EJB's (unless MMOG - large scale)
- Employ caching/pooling

The Brackish Water

Pages: [1]
Archive (344 views)
2017-04-27 17:45:51

buddyBro (541 views)
2017-04-05 03:38:00

CopyableCougar4 (993 views)
2017-03-24 15:39:42

theagentd (1024 views)
2017-03-24 15:32:08

Rule (998 views)
2017-03-19 12:43:22

Rule (982 views)
2017-03-19 12:42:17

Rule (978 views)
2017-03-19 12:36:21

theagentd (1083 views)
2017-03-16 05:07:07

theagentd (1010 views)
2017-03-15 22:37:06

theagentd (781 views)
2017-03-15 22:32:18
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 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‑
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!