0
0

Hi,
Till now I was just experimenting with a single .wav file playback using linux-lazarus.
I tried to enhance the code a little bit and noticed something very strange….

The code I was using is like:

procedure TPBKForm.Button1Click(Sender: TObject);

begin
FMOD_System_Create(MySystem);
FMOD_System_SetOutput(MySystem, FMOD_OUTPUTTYPE_ALSA);
FMOD_System_Init(MySystem,1 , FMOD_INIT_NORMAL, nil);
FMOD_System_CreateStream(MySystem,’test.wav’,FMOD_SOFTWARE,nil,MySound);
FMOD_System_PlaySound(MySystem,FMOD_CHANNEL_FREE,MySound,False,MyChannel);
end;

Just a small silly addition like assigning a string to another:

procedure TPBKForm.Button1Click(Sender: TObject);

var
here:string;
there:string;

begin
there:=here;
FMOD_System_Create(MySystem);
FMOD_System_SetOutput(MySystem, FMOD_OUTPUTTYPE_ALSA);
FMOD_System_Init(MySystem,1 , FMOD_INIT_NORMAL, nil);
FMOD_System_CreateStream(MySystem,’test.wav’,FMOD_SOFTWARE,nil,MySound);
FMOD_System_PlaySound(MySystem,FMOD_CHANNEL_FREE,MySound,False,MyChannel);
end;

and the application gives a SIGSEGV error and crashes. The fpc compiler complains about an error in fpc_reraise function.
I even tried to put creation and initialization in the formcreate but it did not help.
It seems the the Create() function does something strange with the memory or the registers….I do not know….
Today I tried with the last fmodex release 4.03.09 but no luck….

Any ideas?

Stavros

  • You must to post comments
0
0

Hi Stavros,

replace in fmod.pas all

[i:158t3yri]stdcall;[/i:158t3yri]

with

[i:158t3yri]{$IFDEF LINUX} cdecl {$ELSE} stdcall {$ENDIF};[/i:158t3yri]

and all is good.

Bye
stemueh.

  • You must to post comments
0
0

Ouao! That was impressive.
You are right. Problem solved….although something more remains.
An issue with the lazarus debugger. For some peculiar reason when FMOD is created and initialized I cannot "step" into the code. As soon as I press F8 the entire PC freezes….
Any good ideas like the previous one 😉
Thanks again!
Stavros

  • You must to post comments
0
0

Yes, this is very strange. If I run the following:

procedure TForm1.Button7Click(Sender: TObject);
var
dummy: FMOD_OUTPUTTYPE;
begin
[color=red:22lgvexb] FMOD_System_GetOutput(MySystem, dummy);[/color:22lgvexb] //here is the breakpoint
if dummy = FMOD_OUTPUTTYPE_ALSA then showmessage(‘ALSA’);
if dummy = FMOD_OUTPUTTYPE_OSS then showmessage(‘OSS’);
if dummy = FMOD_OUTPUTTYPE_ESD then showmessage(‘ESD’);
end;

it stops and when I press F7 (single step) or F8 (procedure step) I run in fmod.pas to:

function FMOD_System_GetNumDrivers ; external FMOD_DLL;

Why this??? It should stop by GetOutput not GetNumDrivers!

Anyway, if I press F7 again or F9 I’m back in my prog and all is fine. If I press F8 in fmod.pas I fall in trouble. No idea why, but using F7 (only in fmod.pas) is a workaround for me.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.