Assertion failed when using P3Speller

Known Issues and Problems with BCI2000
Locked
Volk
Posts: 4
Joined: 18 Aug 2010, 07:16

Assertion failed when using P3Speller

Post by Volk » 08 Sep 2010, 08:25

Greetings,

we have a problem with errors showing up while doing the calibration session when trying to set up the P300 speller. During the run (usually while trying to spell the 2nd char in words THE or QUICK) we encounter an error:

"Assertion failed, file xxtype.cpp, line 262", followed by "Abnormal program termination" which halts the whole program.

We tried several different runs and did a couple of runs from scratch (making a new parameter file for our amplifier) but that didn't fix the problem. On one of the runs we got a similar error but this time it looked like this:

"Assertion failed, ((unsigned__far*)vtablePtr)[-1]==0, file xxtype.cpp, line 1099)", again, followed by "Abnormal program termination".

We're using the standard batch file but because we're using Olimex EEG boards we have the ModularEEG module in the batch file. We're using the source code downloaded from the SVN, revision 2942 on Windows XP Service Pack 2.

Also we did the same run yesterday using the same parameter file we used on a couple of runs today but we got the first error when we tried to add the parameter file generated by P300 GUI for the values needed for Classifier matrix but that was solved by using the parameter file generated by P300Classifier.exe and we could finish the whole process without any errors.

Any suggestions on how to fix this problem?

Thanks in advance.

Dejan Volk

mellinger
Posts: 1071
Joined: 12 Feb 2003, 11:06

Post by mellinger » 08 Sep 2010, 08:45

Dejan,

can you determine which process/executable is reporting the errors?
Do the errors occur when you use the SignalGenerator source module with parameter files that triggered them with the ModularEEG source module?
If the errors occur with the SignalGenerator source module, please send me the offending parameter files by email (button below).

Otherwise, there appears to be a problem with the ModularEEG source module. Lacking the hardware, I cannot test or fix this source module. You would need to run it from the Visual Studio debugger to see where it fails.

Best regards,
Juergen

Volk
Posts: 4
Joined: 18 Aug 2010, 07:16

Post by Volk » 08 Sep 2010, 10:02

Greetings,

1.) The error gets reported by the P3Speller.exe module.
2.) Yes, the "Assertion failed, file xxtype.cpp, line 262" still occurs if I use the same configuration file, I've send you an email containing the .prm file

Best regards,

Dejan

mellinger
Posts: 1071
Joined: 12 Feb 2003, 11:06

Post by mellinger » 09 Sep 2010, 11:09

Dejan,

thank you for the prm file.
On my machine, the P3Speller runs fine with your parameter file, both as a debug and a release version. Could it be that you are using a modified version of the P3Speller? Note that the svn update command does not revert changes that may exist in source files.

Best regards,
Juergen

Volk
Posts: 4
Joined: 18 Aug 2010, 07:16

Post by Volk » 10 Sep 2010, 11:31

Greetings,

We haven't modified the P3Speller in any way, I actually downloaded the whole BCI2000 source again today, used the same parameter file and we still get the errors.

We ported the source code on another computer, which we thought was more suitable for the job (Core 2 Duo 3 GHz w/ 2 GB of RAM) since we thought our laptop with 512 mb RAM was causing the problems. We did some runs with both the modified ModularEEG.exe module and that parameter file and the unmodified ModularEEG.exe with electrodes in the air.

We didn't get the same error anymore, so we tried to make a proper run with modified ModularEEG.exe and our parameter file, but this time, we got the same error every time we wanted to do the calibration run (THE QUICK BROWN FOX), it crashed on FOX bit. If we ran BCI2000 with ModularEEG.exe module again and tried to do another calibration run, it immediately crashed when switching from T to H in the THE part. So we restarted our computer, tried the whole run again with ModularEEG.exe and it crashed again (same error) at the FOX bit again.

When we do a run without the electrodes actually attached to the subject, the calibration finishes without any problems but when we do have them attached, we get the error.

When I put the same parameter file with SignalGenerator.exe, we never get any errors, even if I start the batch file right after the batch with ModularEEG.exe crashes.

Now, the modification of ModularEEG we did only fixes an error in the code. When the program tries to calculate the timeout of the packet (modulareegparser.cpp), it does the following calculation: time1-PrecisionTime::Now(), where time1 is the time of the packet arrival, so this be calculation yields a negative value.

Because of that, we got unexplainable spikes in the signals, collected from ModularEEG, which was confirmed by checking the data drawn from the PACKET buffer in ModularEEG with Matlab, where we saw that the packet counter numbers were completely off.

We just changed that so it properly calculates the timeout: PrecisionTime::Now()-time1, so the signal now is as it should be. Although now we're not so sure we fixed anything because our modified ModularEEG.exe crashes like I described every time we do a proper calibration run with electrodes on the subject.

Worst of all, we didn't get a single crash when using the modified version of ModularEEG.exe while doing a run 2 days ago as I described it in my first post.

I would be very grateful if you have any suggestions on how to fix this problem or at least give us some general pointers on where to start our search.

Best regards,

Dejan Volk

mellinger
Posts: 1071
Joined: 12 Feb 2003, 11:06

Post by mellinger » 13 Sep 2010, 08:54

Dejan,

the first step toward a fix would be to reproduce a crash while running the ModularEEG module in the Visual Studio debugger. As soon as the crash occurs, execution will stop (in some MS library code, presumably), and you may examine the call stack to determine from where the crashing function was called. The crashes appear to be due to failed assertions--once you have determined their origin in the code, you will know which condition failed, and you may then search the ModularEEG code for a reason why that particular condition was false.

Best regards,
Juergen

Locked

Who is online

Users browsing this forum: No registered users and 1 guest