0
0

Hi *,
I wrote a c++-class with which I can load, play, stop and unload sounds using fmod.
The problem is: In MS WindowsXP the latency is really short (< 50 ms) but in Linux it is about 500 ms (0.5 seconds)! That is too long. :(
My System: SuSE Linux 8.0, Kernel 2.4.18. fmod 3.6
My PC: 1,4 Ghz Athlon, 512 MB Ram, fast harddisk, soundcard SBLive

Here is some of my code:

string filename = “file.wav”; // or “file.mp3” or “file.ogg”
FSOUND_SAMPLE* sample = 0; // == NULL

int len = 0;
char* mem = 0; // = NULL
FILE *pFile = fopen(filename.c_str(), "r");
if(pFile)
{
    fseek(pFile, 0L, SEEK_END);
    len = ftell(pFile);
    mem = new char[len];
    rewind(pFile);
    fread(mem, 1, len, pFile);
    fclose(pFile);
}

sample = FSOUND_Sample_Load(FSOUND_UNMANAGED, (char*)mem,
    FSOUND_NORMAL | FSOUND_LOOP_OFF | FSOUND_LOADMEMORY | FSOUND_MPEGACCURATE, len);

int channel = FSOUND_PlaySound(FSOUND_FREE, sample);

(I load the complete file in to the memory)
– My buffersize is FSOUND_SetBufferSize(50);
– FSound is initialized with FSOUND_Init(44100, 64, FSOUND_INIT_GLOBALFOCUS);
– OSS- and ALSA-Output have the same bad latency!
Any ideas?

haladrim

  • You must to post comments
0
0

Perhaps I should add that I am using SuSE Linux 8.0 with ALSA 0.9…..
haladrim

  • You must to post comments
0
0

I am also having problems with 500ms+ latency on linux (SuSE 7.3, alsa 0.9,
kernel 2.4.19, sblive, fmod 3.6). FSOUND_SetBufferSize does not seem to change this behaviour.

  • You must to post comments
0
0

I have tested ALSA, OSS and ESD and it is always the same!
Perhaps when using OSS or ESD, ALSA switches on the ALSA-emulation-modes??? Then it wound make no sense to ‘test’ ESD and OSS because it would be always ALSA-output…
(I will test my game on another PC and will show the results here…)

Or maybe that ALSA 0.9 is not supportet as good as the other drivers, yet?

  • You must to post comments
0
0

a new release (with a short latency) of fmod would be great!

I have testet pure OSS- and ESD-Output but it is always the same latency 500ms++.
So I think it is an fmod-problem and has nothing to do with the output mode.

I am waiting for fmod 3.61! 😀

bye, haladrim

  • You must to post comments
0
0

brett, you said you will release a 3.61 version “soon”.
Do you already know the release-date? :-)

  • You must to post comments
0
0

a week or 2?

now it is 18.10.2002 that means 5 weeks.
plz. hold your date…
…i am a user who is waiting for it.
If it is not possible to solve the problem then say it!!

  • You must to post comments
0
0

I just downloaded the latest v3.6 Linux tar.gz; does this contain the latency fix? (I noticed it yesterday as well, but I’ve got an older v3.6 FMod .so probably).

And do I need to use OSS or is ALSA fixed with this as well? (I’m using ALSA)

  • You must to post comments
Showing 7 results
Your Answer

Please first to submit.