Forum
Register Calendar Latest Topics
 
 
 


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

Senior Member
Registered:
Posts: 312
Reply with quote  #51 
If you didn't back up the cfg file, you will need to set it up again. The format of the cfg has changed slightly when the new calibration function was added. NIMH ML can read the old cfg, but, non-NIMH ML cannot read the one saved by NIML ML. I mentioned this somewhere above. Sorry for the inconvenience.
0
stremblay

Member
Registered:
Posts: 58
Reply with quote  #52 
Thanks Jaewon,

I had read your warning above about backing up the CFG, so I did back it up before running my tests. 
This problem is persistent even when I load back my backed up CFG. 
I am wondering if MGL did something to the graphics drivers or else to impose this new limit?

Thanks,
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #53 
Can you be more specific about how you tried to change the frame rate and resolution? Did you do it in the "Screen Resolution" panel of Windows? And you can't change them because Windows does not show the other choices? MGL just reads the current screen setting from Windows and doesn't change anything.
0
stremblay

Member
Registered:
Posts: 58
Reply with quote  #54 
Yes. In old ML, I can normally set different resolutions and frame rates for each screens from within ML Menu. Now, suddenly, I can't anymore. ML menu still shows several options. But any setting I make from within ML Menu for one screen are automatically copied to the other screen.  If these settings are not acceptable for the other screen (e.g. high frame rate), this leads to a crash in XGL. I get the error message: *** Error encountered during application of selected video settings *** .
I would like to recover the ability to set specific settings for each screens.

I know its impossible to do so in NIMH, and the settings need to be changed from Windows. The new problem I have is with old ML on 32-bit Matlab, after running NIMH ML on the same 32-bit Matlab.

I hope this clarifies the issue.
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #55 
I don't understand the part, "any setting I make from within ML Menu for one screen are automatically copied to the other screen." If you mean both screens being blackened for a few second, that is not what you think. It is what normally happens when DirectX creates/destroys a full screen device.

Maybe Windows changes something when DirectX applications are executed, but MGL itself doesn't change anything. (The 30-Hz approximate frame rate that ML reports just means that there were 30 frames skipped. The refresh rate is still 60 Hz.) I have seen many times that XGL, the previous graphics library, failed to switch to the settings that Windows perfectly supports or the settings that previously worked fine. That is why I made MGL just read the already-working setting rather than test around the right combinations of resolutions and refresh rates.

In my computers, the native resolution and the default refresh rate always work whether MGL was run before or not. If there is a particular setting that you need but you cannot switch to it, do it in Windows first before trying it in ML. Sometimes manually resetting the refresh rate in Windows helps.

0
stremblay

Member
Registered:
Posts: 58
Reply with quote  #56 
OK Thanks a lot Jaewon!
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #57 
# Changes in NIMH MonkeyLogic, Dec 1, 2016

 + The subject screen is now created as a full-screen window. This helps ML
  keep up with the refresh rate of the screen without disabling Desktop Window
  Manager or even when the control screen runs at a different refresh rate.
  (Thanks to Sebastien Tremblay)
 
 ~ A sound can be added from a row vector now, which fixes an error occuring
  when a SND object is created from a sine wave. (Thanks to Soo Hyun Park)

0
stremblay

Member
Registered:
Posts: 58
Reply with quote  #58 
HI Jaewon,

I tested the performance of your new NIMH version on both my 32 bit and 64 bit Matlab. Here are the results of the Latency test. It seems you have resolved the issue with the video latency, which is back to more normal value, although with a couple of peaks above 1 msec. Static image latencies are great.


32-bit Matlab
NIMH_1Dec_32_bit_Matlab.png 
64-bit  matlabNIMH_1Dec_64_bit_Matlab.png 
To note, when running an actual task containing a single call to eyejoytrack, I will get Max latencies above 5 msec and the red box in control screen would be red in 64 bit MAtlab. In 32 bit, my max latencies are more around 2.5 msec. In old ML, I would get max latencies of 0.6 msec when a single call to eyejoytrack is present in the timing scripts (and get above 20 msec if a second call to eyejoytrack is present). For some unknown reason, it seems the second cycle is the slowest one by far. I can get you some plots of cycle latency as a function of cycle order if you want.

Here you go. I hope this helps.

Best,

0
Wing

Junior Member
Registered:
Posts: 16
Reply with quote  #59 
Hi Jaewon,
 
    One small question.
  
    I assigned a digital port as reward output,which can pass through the test in Main Interface of ML,

    but report a error when I initiate the demo dms task, which directs to the dms_runtime(line 97),says something like "attempting to use non-structure array words"?
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #60 
There was a typo in a script that prevented reward from working correctly. You must have downloaded before I updated the package for that. Please download the package again.
0
stremblay

Member
Registered:
Posts: 58
Reply with quote  #61 
Hi Jaewon,

By the way, regarding my preceding post, I forgot to mention that the video test now returns correct refresh rates on 64-bit Matlab. Good job!

Best,
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #62 
# Changes in NIMH MonkeyLogic, Dec 12, 2016

 + Now ML can run with one monitor for the testing purpose. In that case, the
  subject screen is replaced with a 1024x768 window.
 
 + The 2-D Spatial Transformation tool supports keyboard manipulation (N key,
  P key). (Suggestion from Xiaomin Yue and Sebastien Ballesta)
 
 ~ Some code in the calibration tools was re-written for old MATLAB versions.
  (Thanks to Wing from the ML forum)

0
Wing

Junior Member
Registered:
Posts: 16
Reply with quote  #63 
Thanks Jaewon!

   The calibration tool works fine now!

   However I found the reward function goodmonkey() doesn't work again; 

   Once I met a similar problem(see#59-60 on this page), and worked just after i updated the file;
   Anyway, this time the error report is different, see the first several rows of error below:

   /*
     Error use monkeylogic (line 1091)
     Timing File Execution Error

     Matrix index is out of range.

     ...
   */


   BTW: i'm using R2014a, 64bit.
           and the reward function in calibration tool works well.
 
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #64 
Hi Wing,

I don't see how the error is related to goodmonkey(). Can you provide more information? Or you can send me your task files so that I can test myself.
0
Wing

Junior Member
Registered:
Posts: 16
Reply with quote  #65 
Thank you for your kind help Jaewon!

   I first found the problem when I tested your dms demo, where I targeted the error source as goodmonkey();

   I confirmed this by running a task/timing file with only the goodmonkey() command, which reported the same error.

   So if it is true that something wrong this reward function, you could see the error 
 by running any task/timing file with the goodmonkey() command.

   I'm checking other possible reasons causing this.


  Thanks again~
  
   
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #66 
Hi Wing,

I think I found the cause. The DMS task is actually what I downloaded from the official ML website. Somehow the syntax of goodmonkey() in the task is different from what is described in the online manual. So please change the goodmonkey call like the following.

From: goodmonkey(50, 3); % 50ms of juice x 3
To:   goodmonkey(50, 'NumReward',3); % 50ms of juice x 3
0
Wing

Junior Member
Registered:
Posts: 16
Reply with quote  #67 
Thank you Jaewon!

    That is indeed the cause, and sorry for this kind of question, i should check more with the official document.


    
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #68 
# Changes in NIMH MonkeyLogic, Dec 15, 2016

 + Support for customizing the reward function, goodmonkey(). See
  reward_function.m. Also multiple digital lines can be assigned to "Reward"
  now.
 
 ~ A problem that stops the task when STM objects are not used during the trial
  is fixed. (Thanks to Joshua Aman)

0
stremblay

Member
Registered:
Posts: 58
Reply with quote  #69 
thanks for this new update Jaewon.

Frame rate is good on my side, as well as average cycle rate. Still get a max latency around 20 msec with my task.

Also, got this error message after running a test session.

<<< MonkeyLogic >>> Finished running trials at 8:26 PM.
<<< MonkeyLogic >>> Completed 7 correct trials over 12 total trials.
Warning: 'ccepted   15-D' exceeds MATLAB's maximum
name length of 63 characters and has been truncated to 'ccepted
  15-'.
> In bhv_read (line 542)
In behaviorsummary (line 75)
In monkeylogic (line 1381)
In mlmenu (line 2202)
Invalid field name: 'ccepted   15-D'.

Error in bhv_read (line 542)
VarChanges.(fn).Trial = fread(fidbhv, n, 'uint16');

Error in behaviorsummary (line 75)
bhv = bhv_read(inputfile);

Error in monkeylogic (line 1381)
behaviorsummary('CurrentFile');

Error in mlmenu (line 2202)
monkeylogic(condfile, datafile, testflag);

Error while evaluating UIControl Callback

0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #70 
It was due to some of my last minute change. I updated the package immediately, but you probably downloaded it before I replaced. Please download again. Sorry for the inconvenience.
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #71 
# Changes in NIMH MonkeyLogic, Dec 16, 2016
 
  + Now BHV.AbsoluteTrialStartTime records the elapsed time from the task start
   in milliseconds. Previously this field was filled with the system clock
   reading, but the system clock is vulnerable to many unauthorized changes and
   therefore the name, "absolute time", was misleading. The system clock is
   stored in BHV.TrialDateTime instead.
   
  + Now user-defined functions in the timing file can be inserted into runtimes
   properly. Those functions must be defined at the end of a timing file and
   terminated with 'end'.
   
  + Now NIMH ML does not copy CondSelectFunction, BlockSelectFunction,
   BlockChangeFunction, UserPlotFunction, etc. to the RuntimeDirectory and
   reads directly from the ExperimentDirectory, where the timing and condition
   files are placed.
 
  + Unnecessary initialization sequences were removed for the fast startup.

0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #72 
Hi stremblay,

Today I had a chance to look into your task more carefully. At the very beginning of the trial, you are using eyejoytrack() to check whether the subject is already touching the screen.

%Dont start trial if hes already touching the screen
[ontarget, ~] = eyejoytrack('touchtarget', 1, 40, 800);
while ontarget
    pause(1)
    [ontarget, ~] = eyejoytrack('touchtarget', 1, 40, 800);
end

Unfortunately my ML uses a transparent bitmap to draw a fixation window around the target, so this call internally creates a huge bitmap (40 deg x 40 deg). I believe this is the reason that you get a high MaxLatency. If I may suggest a different way to do it, I would try the following.

[~,button] = mouse_position;
while any(button)
    idle(800);
    [~,button] = mouse_position;
end


Please update your ML with the new version I linked above before trying. I hope this will help.
0
stremblay

Member
Registered:
Posts: 58
Reply with quote  #73 
Thanks very much Jaewon,

I will give it a try right now.

I just tested your Dec 16th version and I received this new error when closing a session.

<<< MonkeyLogic >>> Finished running trials at 10:27 AM.
<<< MonkeyLogic >>> Completed 0 correct trials over 4 total trials.
Error using matlab.ui.Figure/set
Invalid or deleted object.

Error in ReplicaRect (line 3)
set(hmlmonitor,'Units','pixel');

Error in initcontrolscreen>@(jAxis,jEvent,hFig)mglsetcontrolscreenrect(ReplicaRect(hFig)) (line 479)
set(jAxis.getComponent(0),'AncestorMovedCallback',{@(jAxis,jEvent,hFig) mglsetcontrolscreenrect(ReplicaRect(hFig)),hFig});

Error using matlab.ui.Figure/set
Invalid or deleted object.

Error in ReplicaRect (line 3)
set(hmlmonitor,'Units','pixel');

Error in initcontrolscreen>@(jAxis,jEvent,hFig)mglsetcontrolscreenrect(ReplicaRect(hFig)) (line 479)
set(jAxis.getComponent(0),'AncestorMovedCallback',{@(jAxis,jEvent,hFig) mglsetcontrolscreenrect(ReplicaRect(hFig)),hFig});

Closed MonkeyLogic.
>>

0
stremblay

Member
Registered:
Posts: 58
Reply with quote  #74 
Hey Jaewon,

With regards to your Max Latency suggestion, it seems to have worked. My Max latency went from 25 msec to an interval 0.7 - 5 msec. I wonder if it would be possible to lower that even farther to < 1 msec, or if you think it's not necessary. 

I'm also wondering now, since this Max latency is computed only over calls to eyejoytrack, what about the latency of other operations, like sending behavioral codes for example? Do we have any information about that? is it really sub-millisecond? 

Thanks Jaewon!
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #75 
You can ignore that error. It occurs when the control screen figure is closed before all window move messages are processed. I will make a change to prevent it from happening.

I think I will need to test further when the latency occurs.

You can put tic and toc before and after eventmarker() and see how long it takes. Because of Just-In-Time code compilation of MATLAB, there can be some delay in the very first few runs, but timing should be reasonably accurate in the millisecond range.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation: