Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-27 Thread Martin Schreiber
> There is application.queueasynccall() ...

Ha, ** VERY MUCH ** better. ;-)

---> No more underrun error, no scratch when opening dialog files, no
scratch when switching float<>tab or opening/closing forms.

Synchronization: perfect. (maybe even better than fpc-queue()).

OK, re-come back to {$DEFINE mse} when using uos (that was updated, of
course).

Well done Martin.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-26 Thread fredvs
> There is application.queueasynccall() ...

Ha, ** VERY MUCH ** better. ;-)

---> No more underrun error, no scratch when opening dialog files, no
scratch when switching float<>tab or opening/closing forms.

Synchronization: perfect. (maybe even better than fpc-queue()).

OK, re-come back to {$DEFINE mse} when using uos (that was updated, of
course).

Well done Martin.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-26 Thread fredvs
> There is application.queueasynccall() 

OK, I will try this.

Asap.

Thanks.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-25 Thread Martin Schreiber
On Monday 25 September 2017 23:59:49 fredvs wrote:
> Hello Martin.
>
> I did play with lock()/unlock in uos but still those underrun errors.
>
> There is something that I do not catch.
>
As I wrote before, application.lock() waits until the main thread is idle and 
then runs in context of calling thread.

> So I came back with {.$DEFINE mse} (that uses classical fpc thread +
> queue()) and all synchros are ok without any error underrun message.
>
There is application.queueasynccall() which does not wait and runs in main 
thread context or use tmsecomponent.postcomponentevent() in order to 
asynchronousely send data to a component. An example is here:
https://gitlab.com/mseide-msegui/mseuniverse/tree/master/samples/thread/componentevent

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-25 Thread Martin Schreiber
On Monday 25 September 2017 18:14:51 Martin Schreiber wrote:

> You also can use .asyncevent() in order to send and
> .onasyncevent in order to receive an event or
> .postcomponentevent() to send and overriding
> .componentevent() to receive. I'll probably add
> tform.oncomponentevent for convenience.
>
Done, an example is here:

https://gitlab.com/mseide-msegui/mseuniverse/tree/master/samples/thread/componentevent

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-25 Thread fredvs
Hello Martin.

I did play with lock()/unlock in uos but still those underrun errors.

There is something that I do not catch.

So I came back with {.$DEFINE mse} (that uses classical fpc thread +
queue()) and all synchros are ok without any error underrun message.

Also no more scratch when opening file dialog or switching from
float<>docked.

For the moment I will use fpc-threads but if somebody can make work
msethread synchro in uos, it would be a pleasure to use it instead.

Thans.

Fre;D 



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-25 Thread fredvs
> How do you do that? application.lock()/unlock()?

Maybe. I have to check uos code.
It uses {$DEFINE mse} and so uses msethreads and
application.lock()/unlock().
Maybe there are not placed on the right place...

application.lock()/unlock() is not used in Strumpact forms.

> An alternative is...
Ha, ok I will explore it.

> Another option...
Yep, I will explore it too.

Many thanks.

Fre;D






--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-25 Thread Martin Schreiber
On Monday 25 September 2017 14:24:17 fredvs wrote:
> > This night will be a merciless test, StrumPract will be the dj all night.
>
> Hello Martin.
>
> OK, the night was white.
>
> Strumpact did his DJ job perfectly, no crash, no pause.
>
Congrats!

> The only detail is when a thread is synchronizing graphic of a other form
> (not the parent form of the thread).
>
> It produce some underrun of the external thread.  The result is some
> "scratch" in sound.
> (I did add a checkbox to disable view meter in Commander form.  If enabled
> ---> underrun.)
>
How do you do that? application.lock()/unlock()? That will wait until the main 
thread is in idle state (same as "synchronize()")

An alternative is application.postevent() which does not wait.
You also can use .asyncevent() in order to send and 
.onasyncevent in order to receive an event or 
.postcomponentevent() to send and overriding 
.componentevent() to receive. I'll probably add 
tform.oncomponentevent for convenience.

Another option is application.queueasynccall() which internally also uses 
event objects.

> But maybe it is not a good idea to synchronize things of a other form than
> parent-thread form.
>
There is no "parent-thread" for a form, there is solely a single main thread 
with a single main event loop which runs the GUI code for all forms.

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-25 Thread fredvs
> This night will be a merciless test, StrumPract will be the dj all night.

Hello Martin.

OK, the night was white.

Strumpact did his DJ job perfectly, no crash, no pause.

The only detail is when a thread is synchronizing graphic of a other form
(not the parent form of the thread).

It produce some underrun of the external thread.  The result is some
"scratch" in sound.
(I did add a checkbox to disable view meter in Commander form.  If enabled
---> underrun.)

But maybe it is not a good idea to synchronize things of a other form than
parent-thread form.

See picture:
 

Thanks.

Fre:D




--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-24 Thread Martin Schreiber
On Sunday 24 September 2017 20:30:07 fredvs wrote:
> Hello Martin.
>
> ...
>
> WOW
>
> ...
>
> >  Linux gui_getevent() breakes xfilterevent() loop if there is no message.
>
> If I may, you did discover something **very** annoying.
>
No, that problem existed in MSEgui some weeks only (since 2017-09-17 exactly), 
a side effect (bug) of better IBUS repeat key detection I implemented.

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-24 Thread fredvs
Hello Martin.

...

WOW

...

>  Linux gui_getevent() breakes xfilterevent() loop if there is no message.

If I may, you did discover something **very** annoying.

My previous audio project: miXimum uses LCL + Bass audio library.
https://sites.google.com/site/fiensprototyping/

Because of that "random pause", I switched form GTK2 to Qt.

It works better for synchro but still that "random pause" when no mouse or
keyboard for a certain time.

And all my annoying post to Lazarus, Qt or Bass forum did not help.

I decided to stop to update miXimum in 2012 because of that random pause.

Also Bass library is not open-source and there are some things missing.

So I created uos the open source out of the box audio library.

I have to confess that I was desperate when same random pause appeared for
MSE gui too.

But you found the solution. ;-)

Like always, brillant.

This night will be a merciless test, StrumPract will be the dj all night
long.

Many, many thanks Brillant Martin.

Fre;D 

PS: @Graeme, maybe that MSE fix-code could help for fixing same random pause
with fpGUI.

 



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-24 Thread Martin Schreiber
On 09/24/2017 09:44 AM, Martin Schreiber wrote:
> On 09/23/2017 01:35 PM, fredvs wrote:
>> Hello Martin.
>>
>>> I can reproduce it now if not compiled with -gh
>>
>> Ha here it appends even with -gh.
>>
> I can't reproduce it anymore. If it is reproducible for you I fear you
> need to debug yourself.
> 
I made an additional test for multi-thread, maybe it improves the
situation, MSEgui git master e824a386ac891d22196c96acd9f15a9526965abb.

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-24 Thread Martin Schreiber
On 09/24/2017 09:44 AM, Martin Schreiber wrote:
>>
> Seems
 to be fixed with the attached patch.
> 
"
+//and the application.unlock() below looks suspect
"
because it is in an if statement.

Martin


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-24 Thread Martin Schreiber
On 09/23/2017 01:35 PM, fredvs wrote:
> Hello Martin.
> 
>> I can reproduce it now if not compiled with -gh
> 
> Ha here it appends even with -gh.
> 
I can't reproduce it anymore. If it is reproducible for you I fear you
need to debug yourself.

>> But sometimes there is a libc memory error
> 
> How do you get that error ? Even with -ghl + debugger I cannot have errors.
> Very difficult to debug then.
> 
Seems to be fixed with the attached patch.

Martin
diff --git a/src/drums.pas b/src/drums.pas
index 292b60c..d2b31ae 100644
--- a/src/drums.pas
+++ b/src/drums.pas
@@ -247,7 +247,8 @@ begin
  
  if noanim.value = false then
 begin
- application.lock();
+// application.lock();not necessary, timer tick runs in main thread context
+//and the application.unlock() below looks suspect
 label2.visible := true;
 
 if (posi = 1) or (posi = 9) then
@@ -469,7 +470,7 @@ posi := posi + 1;
 // Timertick.Enabled := true;
   Timertick.tag := 0 ;
   
-application.unlock();
+//application.unlock(); ???
  end else 
  begin
  Timertick.Enabled := false;
@@ -645,7 +646,6 @@ procedure tdrumsfo.createdrumsplayers;
 var
 i : integer;
 begin 
-
 for i := 0 to 3 do   
  begin
  uos_Stop(i);
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-23 Thread fredvs
Hello Martin.

> I can reproduce it now if not compiled with -gh

Ha here it appends even with -gh.

> But sometimes there is a libc memory error

How do you get that error ? Even with -ghl + debugger I cannot have errors.
Very difficult to debug then.

What could I do ?

Thanks.

Fre;D




--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-23 Thread Martin Schreiber
On 09/23/2017 10:18 AM, Martin Schreiber wrote:
>> Works for me, can not reproduce.
> 
> Aha, I can reproduce it now if not compiled with -gh. Smells like a
> memory error. I'll take a look.
> 
Nope, it happens anymore. But sometimes there is a libc memory error:
"
*** Error in
`/home/mse/packs/standard/git/fred/strumpract/src/strumpract': free():
invalid next size (fast): 0x00ccbf90 ***
=== Backtrace: =
/lib64/libc.so.6(+0x7277f)[0x7713f77f]
/lib64/libc.so.6(+0x78026)[0x77145026]
/lib64/libc.so.6(+0x78d53)[0x77145d53]
/usr/lib64/libX11.so.6(XDestroyRegion+0xd)[0x776b9b8d]
/home/mse/packs/standard/git/fred/strumpract/src/strumpract[0x68495c]
=== Memory map: 
0040-0072c000 r-xp  08:07 272949693
/home/mse/packs/standard/git/fred/strumpract/src/strumpract
0092b000-0092c000 r--p 0032b000 08:07 272949693
/home/mse/packs/standard/git/fred/strumpract/src/strumpract
0092c000-00b28000 rw-p 0032c000 08:07 272949693
/home/mse/packs/standard/git/fred/strumpract/src/strumpract
00b28000-00d89000 rw-p  00:00 0
[heap]
7fff8c00-7fff8c033000 rw-p  00:00 0
7fff8c033000-7fff9000 ---p  00:00 0
7fff93ffe000-7fff97fff000 rw-s  00:12 24096
/dev/shm/pulse-shm-4161639246
7fff97fff000-7fff9c00 rw-s  00:12 67248
/dev/shm/pulse-shm-1440486182
[...]
"
> Martin
> 


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-23 Thread Martin Schreiber
On 09/23/2017 09:06 AM, Martin Schreiber wrote:
> On Friday 22 September 2017 23:46:32 fredvs wrote:
>> Hello Martin.
>>
>> I have a strange problem.
>>
>> While using a timer, sometimes, the application pause itself.
>>
>> But when moving the mouse, it re-works again.
>>
>> See video.
>> mse_stopnomouse2.mp4
>> >>
> Works for me, can not reproduce.

Aha, I can reproduce it now if not compiled with -gh. Smells like a
memory error. I'll take a look.

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-23 Thread Martin Schreiber
On Friday 22 September 2017 23:46:32 fredvs wrote:
> Hello Martin.
>
> I have a strange problem.
>
> While using a timer, sometimes, the application pause itself.
>
> But when moving the mouse, it re-works again.
>
> See video.
> mse_stopnomouse2.mp4
> >
Works for me, can not reproduce.
>
> What could be the cause of this ?
>
I don't know. Does it happen on all your machines?

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


[MSEide-MSEgui-talk] Application paused if no mouse event.

2017-09-22 Thread fredvs
Hello Martin.

I have a strange problem.

While using a timer, sometimes, the application pause itself.

But when moving the mouse, it re-works again.

See video.
mse_stopnomouse2.mp4
  

What could be the cause of this ?

Thanks.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk