Forum
Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment   Page 2 of 5      Prev   1   2   3   4   5   Next
emadreza

Junior Member
Registered:
Posts: 15
Reply with quote  #26 
Quote:
Originally Posted by Jaewon
- fixed a "missing field" error that occurred when setting DAQ from scratch
- fixed a bug that crashed MATLAB when bitmaps are added


I also tested this new code. there are another problems.
 

Reference to no-existence field 'OutOfBounds'
Erorr inn xycalibrate  (line 442)

set(tgt,'xdata',ScreenInfo.OutofBounds,'ydata', ScreenInfo.OutOfBounds);
Frorr while evaluating UIControl Callback
0
niemeyej

Junior Member
Registered:
Posts: 18
Reply with quote  #27 
I'm getting the same problem during eye calibration. Your line numbers are different but sounds like the same issue?
eyeCalibError9_23_2016.JPG 

0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #28 
Sorry for the late answer, guys. In my workplace, people do not use xycalibrate.m for calibration, so it was not tested sufficiently. I am working on something else now, but will try to fix it by next week. Thanks.
0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #29 
NIMH MonkeyLogic is updated. The changes in this version are like the following.

# Changes in NIMH MonkeyLogic, Oct 17, 2016

 + Vertical syncing during movie playback is improved.
 
 + The eye & joy calibration tool is improved. Fixation cues can be triggered
   with mouse clicks. Also a new calibration function (origin-gain method) is added.
   
 + Online analoginput smoothing is supported from the main GUI.

 + During the simulation mode, each button can be simulated individually with
   keys 1-0 and is on only while the key is pressed, just like a real button.

All previously reported issues except USB joysticks are fixed in this version. The new calibration function may need some instructions, so I will post them later.

To support multiple calibration methods, the CFG structure had to be changed. If you want to test this version, please make a backup of your task CFG file (*_cfg.mat) first. Once modified with this version of ML, it cannot be read in the previous versions.
0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #30 
I forgot to check version compatibility, so the calibration tools in the previous package did not work with old versions of MATLAB. It is fixed in the new version linked below. 

0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #31 
# Changes in NIMH MonkeyLogic, Oct 21, 2016

 + The maximum numbers of buttons and general inputs that can be connected are
   increased to 10 and 16, respectively.
 
 + USB joysticks are supported. When both analog joystick and USB type are
   available, the USB type takes precedence.
   
 + The Origin-Gain calibration tool allows negative gains to flip the polarity
   of input signals.

0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #32 
# Changes in NIMH MonkeyLogic, Oct 28, 2016

 + Added a new command, rewind_movie(object_num, time_in_msec), which moves the
   current position of the movie to the given time.

0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #33 
# Changes in NIMH MonkeyLogic, Nov 1, 2016

 + Added a new command, get_movie_duration(object_num, time_in_msec), which
   returns the legnth of the movie in milliseconds.
   
 ~ The problem that sometimes MATLAB stalls when movie objects are removed
   is fixed.

0
stremblay

Member
Registered:
Posts: 65
Reply with quote  #34 
Hi Jaewon,

I am using March 11 2016 (1.1.56) version of ML without NIMH DAQ on 32-bit Matlab. I use to not sample any analog data and get acceptable latencies and cycle rates. Now I just added an eye tracker to my setup and am now sampling eye date at 1Khz from analog inputs. When I use the raw eye data without calibrating it in ML, I get acceptable latencies (see below). But when I apply a calibration to the eye signal, I get unacceptable latencies and cycle rates around 250 Hz, whereas I get 5000 Hz usually.

My question is: How does your NIMH DAQ handle sampling data and applying a calibration to it, in terms of latencies and cycle rates? Do you have the same issue I am reporting?

Thanks for your helps.



 EyeCalibration_On.png  EyeCalibration_Off.png 

0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #35 
Your behavior monitoring interval is almost constantly ~4 ms, but I cannot tell why it happens unless I test with the same code. Please send me your ML. The Github version used to have some performance issue and maybe it is a similar problem.

http://forums.monkeylogic.org/post/touch-screens-7491343?pid=1291903564
0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #36 
# Changes in NIMH MonkeyLogic, Nov 3, 2016

 ~ The problem that the new commands make an error when there is no movie
   stimulus in the condition is fixed.

0
ctestard

Junior Member
Registered:
Posts: 20
Reply with quote  #37 
Hi Jaewon,

I tested your latest version of NIMH ML (Nov 3rd) on my Matlab 2013b (32-bit), the same one I tested beforehand (stremblay post above). Here are the results of the ML latency when sampling eye data. As you can see, NIMH ML is much slower. 

Do you have an idea why this is the case? Is it that we are using a 32-bit version of Matlab?

Thanks! ML_vs_NIMH.png

0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #38 
Hi ctestard,

Thank you for the feedback.

I am afraid that the main problem is your computer being slow. What is the CPU of your computer?

To be sure, I attach a script that tests the calculation speed of the calibration function. In my computer that uses Intel Core i5-4570S 2.9GHz, the results are like the following. If you can run the script and post back the numbers from your computer, it will help me understand the problem better.

>> calib_speed_test

2-D transformation:    5881 times per sec.
Origin-gain       :  211432 times per sec.

If it is indeed due to the slow performance, I suggest trying my new calibration function, the Origin-Gain method. As shown above, it is 30-40 times faster than 2-D transformation and therefore may decrease the cycle latency.

But I want you to test it with a new version I will upload tomorrow. I found that I created a new hole in thread safety in the previous packages while trying to patch an old hole. I cannot access the network until I get to work tomorrow, so I deleted the download link temporarily for now. Sorry for the mess.
0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #39 
# Changes in NIMH MonkeyLogic, Nov 7, 2016

 + The subject screen is not re-drawn unless there is any change. This improves
   performance when there is no movie being presented.
   
 ~ A hole in the thread safety that can crash MATLAB during movie presentation
   is fixed. All previous versions are affected by it, so everyone should update.
   
 ~ The benchmark test shows the results in the same way as in the old ML, for
   easier comparison.

0
stremblay

Member
Registered:
Posts: 65
Reply with quote  #40 
HI Jaewon,

First, I tried to run the calib_speed_test on my computer using your nov-3 version and nov-7 version. Here are the results

2-D transformation: 10253 times per sec. (nov-3)
Origin-gain : 110027 times per sec.

2-D transformation: 10187 times per sec. (nov-7)
Origin-gain : 110012 times per sec.


My PC is a Win7(64-bit) 8-core Intel i7-4790K CPU 4.00 Ghz, 16 Gb RAM, Nvidia GTX 960 2Gb. 

Running NIMH ML on Matlab 2013b 32-bit, I get high max latencies and  slow cycle rates. Running the previous ML version I get cycle rates > 4000.

nov-3 version
with eye signal (raw): 700
without : 1000
nov-7 version
with eye signal (raw): 2500
without: 3500

In all cases, max latencies are in the red >50 msec

I don't know why NIMH is so slow on my config. My guess is the 32-bit Matlab, although you might have a better idea...

Thanks!

0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #41 
Hi stremblay,

The CPU architecture is very unlikely to be the source of the problem. I have a computer with a configuration similar to yours. When I run the benchmark with R2014a (32-bit), the results look like the figure below. Every option that can slow down the computer is turned on (eye, joy, buttons, 2-D spatial transformation for both eye & joy, online smoothing with a 20-ms window), so the base latency is a bit high (~0.8 ms), but still acceptable overall.

Can you send me your task files (condition, timing and *_cfg.mat)? Stimuli files, too, if possible. Since you have the slow performance issue with the old ML as well, I cannot just attribute it to the difference of the versions and need to rule out things one by one. So I need to create the same test condition as yours.

benchmark.png

0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #42 
# Changes in NIMH MonkeyLogic, Nov 9, 2016

 ~ The problem that MonkeyLogic Latency Test cannot be initiated when the
  selected calibration is not complete is fixed.
 
 ~ The error that occurs when Online smoothing is selected is fixed.

How to do the eye/joystick calibration with NIMH ML is posted here.
0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #43 
Hi stremblay,

I changed the way ML presents slightly. Would you test the package above (Nov 9, 2016) and see if there is any difference?

Plus, I attach another script that tests the video. I would appreciate it if you can run it in your computer and post the result. The \MonkeyLogic\mgl directory should be in the MATLAB path to run the script.

-----
If the Nov 9 package that you downloaded shows an error when AI is not setup, please download it again.
0
stremblay

Member
Registered:
Posts: 65
Reply with quote  #44 
Hi Jaewon,

I tested your new Nov 9 package on both 32-bit 2013b and 64-bit 2016b Matlab. I also append the results of the screen_test.m under the corresponding image. In all cases, the eye signal was inputted and 2D eye calibration was ON.

32-bit

NIMH9nov_2013b32bit_EyeOn_CalibON.png  

Mean frame time: 0.033322 0.033320
Mean present interval: 0.000102

64 bit

NIMH9nov_2016b64bit_EyeOn_CalibON.png 

Mean frame time: 0.033459 0.033457
Mean present interval: 0.000082

For comparison, here is your Nov 3 package with same parameters on 64-bit Matlab

NIMH3nov_2016b64bit_EyeOn_CalibON.png 

And your Nov 7:

NIMH7nov_2016b64bit_EyeOn_CalibON.png 

Mean frame time: 0.022551 0.022550
Mean present interval: 0.000089

Overall, it seems something got fixed in the Nov 7 and Nov 9 versions. I don't know what is going on with the Movie display results. When running my task, Cycle rates are around 2000 but Max latency is around 20 msec. I wonder what his max latency represents... it is the latency of what specifically? Should I worry with such a max latency?

Hope this helps,
 

0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #45 
Hi stremblay,

I am at SFN. I won't be able to test anything until I return, but I had a chance to look through the code you sent and your test results also help. Thanks. I will get back on this as soon as I come back.

By the way what is your refresh rate? Is it 60 Hz?

----------
If you have a chance in the mean time, would you run screen_test.m again with Line 9 commented out?
0
stremblay

Member
Registered:
Posts: 65
Reply with quote  #46 
Hi Jaewon,

Here are the results of screen_test with Line 9 commented out:

Mean frame time: 0.033449 0.033448
Mean present interval: 0.000007

Hope this helps,

0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #47 
Hi stremblay,

Your test result is very strange. It is like the refresh rate of your monitor is 30 Hz. What does the main GUI of MonkeyLogic say the resolution and the refresh rate of your screen are, when you choose the video device? Are they identical to what Windows reports in the Screen Resolution menu?
----------
There is a better way to check the refresh rate. Type the following on the MATLAB command line. This command calculates the rate based on the actual performance.

>> [subjectscreen,controlscreen] = mglgetrefreshrate

0
stremblay

Member
Registered:
Posts: 65
Reply with quote  #48 
You are right Jaewon, NIMH ML returns a 30 Hz refresh rate after pushing the Test button on the GUI (I could't run mglgetrefreshrate without initializing other things). This is despite both Windows and NIMH ML showing a 60 Hz requested refresh rate (1280 x 1024 60Hz). This is indeed very strange... Any idea why?

Another thing that I find strange is the startup message when launching NIMH ML. (see below) It detect " 8 AMD64" processors " although my processor is Intel. Previous ML would detect 8 "x86 processors". Also, the Approximate Matlab cycle rate is quite small (1672 Khz). I use to have base cycle rates above 4500 Khz with the previous ML. I'm hoping this set of symptoms makes sense to you!

Thanks!


<<< MonkeyLogic >>> Revision Date: NIMH MonkeyLogic (Nov 9, 2016 build 34)
<<< MonkeyLogic >>> Operating System: Windows_NT...
<<< MonkeyLogic >>> *** JAVA Virtual Machine is Running ***
<<< MonkeyLogic >>> Computer Name: 233-NEUROPHYS-1...
<<< MonkeyLogic >>> Logged in as "Michael Petrides"...
<<< MonkeyLogic >>> Detected 8 "AMD64" processors...
<<< MonkeyLogic >>> Matlab version: 9.1.0.441655 (R2016b)...
<<< MonkeyLogic >>> Approximate Matlab cycle rate is 1672 kHz
<<< MonkeyLogic >>> Launching Menu...
<<< MonkeyLogic >>> Initialized Task Menu...
<<< MonkeyLogic >>> Initialized MonkeyLogic Graphic Library (MGL)...
<<< MonkeyLogic >>> Found 2 video devices...
<<< MonkeyLogic >>> Initialized Video Menu...
<<< MonkeyLogic >>> Initialized Control-Screen Menu...
<<< MonkeyLogic >>> Gathering I/O board info...
<<< MonkeyLogic >>> DAQ Toolbox Version: NIMH daqtoolbox (Oct 31, 2016 build 38)
<<< MonkeyLogic >>> DAQ Driver Version: National Instruments 15.0 NI-DAQmx
<<< MonkeyLogic >>> Found 3 I/O adaptors:
... 1) nidaq: PCIe-6321
... 2) nidaq: PCIe-6321
... 3) winsound: Speakers (Realtek High Definiti
<<< MonkeyLogic >>> Initialized I/O Menu...
<<< MonkeyLogic >>> Initialized drop-down menus...
<<< MonkeyLogic >>> Ready.

BTW. I also get this warning message in Matlab before the above log

Warning: The file 'F:\NIMH_test\NIMH_MonkeyLogic_(Nov-9-2016)\MonkeyLogic\monkeylogic.m' could not be cleared because it contains MATLAB code that is currently
executing.
> In mlflush (line 13)
In monkeylogic (line 92)

And this warning message when launching my task:

<<< MonkeyLogic >>> Initialized data file F:\NIMH_test\NIMH_MonkeyLogic_(Nov-9-2016)\MonkeyLogic\task\Cond_association_task\Wireless_8A_test_2016-11-15.bhv...
<<< MonkeyLogic >>> Starting up DAQ...
Warning: Unable to test IO type TouchX for subsystem validity using "initio.m"
Warning: Unable to test IO type TouchY for subsystem validity using "initio.m"
Warning: Unable to test IO type MouseX for subsystem validity using "initio.m"
Warning: Unable to test IO type MouseY for subsystem validity using "initio.m"
<<< MonkeyLogic >>> Successfully initialized DAQ system.
<<< MonkeyLogic >>> Starting up video...

Best
0
Jaewon

Administrator
Registered:
Posts: 424
Reply with quote  #49 
I think this 30-Hz rate is the source of the problem. Unfortunately I don't have proper testing equipment here with me, so I have to get back to this after SFN.

mglgetrefreshrate.m is in the \MonkeyLogic\mgl directory. The directory is added to the MATLAB path when MonkeyLogic is initialized. If you want to run it without initializing ML, you can manually add the directory.

I didn't change the code detecting the CPU. "AMD64" is a typical architecture code name for 64-bit CPUs. It doesn't necessarily mean the CPU is manufactured by AMD.

I didn't change the code for the approximate Matlab cycle rate either. The code that ML runs for it is like the following. You can test it without ML.
----- beginning of the code -----
numloops = 1000;
t = zeros(numloops, 1);
tic;
for i = 1:numloops,
    t(i) = toc;
end
mrate = 1/(mean(diff(t))*1000);
fprintf('<<< MonkeyLogic >>> Approximate Matlab cycle rate is %4.0f kHz\n', mrate);
----- end of the code -----

I see the same warning message of "could not be cleared" in my recent versions of MATLAB, but it hasn't been a problem. I think it has something to do with MATLAB's cache mechanism.

The warnings for IO type, "TouchX", "TouchY", "MouseX", "MouseY" can be ignored. They are the names assigned to non-existing devices in the GitHub version. I will make ML delete them next time.

0
stremblay

Member
Registered:
Posts: 65
Reply with quote  #50 
Hey Jaewon,

New problem: While running some tests using NIMH ML on my 32-bit 2013b Matlab (Win7) I noticed that its impossible to set different frame rates for the control and subject monitor. 
The problem is, when I reverted back to my old ML version (non-NIMH), I suddenly lost the capacity to set frame rates and resolutions specifically for my control and subject monitor. For some reason, the settings of one monitor are now identical to the other monitor, and I can't change that.

This also happened on a second PC after running NIMH ML on Matlab 32-bit. Lost control of screen settings even when using old ML.

Can you please advise?

Thanks,
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.