key-up events missing for some unix machines?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

key-up events missing for some unix machines?

timrowledge

I’m trying to get some idea where the problem lies when my Pi fairly frequently misses key-ups; this results in scratch sprite going spinning when they should just make a quick turn. I’m reasonably sure it’s not the image level code but I’m not making enough sense out of the key handling code in vm-display-X11/sqUnixX11.c to be sure there are no loopholes there. Another possibility that needs testing is the lower level OS code, since there have been Pi USB issues in the past.

Does anyone else see the problem? Have any ideas for testing ?


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
 Testicle (n.), a humorous question on an exam.


Reply | Threaded
Open this post in threaded view
|

Re: key-up events missing for some unix machines?

Karl Ramberg
 
Quick search turns up this:


Karl


On Mon, Nov 4, 2013 at 10:48 PM, tim Rowledge <[hidden email]> wrote:

I’m trying to get some idea where the problem lies when my Pi fairly frequently misses key-ups; this results in scratch sprite going spinning when they should just make a quick turn. I’m reasonably sure it’s not the image level code but I’m not making enough sense out of the key handling code in vm-display-X11/sqUnixX11.c to be sure there are no loopholes there. Another possibility that needs testing is the lower level OS code, since there have been Pi USB issues in the past.

Does anyone else see the problem? Have any ideas for testing ?


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
 Testicle (n.), a humorous question on an exam.



Reply | Threaded
Open this post in threaded view
|

Re: key-up events missing for some unix machines?

timrowledge


On 04-11-2013, at 2:00 PM, karl ramberg <[hidden email]> wrote:

> Quick search turns up this:
>
> http://bugs.squeak.org/view.php?id=7597

Interesting. I’m puzzled even more now since I see differences between the sqUnixX11.c in the Cog and plain trees, whereas I was until then convinced that they used the same platform code… sigh.
However, I get the problem on the Pi with both a plain interp and a stack vm, so I’m going to have to suspect either a systemic problem or the USB.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: AG: Add Gibberish


Reply | Threaded
Open this post in threaded view
|

Re: key-up events missing for some unix machines?

Ian Piumarta

On Nov 4, 2013, at 16:28 , tim Rowledge wrote:

> Interesting. I’m puzzled even more now since I see differences between the sqUnixX11.c in the Cog and plain trees, whereas I was until then convinced that they used the same platform code… sigh.

The Qwak/Teleplace code is based on an ancient fork of the tree that was closed-source for several years while the trunk diverged.  That's why Cog still uses Makefiles and not CMake, etc...

I remember fixing an issue with auto-repeating meta keys a few years ago, which might have introduced the issue with n-key rollover and missing up events.  I'll take a look (especially promptly if you can provide a simple reproducible test case/scenario :-).

> However, I get the problem on the Pi with both a plain interp and a stack vm, so I’m going to have to suspect either a systemic problem or the USB.

I don't know if this is related but I've often had problems with X11 and the client being one event behind what the user is doing on the server.  Even when XSync()s are sprinkled in every conceivable place, some events just don't seem to make it into the dispatch loop when they are the last in the queue.  A typical symptom is a menu not seeing mouse up after you release the button, until you wiggle the cursor to generate some motion event pressure behind it.  One thing to look for is whether your missing up events appear if you wiggle the mouse immediately after releasing the key.

It's not just Squeak.  I've seen this issue with many X11 programs.  I'd suspect something fishy with NDELAY on the connection, but after so many years one would expect xlib to be getting that right.

FWIW...

Regards,
Ian

Reply | Threaded
Open this post in threaded view
|

Re: key-up events missing for some unix machines?

timrowledge


On 04-11-2013, at 5:19 PM, Ian Piumarta <[hidden email]> wrote:

>
> On Nov 4, 2013, at 16:28 , tim Rowledge wrote:
>
>> Interesting. I’m puzzled even more now since I see differences between the sqUnixX11.c in the Cog and plain trees, whereas I was until then convinced that they used the same platform code… sigh.
>
> The Qwak/Teleplace code is based on an ancient fork of the tree that was closed-source for several years while the trunk diverged.  That's why Cog still uses Makefiles and not CMake, etc…

Hunh. I got the impression from the svn tree that they actually shared that part of things. Now I have to try to think why I misunderstood that…

>
> I remember fixing an issue with auto-repeating meta keys a few years ago, which might have introduced the issue with n-key rollover and missing up events.  I'll take a look (especially promptly if you can provide a simple reproducible test case/scenario :-).


Trivial test case - fire up the latest Scratch (do the magical apt-get etc scratch) and load ‘asteroids’ - which is like haemorrhoids except more painful - and use left/right cursor to rotate ye anciente space shippe. For me, quite often it will stick with one direction, especially if you hold down the key for a while and then let go. clicking or holding the other direction will usually make no difference but sometimes  sort of force a stand-off and no rotation. *usually* clicking the key for the stuck rotation will seem to release it, but not always.

In my very latest changes I’m trying out a state recorder attached as a HandMorph keyboard listener, but it seems to get flooded and spend a lot of time doing not much. I’m thinking it would make more sense for the keyboard state to be something maintained in the vm and accessed via a prim anyway. We have a lot of code that seems to be doing half the job anyway.

>
>> However, I get the problem on the Pi with both a plain interp and a stack vm, so I’m going to have to suspect either a systemic problem or the USB.
>
> I don't know if this is related but I've often had problems with X11 and the client being one event behind what the user is doing on the server.  Even when XSync()s are sprinkled in every conceivable place, some events just don't seem to make it into the dispatch loop when they are the last in the queue.  A typical symptom is a menu not seeing mouse up after you release the button, until you wiggle the cursor to generate some motion event pressure behind it.  One thing to look for is whether your missing up events appear if you wiggle the mouse immediately after releasing the key.
>
> It's not just Squeak.  I've seen this issue with many X11 programs.  I'd suspect something fishy with NDELAY on the connection, but after so many years one would expect xlib to be getting that right.

X getting it right? Good luck with that one...


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
A computer program does what you tell it to do, not what you want it to do.


Reply | Threaded
Open this post in threaded view
|

Re: key-up events missing for some unix machines?

Eliot Miranda-2
 



On Mon, Nov 4, 2013 at 5:59 PM, tim Rowledge <[hidden email]> wrote:


On 04-11-2013, at 5:19 PM, Ian Piumarta <[hidden email]> wrote:

>
> On Nov 4, 2013, at 16:28 , tim Rowledge wrote:
>
>> Interesting. I’m puzzled even more now since I see differences between the sqUnixX11.c in the Cog and plain trees, whereas I was until then convinced that they used the same platform code… sigh.
>
> The Qwak/Teleplace code is based on an ancient fork of the tree that was closed-source for several years while the trunk diverged.  That's why Cog still uses Makefiles and not CMake, etc…

Hunh. I got the impression from the svn tree that they actually shared that part of things.

They do.  platforms/Cross/plugins and platforms/win32/plugins are shared.  The more sharing the better.  But it's a merge and a fair ammount of work.
 
Now I have to try to think why I misunderstood that…

>
> I remember fixing an issue with auto-repeating meta keys a few years ago, which might have introduced the issue with n-key rollover and missing up events.  I'll take a look (especially promptly if you can provide a simple reproducible test case/scenario :-).


Trivial test case - fire up the latest Scratch (do the magical apt-get etc scratch) and load ‘asteroids’ - which is like haemorrhoids except more painful - and use left/right cursor to rotate ye anciente space shippe. For me, quite often it will stick with one direction, especially if you hold down the key for a while and then let go. clicking or holding the other direction will usually make no difference but sometimes  sort of force a stand-off and no rotation. *usually* clicking the key for the stuck rotation will seem to release it, but not always.

In my very latest changes I’m trying out a state recorder attached as a HandMorph keyboard listener, but it seems to get flooded and spend a lot of time doing not much. I’m thinking it would make more sense for the keyboard state to be something maintained in the vm and accessed via a prim anyway. We have a lot of code that seems to be doing half the job anyway.

>
>> However, I get the problem on the Pi with both a plain interp and a stack vm, so I’m going to have to suspect either a systemic problem or the USB.
>
> I don't know if this is related but I've often had problems with X11 and the client being one event behind what the user is doing on the server.  Even when XSync()s are sprinkled in every conceivable place, some events just don't seem to make it into the dispatch loop when they are the last in the queue.  A typical symptom is a menu not seeing mouse up after you release the button, until you wiggle the cursor to generate some motion event pressure behind it.  One thing to look for is whether your missing up events appear if you wiggle the mouse immediately after releasing the key.
>
> It's not just Squeak.  I've seen this issue with many X11 programs.  I'd suspect something fishy with NDELAY on the connection, but after so many years one would expect xlib to be getting that right.

X getting it right? Good luck with that one...
A computer program does what you tell it to do, not what you want it to do.





--
best,
Eliot
Reply | Threaded
Open this post in threaded view
|

Re: key-up events missing for some unix machines?

timrowledge


On 04-11-2013, at 6:26 PM, Eliot Miranda <[hidden email]> wrote:
> Hunh. I got the impression from the svn tree that they actually shared that part of things.
>
> They do.  platforms/Cross/plugins and platforms/win32/plugins are shared.  The more sharing the better.  But it's a merge and a fair ammount of work.
>  

OK, so I’m only partly stupid on this one. I hope we can achieve a merge-back someday soon.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: IBLU: Ignore Basic Laws of Universe