Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (426)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (466)
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: AL.AL_BUFFERS_PROCESSED + Mac OS X 10.5.3 = not working on: 2008-12-30 22:09:55
Hi!

sorry to bump this thread ... but this problem still exists and it would be very nice if someone of the owners of this project could give me an update ... is joal still developed or is it currently on hold? or maybe is there anyone who can give me a hint how to fix this problem on my own?

thank you very much!

kind regards,
ho
2  Java Game APIs & Engines / Java Sound & OpenAL / [Solved] Universal binary nightly build is missing (Mac OS X) on: 2008-12-30 22:01:49
Hi!

I can't find the nightly universal binaries for mac os x on https://joal.dev.java.net/ ... have you dropped the support for universal binaries? or maybe the build process fails? i would need them very badly to test them with the java 1.6 64 bit update ... because the ones i'm using now are causing an unsatisfied link error in combination with java 1.6 64 bit and with java 1.5 they work flawlessly.

edit: joal nightly universal binary build is now available and also working with java 1.6 =)

thank you very much!
Ho

3  Java Game APIs & Engines / Java Sound & OpenAL / AL.AL_BUFFERS_PROCESSED + Mac OS X 10.5.3 = not working on: 2008-06-26 22:01:58
Hi!

When trying to get the processed buffers on mac osx 10.5.3 (on a macbook) with this code:

1  
2  
int [] result = new int[1];
al.alGetSourcei( getSourceID(  ), AL.AL_BUFFERS_PROCESSED, result, 0 );


the result variable will always contain 0 as value.

but the same code runs fine on a windows machine and returns exactly the count of processed buffers, could it be that there is a little bug in the joal mac os native code?
because all joal libraries i'm using are up to date (v. 1.1.2 universal binaries) and i can hear sounds which don't use the queuing/streaming technique.

edit:

after thinking about what else could go wrong under mac os when using the queuing technique, i thought maybe the function alSourceQueueBuffers() which is used to queue buffers on a source is broken:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
   public void queueBuffers( OpenALBuffer [] buffers ) {
      int numBuffers = buffers.length;
      int [] arr = new int[numBuffers];

      for ( int i = 0; i < numBuffers; i++ ) {
         arr [i] = buffers [i].bufferID;
      }

      al.alSourceQueueBuffers( getSourceID(  ), numBuffers, arr, 0 );
   }


and therefore no buffers get queued on the source and when trying to query how many buffers have been processed the function returns 0.

thanks for your help =)

kind regards,
ho
4  Java Game APIs & Engines / JOGL Development / Textures in RAM & VRAM? on: 2006-10-21 15:18:56
Hi!

I have a strange expirience with the textures in my game, i'm using the TextureIO class to generate the textures from my images, first i'm creating a TextureData object which gets a buffered image with the image data, after that i create the texture using TextureIO.newTexture() with the TextureData object, everything is working nicely except that somehow the texture is hold in RAM & in VRAM when i call texture.dispose the texture gets removed from RAM & VRAM. I don't know if it should work like this but i thought once i call TextureIO.newTexture the texture gets uploaded from RAM to the VRAM and thus isn't resident in RAM anymore.

I also thought that the texture might hold a reference to the TextureData object which isn't removed properly, but there isn't a good documentation on how to use the Fluser interface provided by jogl so i havn't tryed it yet.

here's some code snipped how i'm doing the texture generation:

1  
2  
3  
4  
TextureData textureData = TextureIO.newTextureData( bufferedImage , true );
textureData.getBuffer(  ).rewind(  );
Texture texture = TextureIO.newTexture( textureData);
textureData.setBuffer(null);


i hope that someone can help me solve this problem, and if it's not solvable i would like to know why the textures are hold in RAM & VRAM.

thanks in advance
greetings from vienna (austria)
5  Java Game APIs & Engines / Java Sound & OpenAL / Re: Moving sound problems on: 2006-10-18 10:59:30
Hi!

please check if the listener is setup correctly:

1  
2  
3  
4  
      
al.alListenerfv(AL.AL_POSITION, listenerPos, 0);
al.alListenerfv(AL.AL_VELOCITY, listenerVel, 0);      
al.alListenerfv(AL.AL_ORIENTATION, listenerOri, 0);


try setting up the source with a distance model of you choice and make sure that all variables used by the distance formula are set correctly
look here for more information about that: http://www.openal.org/oalspecs-specs/attenuation-by-distance.html

last but not least also make sure that you are playing a MONO wav file, openal can't fade a source with Stereo data

i hope this will help you! if not please post more of the source code!
have a nice day!

greetings from austria
6  Java Game APIs & Engines / Java Sound & OpenAL / Re: JOAL and Ogg file on: 2006-09-11 18:36:03
take a closer look on the http://home.halden.net/tombr/ogg/OggPlayer.java file which streams the oggfile into some buffers which then will be played by openal. maybe you want to have a look at a pseudo code description of the openal streaming which i posted some time ago http://www.java-gaming.org/forums/index.php?topic=14433.msg114674#msg114674

i hope this will help you a little bit ...

7  Java Game APIs & Engines / Java Sound & OpenAL / Re: [SOLVED] JOAL & Streaming = memory leaking? on: 2006-07-22 14:24:09
as i described in the previous post, this is how it works.  Smiley

thank you Ken & Ultraq for pointing me in the right direction!
8  Java Game APIs & Engines / Java Sound & OpenAL / Re: JOAL & Streaming = memory leaking? on: 2006-07-22 10:35:59
thank you guys for your answers, they should help me a lot!

as far as i understand now things should work like this:

1. i have to initialise the source with an array of int values, bind some data to them, and queue them up on the source using alSourceQueueBuffers()
2. i check if a buffer has been processed by the source via the alGetSourcei() method
3. if a buffer has been processed i can now call the alSourceUnqueueBuffers() method with a new int [] array which the function fills with the id from the unqueued buffer
4. i can  bind some new data to it using the al.alBufferData()
5. i queue the new initialised buffer to the source using alSourceQueueBuffers()
6. repeat steps 2-6 until there is no more data to stream from a file.

i hope i now understand it in the right way.

thanks very much
martin
9  Java Game APIs & Engines / Java Sound & OpenAL / [SOLVED] JOAL & Streaming = memory leaking? on: 2006-07-21 16:00:12
hi, i hope someone of you guys can help me or point me in the right direction.

first here's my setup:

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  
      

//if it's the first time we pass this section here the source is initialised with 2 buffers (this two buffers are different to the buffers which are used for the queuing)
if (!environmentSource.isInit()){
   System.out.println("Init");
        //This function inits the buffers with the start data of a wav file
  queueBuffers = ressMan.getBufferInitQueue(2, sourceID, queueBuffers);
   //Then i queue the buffers up on the source          
  environmentSource.queueBuffers(queueBuffers);          
    environmentSource.setInit(true);
}


//Here's the part where the things go wrong
//I made it similar to the update() method in http://home.halden.net/tombr/ogg/OggPlayer.java        
if ((environmentSource.getBuffersProcessed()>0)){

      //This is the buffer which will be queued next on the source (do i need a existing one here, or can i use a newly generated?)
     environmentSource.queueBuffer = OpenALFactory.generateBuffers(1);            
   
     //Now i trie to unqueue the new generated buffer          
     environmentSource.unqueueBuffers(environmentSource.queueBuffer);
   
     //Load data to the buffer            
    ressMan.getBufferQueue(1, sourceID, environmentSource.queueBuffer);
   
     //Queue the buffer          
    environmentSource.queueBuffers( environmentSource.queueBuffer);
}


as u can see i'm using some functions from the Audio3D package provided with JOAL (i extendet them a little bit, just for my needs).
all buffer variables are Sound3D.Buffers, the loading of the data from the wav file works really fine. i also hear the sound and the streaming works but
i get a linear increase of memory usage because of calling:

1  
environmentSource.queueBuffer = OpenALFactory.generateBuffers(1);


every time the source processed a buffer, but the unqeue function isn't releasing the memory of the Buffer, i also tried to reuse the buffer but with the effect that only the data from the initialisation is queued each time?

it would be very helpful if someone could explain me what the alSourceUnqueueBuffers() really does (and how to use it in JOAL)?
 and maybe how the streaming really works! And please don't point me to tutorials which are written in C++, i already read them and they're all using pointers to queue the buffers on the sources, since there are no pointers in java, this won't help me, unless you know how to do something simillar in java.

it would really help me if you could port me this 2 functions to JOAL
 
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  
47  
48  
49  
50  
51  
52  
bool ogg_stream::update()
{
    int processed;
    bool active = true;
 
    alGetSourcei(source, AL_BUFFERS_PROCESSED, &processed);
 
    while(processed--)
    {
        ALuint buffer;
       
        alSourceUnqueueBuffers(source, 1, &buffer);
        check();
 
        active = stream(buffer);
 
        alSourceQueueBuffers(source, 1, &buffer);
        check();
    }
 
    return active;
}


bool ogg_stream::stream(ALuint buffer)
{
    char data[BUFFER_SIZE];
    int  size = 0;
    int  section;
    int  result;
 
    while(size < BUFFER_SIZE)
    {
        result = ov_read(&oggStream, data + size, BUFFER_SIZE - size, 0, 2, 1, & section);
   
        if(result > 0)
            size += result;
        else
            if(result < 0)
                throw oggString(result);
            else
                break;
    }
   
    if(size == 0)
        return false;
 
    alBufferData(buffer, format, data, size, vorbisInfo->rate);
    check();
 
    return false;
}


i really hope someone can explain it to me!
thanks in advance
martin
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (72 views)
2014-04-15 18:08:23

BurntPizza (68 views)
2014-04-15 03:46:01

UprightPath (79 views)
2014-04-14 17:39:50

UprightPath (65 views)
2014-04-14 17:35:47

Porlus (80 views)
2014-04-14 15:48:38

tom_mai78101 (104 views)
2014-04-10 04:04:31

BurntPizza (164 views)
2014-04-08 23:06:04

tom_mai78101 (260 views)
2014-04-05 13:34:39

trollwarrior1 (210 views)
2014-04-04 12:06:45

CJLetsGame (220 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!