Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (537)
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  
  Error generating lots of Sources  (Read 2619 times)
0 Members and 1 Guest are viewing this topic.
Offline BrackishWater

Senior Newbie




I love YaBB 1G - SP1!


« Posted 2005-12-29 20: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
AL_INVALID_VALUE

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.

Offline BrackishWater

Senior Newbie




I love YaBB 1G - SP1!


« Reply #1 - Posted 2005-12-29 20:51:34 »

Okay, I just ran the SourcesSharingBuffers.java 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?
Offline BrackishWater

Senior Newbie




I love YaBB 1G - SP1!


« Reply #2 - Posted 2005-12-29 22: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?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #3 - Posted 2005-12-29 22:25:29 »

I don't see the problem you're seeing wtih the SourcesSharingBuffers demo. What is the device name reported by that demo? Using the "Generic Software" driver and the OpenAL 1.1 binaries from openal.org 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.
Offline BrackishWater

Senior Newbie




I love YaBB 1G - SP1!


« Reply #4 - Posted 2005-12-29 22: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);
        alc.alcMakeContextCurrent(context);

... 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 openal.org 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.

WinXP
Intel P4 3gHz
1GB RAM
Creative 5.1 Soundcard
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #5 - Posted 2005-12-29 23:36:20 »

I don't have any confidence in the current JOAL binaries that are out there. Could you please try upgrading to these?

http://www.rawbw.com/~kbrussel/joaltmp/joal.jar
http://www.rawbw.com/~kbrussel/joaltmp/joal_native.dll
http://www.rawbw.com/~kbrussel/joaltmp/javadoc_public.zip
http://www.rawbw.com/~kbrussel/joaltmp/joal-demos.jar

These are current Windows binaries from the gluegen-branch-1-0 branch of the JOAL tree. I have high confidence that the native code is correct and that calls like alcOpenDevice(null) should work fine. The public APIs have changed somewhat from the current JOAL out there but on the whole your application shouldn't require much modification (addition of offset parameters when passing down arrays, ALC.Device and ALC.Context promoted to top-level data types, and some other changes). Please try these and let me know if the behavior is any different / better or whether the problems you're seeing are still present.
Offline BrackishWater

Senior Newbie




I love YaBB 1G - SP1!


« Reply #6 - Posted 2005-12-30 00: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
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #7 - Posted 2005-12-30 00:44:25 »

If you have the time at some point to do a test with just the demos.devmaster.lesson5.SourcesSharingBuffers demo from the binaries I sent you, I would be interested to know whether the new JOAL behaves any differently or better than the version you're currently using.
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.

CogWheelz (17 views)
2014-08-01 22:53:16

CogWheelz (15 views)
2014-08-01 22:51:43

CopyableCougar4 (20 views)
2014-08-01 19:37:19

CogWheelz (19 views)
2014-07-30 21:08:39

Riven (27 views)
2014-07-29 18:09:19

Riven (16 views)
2014-07-29 18:08:52

Dwinin (14 views)
2014-07-29 10:59:34

E.R. Fleming (42 views)
2014-07-29 03:07:13

E.R. Fleming (13 views)
2014-07-29 03:06:25

pw (44 views)
2014-07-24 01:59:36
Resources for WIP games
by CogWheelz
2014-08-01 18:20:17

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

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

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

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

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22
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!