Initialization function error (Time scale must > 0)

About BCI and box tutorial/demo scenarios bundled with OpenViBE.
Post Reply
umichfan1
Posts: 2
Joined: Sat Oct 10, 2015 3:30 pm

Initialization function error (Time scale must > 0)

Post by umichfan1 »

I am using OpenViBE to display the spectrogram over time of data recorded using an emotive EPOC headset. I wrote this code several months ago and it worked, but now when I come back and try to run it again, I get an error message that I cannot find anywhere on this forum. It reads:

[ERROR] At time 0.000 sec <Box algorithm::(0x00004f68, 0x00005877) aka Corrupted signal> Time scale must be > 0
[WARNING] Box algorithm <Corrupted signal> has been deactivated because initialize() function returned error
[ERROR] At time 0.000 sec <Box algorithm::(0x00005579, 0x00007cff) aka Raw signal> Time scale must be > 0
[WARNING] Box algorithm <Raw signal> has been deactivated because initialize() function returned error

OpenViBE then crashes. It appears to make it all the way through the entire initialization function (shown below) before crashing. I am using Windows 7, and version 1.1.0 of OpenVibe. Any insight would be much appreciated. Thank you.

function box_out = FFT_Initialize(box_in)

% we display the setting values
disp('Box settings are:')
for i=1:size(box_in.settings,2)
fprintf('\t%s : %s\n',box_in.settings(i).name, num2str(box_in.settings(i).value));
end

%determine how many rows box_in.user_data.M should have
plot_range_fmin = box_in.settings(2).value;
plot_range_fmax = box_in.settings(1).value;
box_time=1.0; %duration (in seconds) of each epoch of time (click on "Time based epoching" in xml file to obtain this value)
Fs = 128; % Sampling rate (Hz)
N = box_time*Fs; % length of signal (number of samples)
NFFT = 2^nextpow2(N); % Next power of 2 from length of y
f = Fs/NFFT*[0:NFFT/2-1];
plot_ind=find(f>plot_range_fmin & f<plot_range_fmax); %need this to determine how many rows in box_in.user_data.M

% let's add a user-defined indicator to know if the output header is set
box_in.user_data.is_headerset = false;
% Global variables
box_in.user_data.nb_matrix_processed = 0;
box_in.user_data.M = zeros(length(plot_ind)+1,11); %allocate one more row than we need because of stupid pcolor
numofchan=2;%number of channels we want to observe
for ii=1:numofchan
figure;
end

box_out = box_in;

end

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Initialization function error (Time scale must > 0)

Post by jtlindgren »

Hello,

the printed error is apparently related to signal display box parameter for the time scale being <= 0, but its not easy to say as you've renamed the box. ;) Check the box settings and update the whole box if it says it needs that. After you've got rid of that error, see that all the boxes are properly updated. If that fixes it, let us know!

If the crash still persists, please send us the *whole* scenario (everything needed to run it) as a zip. We'll run the thing in a debug build to find out where the crash exactly is. Its not easy to say from the code snippet and your description what it might be.


Cheers,
Jussi

umichfan1
Posts: 2
Joined: Sat Oct 10, 2015 3:30 pm

Re: Initialization function error (Time scale must > 0)

Post by umichfan1 »

I discovered one major clue: my code crashes in version 1.1.0, but it runs fine in 0.18.0. So that was part of the problem...though I would clearly still like to get it to run in the latest version.

I'm not very good with understanding how the boxes work...to be honest I just downloaded a tutorial Matlab script and fiddled with it until it worked. Where can you see that I've "renamed the box"?

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Initialization function error (Time scale must > 0)

Post by jtlindgren »

Hi, "Corrupted signal" is probably a renamed Signal Display box, in this case the tutorial may have renamed it already. It makes just a bit more difficult to guess from the log you printed which box it is. Its probably signal display.

If you load a scenario saved with a previous version of OpenViBE, you need to look carefully at the boxes, if there reads "update" in any of them, you need to drag a new box of the same type into the scenario, connect it again, and copy the settings from the previous one. This is a bit inconvenient but unfortunately we don't have an automatic way to do it.

You can also take the tutorial from 1.1.0, verify that it is working, and then just replace the matlab script. This way you can isolate if we've broken the tutorial for your system or if your script outputs something which causes the crash.


Cheers,
Jussi

Post Reply