Problem with new acquistion driver

Come here to discuss about OpenViBE in general!
Post Reply
toncho11
Posts: 123
Joined: Tue Apr 19, 2011 7:58 pm

Problem with new acquistion driver

Post by toncho11 »

Hi,

I am exploring the tutorial about the new acquisition driver. Driver was automatically generated and placed where specified.

I have registered my driver in: ovasCAcquisitionServerGUI.cpp (header and vector)
Do I need to register the configuration "CConfigurationTestDriver"? This is what I missed last time.

Code: Select all

boolean CDriverTestDriver::initialize(
	const uint32 ui32SampleCountPerSentBlock,
	IDriverCallback& rCallback)
{
	assert(&m_rDriverContext!=NULL);//fails here

	if(m_rDriverContext.isConnected()) return false; //actually here
	if(!m_oHeader.isChannelCountSet()||!m_oHeader.isSamplingFrequencySet()) return false;
Currently my code fails with m_rDriverContext being NULL.

Please advise.

-Anton

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: Problem with new acquistion driver

Post by lbonnet »

Hi Anton !

The only thing you need to use a new driver is registering it in the ovasCAcquisitionServerGUI.cpp file (#include and push_back in the vector), the configuration is not registered.
.. and if your driver is flagged as unstable, set AcquisitionServer_ShowUnstable to true in the config file.

I tried to assert the existence of m_rDriverContext too in a new empty driver, but couldn't reproduce what you are experiencing.
You didn't modify anything else, did you ?

Laurent-
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

toncho11
Posts: 123
Joined: Tue Apr 19, 2011 7:58 pm

Re: Problem with new acquistion driver

Post by toncho11 »

Hello Laurent,

I have another problem that might be the primary problem.

When I add the new driver files in the project file something goes wrong with the compilation.

Visual Studio can not find <gtk/gtk.h> all of a sudden in ovasCConfigurationBuilder.h

Do you use VS 2010?

Please try to add the files I have attached. Does it compile with them?

Without the new files everything compiles and runs as expected.
Attachments
ovasCDriverTestDriver.zip
(3.95 KiB) Downloaded 210 times

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: Problem with new acquistion driver

Post by lbonnet »

Hello Anton,

Your source code works fine on my computer.
And seems very simple to me... no big deal except the assert part.

I use Visual Studio 2010.

Did you try cleaning the cmake cache and re-build from scratch the acquisition server ? (delete local-tmp/openvibe-application/acquisition-server)
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

toncho11
Posts: 123
Joined: Tue Apr 19, 2011 7:58 pm

Re: Problem with new acquistion driver

Post by toncho11 »

Hello,

I regenerated projects and reconfigured the acquisition server in VS.

I found the problem. It is:

Code: Select all

m_vDriver.push_back(new CDriverTestDriver(m_pAcquisitionServer->getDriverContext()));
and not:

Code: Select all

m_vDriver.push_back(new CDriverTestDriver(*m_pDriverContext)); //as in the tutorial
m_pDriverContext is NULL at that time

Please, change it :D

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

Re: Problem with new acquistion driver

Post by jlegeny »

Hello Anton,

indeed there was an error in the tutorial. Thank you for your input, it is corrected now.

Cheers
Jozef

Post Reply