uludaggonul / snow-dots

Automatically exported from code.google.com/p/snow-dots
0 stars 0 forks source link

dotsReadableHID.plotData() fails intermittently #62

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Start Matlab
2. create an instance of dotsReadableHIDKeyboard
3. call its plotData() method

What is the expected output? What do you see instead?
Sometimes plotData() behaves normally, and key presses are detected and 
represented in a figure plot.  Some times the keyboard is non-responsive.  The 
success or failure seems to last for a Matlab session (i.e. restarting Matlab 
can change the success or failure)

So far, the failure seems to occur with Matlab in 32-bit mode.  For example, 
one machine with failures has versions

MATLAB Version 7.10.0.499 (R2010a)
MATLAB License Number: 327638
Operating System: Mac OS X  Version: 10.7 Build: 11A511
Java VM Version: Java 1.6.0_26-b03-383-11A511 with Apple Inc. Java HotSpot(TM) 
Client VM mixed mode

Even when plotData() fails, mexHIDScout seems to work.  So the problem seems to 
be internal to Matlab and/or the dotsReadable classes.

Using raw mexHID commands and the device ID and element cookies of the keyboard 
instance, it's possible to poll for keypress data.  So the problem seems to be 
related to queued event reporting.

The keyboard instance is reporting success when opening the HID event queue.  
However, the queue callback method is never being invoked.

It might be worth rebuilding the mexHID binaries on a newer version of OS X, 
before attempting serious debugging.

Original issue reported on code.google.com by Benjamin.Heasly on 10 Jan 2012 at 4:56

GoogleCodeExporter commented 8 years ago

Original comment by Benjamin.Heasly on 10 Jan 2012 at 5:00

GoogleCodeExporter commented 8 years ago
I was able to reproduce this on my laptop, which has versions

MATLAB Version 7.12.0.635 (R2011a)
MATLAB License Number: 353265
Operating System: Mac OS X  Version: 10.6.8 Build: 10K549 
Java VM Version: Java 1.6.0_29-b11-402-10M3527 with Apple Inc. Java HotSpot(TM) 
64-Bit Server VM mixed mode

I was also able to reproduce while running the Matlab profiler.  Matlab was 
spending lots of time on many, many calls to num2str().  I suspect this was 
part of the problem.

I added a pause() to the loop, in addition to drawnow().  This seemed to have 
prevented the problem from happening again.

I'm not closing this yet, since it should be tested by others...

Original comment by Benjamin.Heasly on 17 Feb 2012 at 8:03

GoogleCodeExporter commented 8 years ago
I'm changing this to low priority because I have no action to take on it until 
I get feedback from a user.

Also, I don't know what "medium" would mean, if not "less than high", which 
means "low".

Original comment by Benjamin.Heasly on 21 Mar 2012 at 3:16

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I reproduced this on a Macbook Pro (running Snow Dots trunk from a couple of 
weeks ago):

--------------------------------------------------------------------------------
-----
MATLAB Version 7.12.0.635 (R2011a)
Operating System: Mac OS X  Version: 10.7.3 Build: 11D50 
Java VM Version: Java 1.6.0_31-b04-415-11M3635 with Apple Inc. Java HotSpot(TM) 
64-Bit Server VM mixed mode
--------------------------------------------------------------------------------
-----

I've only ever had it happen after I've terminated a function using Ctrl-C. 
When keyboard inputs fail, it seems to stay that way for the entire session.

Original comment by brianlau...@gmail.com on 16 Apr 2012 at 5:11