[Solved] Acquisition server with Emotiv headset on Linux

Obtaining data from various hardware devices
DarkPatate
Posts: 47
Joined: Tue Apr 07, 2015 11:31 am

[Solved] Acquisition server with Emotiv headset on Linux

Post by DarkPatate »

Hello,
I want use the Openvibe software with my Emotiv headset, my university bought the Research SDK only for Linux. Unfortunately, and contrary to Windows, the Emotiv headset doesn't appear in the Acquisition server list.

To install OpenVibe I followed this instructions :

Code: Select all

|Building.on.Linux|

1. Short story

# cd scripts
# ./linux-install_dependencies
# ./linux-build
Before doing the last command, I change the cmake-module, but I'm not sure I did the correct operation, specially for the the paths. Indeed, all informations I found show Windows Path.
See the beginning of my FindThirdPartyEmotivAPI.cmake :

Code: Select all

# edkErrorCode.h EmoStateDLL.h
	#FIND_PATH(PATH_EmotivAPI edk.h  PATHS "/home/simeon/EmotivResearch_2.0.0.20"  "/home/simeon/EmotivResearch_2.0.0.20/doc/examples_Qt/example5" ${OV_CUSTOM_DEPENDENCIES_PATH})
	FILE(GLOB PATH_Candidates 
		"C:/Program Files/Emotiv Development Kit*" 
		"/home/simeon/EmotivResearch_2.0.0.20*"
	)
For information, my OpenVibe version is 1.0.0, my Emotiv SDK version is 2.0.0.20 and my Ubuntu version is 14.04 LTS.

I hope you can help me!
Best regards,
Siméon.
Last edited by DarkPatate on Tue Apr 14, 2015 4:43 pm, edited 1 time in total.

gserrier
Posts: 71
Joined: Tue Apr 01, 2014 8:22 am

Re: Acquisition server with Emotiv headset on Linux

Post by gserrier »

Hi,

The edition you made looks fine.

You should also:
- remove the win32 guard at the beginning of the file
- remove following lines
TARGET_LINK_LIBRARIES(${PROJECT_NAME} Delayimp.lib )
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/DELAYLOAD:edk.dll")

If it doesn't work, tell me.

Guillaume

DarkPatate
Posts: 47
Joined: Tue Apr 07, 2015 11:31 am

Re: Acquisition server with Emotiv headset on Linux

Post by DarkPatate »

Hi,
thanks for your help.

I did the modifications but it doesn't seem to work (the rebuilt had not generate any errors). See after my entire FindThirdPartyEmotivAPI.cmake.

The Emotiv headset doesn't appear in the Acquisition Server list, maybe another configuration is needed?

Moreover all the dynamic library files are .so and not .dll, it's maybe an explication?

If you want more details, tell me!

Thanks in advance!
Siméon.

The file:

Code: Select all

# ---------------------------------
# Finds Emotiv SDK
# Adds library to target
# Adds include path
# ---------------------------------

# edkErrorCode.h EmoStateDLL.h
	#FIND_PATH(PATH_EmotivAPI edk.h  PATHS "/home/simeon/EmotivResearch_2.0.0.20"  "/home/simeon/EmotivResearch_2.0.0.20/doc/examples_Qt/example5" ${OV_CUSTOM_DEPENDENCIES_PATH})
	FILE(GLOB PATH_Candidates 
		"C:/Program Files/Emotiv Development Kit*" 
		"/home/simeon/EmotivResearch_2.0.0.20*"
	)
	FOREACH(Candidate_folder ${PATH_Candidates}) 
		# MESSAGE(STATUS "Found path ${PATH_Candidate}")
		LIST(APPEND PATH_Candidates ${Candidate_folder}/doc/examples/include)
	ENDFOREACH(Candidate_folder ${PATH_Candidates})
	# MESSAGE(STATUS "Emotiv paths found ${PATH_Candidates}")
	
	FIND_PATH(PATH_EmotivAPI edk.h  PATHS ${PATH_Candidates} ${OV_CUSTOM_DEPENDENCIES_PATH})
	IF(PATH_EmotivAPI)
		MESSAGE(STATUS "  Found Emotiv API...")
		INCLUDE_DIRECTORIES(${PATH_EmotivAPI})
		FIND_LIBRARY(LIB_EmotivAPI edk PATHS "${PATH_EmotivAPI}/../lib")
		IF(LIB_EmotivAPI)
			MESSAGE(STATUS "    [  OK  ] lib ${LIB_EmotivAPI}")
			TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_EmotivAPI} )
			# To delay load EDK.dll and redistribute binary
			#TARGET_LINK_LIBRARIES(${PROJECT_NAME} Delayimp.lib )
			#SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/DELAYLOAD:edk.dll")
		ELSE(LIB_EmotivAPI)
			MESSAGE(STATUS "    [FAILED] lib Emotiv edk.lib")
		ENDIF(LIB_EmotivAPI)

		# Copying of DLL files is not needed anymore because of delay load library
		
		ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyEmotivAPI)
	ELSE(PATH_EmotivAPI)
		MESSAGE(STATUS "  FAILED to find Emotiv API")
	ENDIF(PATH_EmotivAPI)

DarkPatate
Posts: 47
Joined: Tue Apr 07, 2015 11:31 am

Re: Acquisition server with Emotiv headset on Linux

Post by DarkPatate »

Will there a log file I can give you?

gserrier
Posts: 71
Joined: Tue Apr 01, 2014 8:22 am

Re: Acquisition server with Emotiv headset on Linux

Post by gserrier »

Well the build log should be a good thing.

DarkPatate
Posts: 47
Joined: Tue Apr 07, 2015 11:31 am

Re: Acquisition server with Emotiv headset on Linux

Post by DarkPatate »

I didn't find the build log file, where is it ?
I found several CMake logs, but I'm not sure if it's that.

Thanks a lot ! :-)
Attachments
CMakeError.log
Find in /dependencies/tmp/glfw-3.0.4/CmakeFiles
(5.04 KiB) Downloaded 316 times
CMakeOutput2.log
Find in /local-tmp/linux-Release/CMakeFiles
(28.14 KiB) Downloaded 315 times
CMakeOutput.log
Find in /dependencies/tmp/glfw-3.0.4/CmakeFiles
(25.95 KiB) Downloaded 292 times
Last edited by DarkPatate on Fri Apr 10, 2015 1:32 pm, edited 1 time in total.

gserrier
Posts: 71
Joined: Tue Apr 01, 2014 8:22 am

Re: Acquisition server with Emotiv headset on Linux

Post by gserrier »

I need the log that are generated during the execution of the ./linux-build

Run the command

Code: Select all

./linux-build &> build_log.txt
and then join the build_log.txt file.

DarkPatate
Posts: 47
Joined: Tue Apr 07, 2015 11:31 am

Re: Acquisition server with Emotiv headset on Linux

Post by DarkPatate »

Here is the log file :-)
Attachments
build_log.txt
Build log file
(167.96 KiB) Downloaded 311 times

gserrier
Posts: 71
Joined: Tue Apr 01, 2014 8:22 am

Re: Acquisition server with Emotiv headset on Linux

Post by gserrier »

Could you try to locate the file edk.h in your computer?

DarkPatate
Posts: 47
Joined: Tue Apr 07, 2015 11:31 am

Re: Acquisition server with Emotiv headset on Linux

Post by DarkPatate »

I have several edk.h file, each example folder have its own file : /home/simeon/EmotivResearch_2.0.0.20/doc/examples_Qt/examplex with x a number between 1 and 5. In the CMake file, I chose arbitrary the 5th folder.

gserrier
Posts: 71
Joined: Tue Apr 01, 2014 8:22 am

Re: Acquisition server with Emotiv headset on Linux

Post by gserrier »

Ok, could you run the command

Code: Select all

tree > emotiv_tree.txt
in the folder "/home/simeon/EmotivResearch_2.0.0.20" and put it in the forum?

PS: if the command do not exist, install the package tree.

DarkPatate
Posts: 47
Joined: Tue Apr 07, 2015 11:31 am

Re: Acquisition server with Emotiv headset on Linux

Post by DarkPatate »

Here is the tree file.
Attachments
emotiv_tree.txt
Tree file
(16.99 KiB) Downloaded 325 times

gserrier
Posts: 71
Joined: Tue Apr 01, 2014 8:22 am

Re: Acquisition server with Emotiv headset on Linux

Post by gserrier »

Ok, try to replace your FindThirdPartyEmotivAPI.cmake by this

Code: Select all

# ---------------------------------
# Finds Emotiv SDK
# Adds library to target
# Adds include path
# ---------------------------------

# edkErrorCode.h EmoStateDLL.h
   #FIND_PATH(PATH_EmotivAPI edk.h  PATHS "/home/simeon/EmotivResearch_2.0.0.20"  "/home/simeon/EmotivResearch_2.0.0.20/doc/examples_Qt/example5" ${OV_CUSTOM_DEPENDENCIES_PATH})
   FILE(GLOB PATH_Candidates
      "C:/Program Files/Emotiv Development Kit*"
      "/home/simeon/EmotivResearch_2.0.0.20*"
   )
   FOREACH(Candidate_folder ${PATH_Candidates})
      # MESSAGE(STATUS "Found path ${PATH_Candidate}")
      LIST(APPEND PATH_Candidates ${Candidate_folder}/doc/examples_Qt/example5/include)
   ENDFOREACH(Candidate_folder ${PATH_Candidates})
   # MESSAGE(STATUS "Emotiv paths found ${PATH_Candidates}")
   
   FIND_PATH(PATH_EmotivAPI edk.h  PATHS ${PATH_Candidates} ${OV_CUSTOM_DEPENDENCIES_PATH})
   IF(PATH_EmotivAPI)
      MESSAGE(STATUS "  Found Emotiv API...")
      INCLUDE_DIRECTORIES(${PATH_EmotivAPI})
      FIND_LIBRARY(LIB_EmotivAPI edk PATHS "${PATH_EmotivAPI}/../../lib")
      IF(LIB_EmotivAPI)
         MESSAGE(STATUS "    [  OK  ] lib ${LIB_EmotivAPI}")
         TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_EmotivAPI} )
         # To delay load EDK.dll and redistribute binary
         #TARGET_LINK_LIBRARIES(${PROJECT_NAME} Delayimp.lib )
         #SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/DELAYLOAD:edk.dll")
      ELSE(LIB_EmotivAPI)
         MESSAGE(STATUS "    [FAILED] lib Emotiv edk.lib")
      ENDIF(LIB_EmotivAPI)

      # Copying of DLL files is not needed anymore because of delay load library
      
      ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyEmotivAPI)
   ELSE(PATH_EmotivAPI)
      MESSAGE(STATUS "  FAILED to find Emotiv API")
   ENDIF(PATH_EmotivAPI)
If it doesn't work please report the build log.

Guillaume

DarkPatate
Posts: 47
Joined: Tue Apr 07, 2015 11:31 am

Re: Acquisition server with Emotiv headset on Linux

Post by DarkPatate »

It doesn't work, Emotiv doesn't appear in the Server Acquisition list.
Here is the file:
Attachments
build_log2.txt
(167.96 KiB) Downloaded 308 times

gserrier
Posts: 71
Joined: Tue Apr 01, 2014 8:22 am

Re: Acquisition server with Emotiv headset on Linux

Post by gserrier »

Arf, alright uncomment the line

Code: Select all

# MESSAGE(STATUS "Emotiv paths found ${PATH_Candidates}")
and give me the build log.

Post Reply