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

silvioprog silvioprog at gmail.com
Wed May 1 16:49:55 CEST 2013


2013/4/30 Fred van Stappen <fiens at hotmail.com>

>  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 in src.
>
> Many thanks
>
> Try Queue instead Syncronize.

-- 
Silvio Clécio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130501/a29db044/attachment.html>


More information about the fpc-pascal mailing list