This about audio and fpc and fpGUI and LCL and Linux. (working good with Windows)
Have some trouble with threads synchronize() procedure.
The main thread.execute is a loop to read-write audio data.
Inside the loop i use synchronize(myProc) to synchronize some graphic component ( like taskbar.position, position.text,...). With LCL the graphic synchro is good and the quality of sound is ok and not altered with synchronize(myProc). With fpGui the synchro is good but not the quality of sound.
Some audio chunk are omitted when using synchronize(myProc).

I was thinking that the reason was the Graphic-refresh  but it is not.
If i do a synchronize(dummyproc) i have the same bad result.
Without synchronize(dummyproc), the sound is perfect.
Here some code :

>>The main thread.execute
procedure TUOS_Player.Execute;
begin
...
repeat
...
if LoopProc <> nil then synchronize(LoopProc);
...
end;
end;
>> And here LoopProc := DummyProc :
Procedure TSimpleplayer.DummyProc ;

begin
 // Nothing !
 end;

I have a test example for Linux 64 bit.

There are 3 binaries from same code : fpGUI, GTK2, Qt.

On the fpGUI demo, there are 3 checkboxs more,
- With syhchro Grahic
- With synchro Dummy
- Without syhchro

On my slow computer, the sound is altered while using synchro, even if the proc 
is dummy !
Why, what do synchronize() if the procedure is dummy ?
Here the demo test :

_*https://sites.google.com/site/fiensprototyping/fpGUI_UOStest.tar.gz*_

Download the zip file, and run the binaries in root folder (everything is 
included and ready to use).
The source are insrc.

Many thanks


_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to