TestJmexAudio like noise

Hi!



When i run jmetest.audio.TestJmexAudio.java the sound plays, but it seems like noise :frowning:



I dont know what it could be. (i thought about sound drivers or openal it self, but i have the lastest packages instaled)



Bellow, a piece of log.



22/10/2007 13:44:40 com.jmex.audio.openal.OpenALSystem setupSourcePool
INFO: max source channels: 64
22/10/2007 13:44:41 com.jmex.audio.util.AudioLoader loadOGG
INFO: version        0
channels        2
rate (hz)      44100
22/10/2007 13:44:42 com.jmex.audio.util.AudioLoader loadOGG
INFO: ogg loaded - time: 30.000023  channels: 2  rate: 44100 depth: 16 bytes: 5292004
22/10/2007 13:44:42 com.jmex.audio.util.AudioLoader loadOGG
INFO: version        0
channels        1
rate (hz)      22050
22/10/2007 13:44:42 com.jmex.audio.util.AudioLoader loadOGG
INFO: ogg loaded - time: 26.935148  channels: 1  rate: 22050 depth: 16 bytes: 1187840
22/10/2007 13:44:42 com.jmex.audio.util.AudioLoader loadWAV
INFO: wav loaded - time: 3.2052608  channels: 1  rate: 44100 depth: 16 bytes: 282704
22/10/2007 13:44:42 com.jmex.audio.RangedAudioTracker checkTrackAudible


Except by the files loaded, that's no more logs.

Thanks,
Cezar

Is that with jME 1.0? Or probably with rc1? There was a bug in the sound loading mechanism…

i dont know exactly what version it is…i've setted it up with eclipse (CVS)…how could i discover the version?



you said "was a bug", it means that if i update it, the problem will, probably, be solved?



Thanks,

Cezar

cezarsignori said:

you said "was a bug", it means that if i update it, the problem will, probably, be solved?

yes. If it's not solved by updating, please report back here.

Hi,



i've got an error while updating jme (Problem writing resource '/jme/lib/lwjgl.jar'. Resource is out of sync with the file system: '/jme/lib/lwjgl.jar'.

  Resource is out of sync with the file system: '/jme/lib/lwjgl.jar'.), so i decided to check out jme.



As i did so, i've ran the TestJmexAudio again, and the problem still.



I am running jme under Ubuntu 7.10 ( and at the last post, i was with Ubuntu 7.04 ), and all the updates done.



Someone have any ideia?



Thanks,

Cezar

Trying to dive further into it, I find that the test-programs from LWJGL works (with no noise). So it seems like the problem is one of the following (please tell me if you can think of anything else it could be):


  • The reading/streaming of data in JME is buggy, hence the sound that we pump into AL is foobar
  • Some setting somewhere in JME messes up AL, such that it cannot play the data correctly
  • OpenAL says it is thread safe, but for some reason using multiple threads on OpenAL makes it sound weird.



    Please, if there are any Linux&JME users out there, could you try the sound-tests in JME and post your results along with Linux dist and version, such that we at least can track down where the problem is.

Arghh, it seems I was too fast there. The LWJGL tests do the very same thing, their sounds are just so short that you hardly notice it.

I have the exact same problem. Running on Ubuntu 7.10, the sound plays but contains lots of regular discontinuities (sounds noisy). All the tests work well on Windows (Vista/XP) so it seems like something is wrong with OpenAL on Ubuntu, or maybe LWJGL on Linux in general.



My best guess is that it either plays too little of some block, or too much. As the sounds is "correct" within 1/4 of a second, then has a discontinuity, then its "correct" again for 1/4 second or so.



Any suggestions?

And I would suggest this thread continue here:



http://lwjgl.org/forum/index.php/topic,2483.0.html



It seems that this is an LWJGL problem and not a JME problem.

It seems I have found a solution, changing OpenALSystem.java from:



    public OpenALSystem() {
        ear = new OpenALEar();
        try {
            AL.create();
            AL10.alDistanceModel(AL10.AL_INVERSE_DISTANCE);
            setupSourcePool();
        } catch (Exception e) {
            logger.logp(Level.SEVERE, this.getClass().toString(), "OpenALSystem()", "Exception",
                    e);
        }
    }



to


    public OpenALSystem() {
        ear = new OpenALEar();
        try {
            AL.create(null, -1, -1, false);
            AL10.alDistanceModel(AL10.AL_INVERSE_DISTANCE);
            setupSourcePool();
        } catch (Exception e) {
            logger.logp(Level.SEVERE, this.getClass().toString(), "OpenALSystem()", "Exception",
                    e);
        }
    }



fixes the sound-issues. But doing so re-enables the "let the implementation figure defaults out"-behavior that the LWJGL team has moved away from (AL.java):


  155    /**
  156     * Creates an OpenAL instance. The empty create will cause OpenAL to
  157     * open the default device, and create a context using default values.
  158     * This method used to use default values that the OpenAL implementation
  159     * chose but this produces unexpected results on some systems; so now
  160     * it defaults to 44100Hz mixing @ 60Hz refresh.
  161     */
  162    public static void create() throws LWJGLException {
  163       create(null, 44100, 60, false);
  164    }


Huh, that's an interesting finding.  Is this a Linux only issue?  Also, any idea if lwjgl is working on the issue (the thread did not indicate that they are.)

It is Linux-only. And maybe even some distros/sound-drivers only. I just realized that the proposed fix is not totally fixing the issue, see the LWJGL thread for more info on a less bad-sound-fix.



http://lwjgl.org/forum/index.php/topic,2483.0.html

I just stumbled upon exactly the same problem.



I’m running Ubuntu 7.10 (32 bit) an a Centrino Duo machine and use jME from CVS.



If I exchange my libopenal.so in the jME-project to the one the libopenal.so linked here the sound problems disappear.

What are future plans concerning this problem?

It looks like lwjgl has decided to move to using the software openal binary for future releases, so I'm sure we will move to that as well.