stimulation listener vs/ signal display

Making & changing hardware drivers in Acquisition Server
Post Reply
ntarrin
Posts: 18
Joined: Mon May 02, 2011 2:07 pm

stimulation listener vs/ signal display

Post by ntarrin »

Hello,

We are working on the Mitsar driver and to measure the stimulations it sends, we use both signal display and stimulation listener.

The test I use sends 1 stimulation 80 and 12 stimulations 40. I can see this on the signal display, but the stimulation listener shows something like 2 stim 80 and between 16 and 19 stim 40 (see snapshot). Did someone ever notice this or am I missing something ?

Nicolas.
Attachments
stim prob.JPG
stim prob.JPG (182.83 KiB) Viewed 9527 times

jlegeny
Posts: 239
Joined: Tue Nov 02, 2010 8:51 am
Location: Mensia Technologies Paris FR
Contact:

Re: stimulation listener vs/ signal display

Post by jlegeny »

Hi,

could it be possible that the window of the signal display is too small to fit all of the received stimulations and thus some of them overlap? In case of doubt I would believe the stimulation listener as the signal display box is getting quite old.

Jozef

ntarrin
Posts: 18
Joined: Mon May 02, 2011 2:07 pm

Re: stimulation listener vs/ signal display

Post by ntarrin »

The signal display window size is ok.

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: stimulation listener vs/ signal display

Post by yrenard »

Dear nicolas,

I would better trust the stimulation listener as the signal display is known to have a couple of issues with stimulation display. The problem is that you'd probably like to trust the signal display, right ? ;) Would you please dump the acquired streams in an OpenViBE file (not a GDF, an OpenViBE !) so I can give it a look to the stream structure ?

Yann

ntarrin
Posts: 18
Joined: Mon May 02, 2011 2:07 pm

Re: stimulation listener vs/ signal display

Post by ntarrin »

Hi Yann,

Oh yes, I want to trust what best fits my needs :twisted:

Here is the dump (rename the txt in ov as the forum reject .ov files).
I attach also a snapshot of the driver and listener output, which shows two times the same stimulation.

Thanks for your help !

Nicolas.
Attachments
debug listener2.JPG
debug listener2.JPG (197.39 KiB) Viewed 9513 times
record-[2011.07.22-11.20.35].txt
(29.69 KiB) Downloaded 228 times

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: stimulation listener vs/ signal display

Post by yrenard »

Dear Nicolas,

there is indeed a problem in this stream. At least one of the stimulations comes twice with exactly the same date but in two different stream chunks.

Where do this stream comes from ? Is it directly from the acquisition client box ?

Best,
Yann

ntarrin
Posts: 18
Joined: Mon May 02, 2011 2:07 pm

Re: stimulation listener vs/ signal display

Post by ntarrin »

Hi Yann,

Yes, it's a very simple scenario, with the writer just after the acquisition client.

Nicolas.

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: stimulation listener vs/ signal display

Post by yrenard »

Dear Nicolas,

Have you traced what happens in the acquisition server driver ? There may be a mistake there. (look for setStimulationSet).

If there is no mistake, the problem may be caused by the drift correction. Try to disable the drift correction and send us a status update.

If that's not solved, well... we'll have to think about it a bit more :)

Yann

ntarrin
Posts: 18
Joined: Mon May 02, 2011 2:07 pm

Re: stimulation listener vs/ signal display

Post by ntarrin »

Hi,

I've re-checked the setStimulationSet in the driver, checked that drift correction was disabled, and I have the same trigger duplication in the stimulation listener... (see attached picture).

Below is the code where this is done in the driver, including the debug output.

Code: Select all

	for ( OpenViBE::uint32 iStimulation=0; iStimulation < l_ui32NbStimulations; iStimulation++ )
    {
		l_oStimulationSet.setStimulationIdentifier(iStimulation, OVTK_StimulationId_Label(m_vStimulationIdentifier[iStimulation]));
		l_oStimulationSet.setStimulationDate(iStimulation, ( uint64(m_vStimulationDate[iStimulation]) << 32) / m_oHeader.getSamplingFrequency());
        l_oStimulationSet.setStimulationDuration(iStimulation, 1);

		std::cout << "Trigger " << std::hex << m_vStimulationIdentifier[iStimulation] << " ";
	}

	// Drift correction from GUI
	if (m_ui32DriftCorrectionState)
	{
		m_rDriverContext.correctDriftSampleCount(m_rDriverContext.getSuggestedDriftCorrectionSampleCount());
	}

	// SEND SAMPLES & STIMULATIONS
	m_pCallback->setSamples(&m_vOutputSamples[0],(uint32) SAMPLES_NB);
    m_pCallback->setStimulationSet(l_oStimulationSet);
Attachments
trigger duplication2.JPG
trigger duplication2.JPG (204.41 KiB) Viewed 9380 times

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: stimulation listener vs/ signal display

Post by yrenard »

Dear Nicolas,

as you are a programmer, may I ask you that you also trace what happens in the setStimulationSet callback in the acqusition server (see line 847 of file ovasCAcquisitionServer.cpp). Or, if you don't want to investigate in the acquisiton server code, please provide the source code of your driver so someone on the forum can investigate your code.

Best regards,
Yann

ntarrin
Posts: 18
Joined: Mon May 02, 2011 2:07 pm

Re: stimulation listener vs/ signal display

Post by ntarrin »

Hi Yann,
I have put an output in the acquisition server (in OpenViBEToolkit::Tools::StimulationSet::append).

If I run the acquisition server alone, it gives the wright number of stimulations. But if I run a basic scenario in the designer (displaying signal and stims), the output in acquisition server shows duplicates. Any idea what could it be ?

Attached is the driver code.

Thanks for your help.
Nicolas.
Attachments
ovasCDriverMitsarEEG202A.cpp
(11.66 KiB) Downloaded 210 times
ovasCDriverMitsarEEG202A.h
(2.02 KiB) Downloaded 236 times

Post Reply