Closed wjbrainco closed 5 years ago
The problem is not with load_xdf, it is a problem with your xdf file. Something appears to be wrong with how the time stamps are recorded. This line of code is dealing with clock synchronization, but typically if there is a problem there, there is also a problem with the data itself. Something to try is to call load_xdf.m with the arguments ('HandleClockSynchronization', false) and see what happens. You won't get this error (because the routine will get skipped) but you might get other problems.
There might be a problem with the Enobio app itself. I myself have never used it. I note that the readme says that it is untested which means Christian wrote it years ago according to the instructions in the API, but without ever having hardware on hand with which to test it.
On 7/24/2018 9:49 PM, wjbrainco wrote:
I have been recording data using the Enobio and LSL. When I try to load the .xdf file using load_xdf.m I get the following error.
Error using chol Matrix must be positive definite.
|Error in load_xdf>robust_fit (line 639) L = sparse(chol(A'*A,'lower')); U = L'; Error in load_xdf (line 398) mappings{r} = robust_fit([ones(idx(2)-idx(1)+1,1) clock_times(idx(1):idx(2))']/opts.WinsorThreshold, clock_values(idx(1):idx(2))'/opts.WinsorThreshold); |
I tried to test the same function with the MouseButton App and the function works.
Attached are my .xdf files recorded by LSLrecorder
Files.zip https://github.com/sccn/labstreaminglayer/files/2225112/Files.zip
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sccn/labstreaminglayer/issues/322, or mute the thread https://github.com/notifications/unsubscribe-auth/ADch7twS3-1a-O1ys3Y9ZGFsJSGins1Lks5uJ3pkgaJpZM4VdYHp.
This can happen when there are no clock synchronization chunks in the xdf file. And in the EEGLAB e.t.c the default setting for HandleClockSynchronization in load_xdf() is true. Therefore, robust_fit function fails because there is no data.
I have the same problem with an xdf file created using Lab Recorder. When I use ('HandleClockSynchronization', false), Matlab crashes. I include the error message below. Does anyone have an idea how to include clock synchronization chunks when using Lab Recorder? Thanks!
Segmentation violation detected at Mon Apr 15 18:06:41 2019
Abnormal termination: Segmentation violation
Register State (from fault): RAX = 0000000000000002 RBX = 0000000000000001 RCX = 90f10a471e8700c3 RDX = 000000012a934020 RSP = 000070001089f920 RBP = 000000013134e200 RSI = 000000013134eda0 RDI = 00007f8ad1cc9ea0
R8 = 000070001089f820 R9 = 0000000103b1de0c R10 = 0000000000005f2f R11 = 000000012a934020 R12 = 000070001089f9a0 R13 = 00000001286a1d25 R14 = 00000001280fa020 R15 = 000070001089f928
RIP = 00000001280fa020 RFL = 000070001089f920
CS = 00007f8ad1cc8ba0 FS = 000070001089f958 GS = 000070001089f960
Stack Trace (from fault):
[ 0] 0x00000001038a3874 /Applications/MATLAB_R2014a.app/bin/maci64/libmwfl.dylib+00030836 _ZN2fl4diag15stacktrace_base7captureERKNS0_14thread_contextEm+00000052
[ 1] 0x00000001038a72aa /Applications/MATLAB_R2014a.app/bin/maci64/libmwfl.dylib+00045738 _ZN2fl4test17terminate_handledEv+00000906
[ 2] 0x00000001038a6cf5 /Applications/MATLAB_R2014a.app/bin/maci64/libmwfl.dylib+00044277 _ZN2fl4diag13terminate_logEPKcPK17__darwin_ucontext+00000117
[ 3] 0x0000000103414d07 /Applications/MATLAB_R2014a.app/bin/maci64/libmwmcr.dylib+00269575 _Z32mnRunPathDependentInitializationv+00003127
[ 4] 0x0000000103414ff8 /Applications/MATLAB_R2014a.app/bin/maci64/libmwmcr.dylib+00270328 _Z32mnRunPathDependentInitializationv+00003880
[ 5] 0x000000010341281a /Applications/MATLAB_R2014a.app/bin/maci64/libmwmcr.dylib+00260122 mnFatalSignalHandler+00000298
[ 6] 0x00007fff6fc4ff5a /usr/lib/system/libsystem_platform.dylib+00008026 _sigtramp+00000026
[ 7] 0x00007f8ad1cd5d60
I have solved the issue by re-compiling the labrecorder and adding dummy clock offset chunks to the xdf file if there are none.
This issue is fixed in master (as sahin-ozsoy noted) and available in liblsl-1.13.0 at https://github.com/sccn/liblsl/releases and LabRecorder-1.13.0-b3 at https://github.com/labstreaminglayer/App-LabRecorder/releases.
I have been recording data using the Enobio and LSL. When I try to load the .xdf file using load_xdf.m I get the following error.
Error using chol Matrix must be positive definite.
I tried to test the same function with the MouseButton App and the function works.
Attached are my .xdf files recorded by LSLrecorder
Files.zip