<div dir="ltr">2013/4/30 Fred van Stappen <span dir="ltr"><<a href="mailto:fiens@hotmail.com" target="_blank">fiens@hotmail.com</a>></span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
This about audio and fpc and fpGUI and LCL and Linux. (working good
with Windows) <br>
Have some trouble with threads synchronize() procedure.<br>
The main thread.execute
is a loop to read-write audio data.<br>
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. <br>
Some audio chunk
are omitted when using synchronize(myProc).<br>
<br>
I was thinking that the reason was the Graphic-refresh but it is
not.<br>
If i do a synchronize(dummyproc) i have the same bad result.<br>
Without synchronize(dummyproc), the sound is perfect.<br>
Here some code :<br>
<br>
<pre><div>>>The main thread.execute
</div>procedure TUOS_Player.Execute;
begin
...
repeat
...
if LoopProc <> nil then synchronize(LoopProc);
...
end;
end;
<div>>> And here LoopProc := DummyProc :
</div>Procedure TSimpleplayer.DummyProc ;
begin
// Nothing !
end;
<big>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 :
</big>
<u><b><big><a href="https://sites.google.com/site/fiensprototyping/fpGUI_UOStest.tar.gz" target="_blank">https://sites.google.com/site/fiensprototyping/fpGUI_UOStest.tar.gz</a></big></b></u>
<big>Download the zip file, and run the binaries in root folder (everything is included and ready to use).
The source are in <big>src</big>.
Many thanks</big></pre></div></blockquote><div style>Try Queue instead Syncronize.</div><div> </div></div>-- <br>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a>
</div></div>