LWJGL
May 22, 2012, 15:03:00 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.8.3 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Distortion after several hours  (Read 1339 times)
Dongalor
Newbie
*
Posts: 4


« on: September 28, 2010, 08:36:42 »

Hi ,

I'm developing a game using lwgl and I've a issue with sounds. I can load and play perfectly all the sounds, but after several hours playing (6 aprox), all the sounds are played with a big distortion.  Any clues of what is going on here? Why the sounds are played well but always after 6 hours are played with distortion?

Thanks in advance.
Logged
Matzon
Administrator
Demigod
*****
Posts: 2177



« Reply #1 on: September 30, 2010, 02:51:30 »

are you using ALSA by any chance?
There have been some issues with that - after playing between 2 and 4 billion samples Smiley
Logged

http://certusgames.com (Free Online Multiplayer Java Games)
http://lwjgl.org (OpenGL/OpenAL for Java)
Dongalor
Newbie
*
Posts: 4


« Reply #2 on: September 30, 2010, 04:15:34 »

Yes, I'm using ALSA. (bad news for me??  Huh)

the distortion appears after 6 hours (aprox), not enough time to play 2 bilion samples ( if with a sample you mean a .wav file).  Maybe I'm having some memory leaks after 6 hours and alsa just get crazy Smiley

Thanks for the reply
Logged
Matzon
Administrator
Demigod
*****
Posts: 2177



« Reply #3 on: September 30, 2010, 05:29:40 »

I was told that there is an integer overflow in alsa - whether or not that is the particular issue you're seeing, I do not know. But I suggest trying OSS for 6 hours too and see if it still happens Smiley
Logged

http://certusgames.com (Free Online Multiplayer Java Games)
http://lwjgl.org (OpenGL/OpenAL for Java)
Dongalor
Newbie
*
Posts: 4


« Reply #4 on: October 01, 2010, 00:28:16 »

Hi again,

I've made some test, but now with the "space invaders" source i've found inside lwjgl-source-2.5. I added some new lines in the main loop :


Code:
while (Game.gameRunning) {
      // clear screen
      GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
      GL11.glMatrixMode(GL11.GL_MODELVIEW);
      GL11.glLoadIdentity();

      // let subsystem paint
      frameRendering();

      // update window contents
      Display.update();
    if (System.currentTimeMillis() > lastSoundTime+35000) {
        lastSoundTime = System.currentTimeMillis();
        soundManager.playSound(SOUND_TEST);
      }
    }

Adding the sound  with
Code:
SOUND_TEST   = soundManager.addSound("test.wav");

The goal of the test is to play a sound via the soundManager of space invaders. After 6 hours..... distortion again Sad






Logged
Matzon
Administrator
Demigod
*****
Posts: 2177



« Reply #5 on: October 01, 2010, 01:35:52 »

Unless you have changed to OSS in the mean time, this test doesn't really prove anything new :/
Logged

http://certusgames.com (Free Online Multiplayer Java Games)
http://lwjgl.org (OpenGL/OpenAL for Java)
Dongalor
Newbie
*
Posts: 4


« Reply #6 on: October 08, 2010, 04:20:41 »

I forgot to post the results  Tongue

With OSS everithing works fine. Thanks for the advice!
Logged
Matzon
Administrator
Demigod
*****
Posts: 2177



« Reply #7 on: October 08, 2010, 05:26:22 »

ok, so we can conclude:
a) dont use ALSA if playing for more than 6 hours
b) dont play for more than 6 hours Smiley

thanks for responding back
Logged

http://certusgames.com (Free Online Multiplayer Java Games)
http://lwjgl.org (OpenGL/OpenAL for Java)
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!