[fpc-pascal] Synchronize(dummyproc) with Linux.

Fred van Stappen fiens at hotmail.com
Wed May 1 01:31:31 CEST 2013

This about audio and fpc and fpGUI and LCL and Linux. (working good with 
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;
if LoopProc <> nil then synchronize(LoopProc);
 >> And here LoopProc := DummyProc :
Procedure TSimpleplayer.DummyProc ;

  // Nothing !

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 :


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

Many thanks

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130501/b30f7086/attachment.html>

More information about the fpc-pascal mailing list