<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body 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 class="wbox"><div class="quote3">>>The main thread.execute
</div>procedure TUOS_Player.Execute;
begin
...
repeat
...
if LoopProc <> nil then synchronize(LoopProc);
...
end;
end;
<div class="quote3">>> 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 class="moz-txt-link-freetext" href="https://sites.google.com/site/fiensprototyping/fpGUI_UOStest.tar.gz">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>
<br>
</body>
</html>