Usage instructions for using the Titta class (through its TittaMex and TittaPy interfaces) are found in the Titta documentation.
The enclosed Titta.sln
file is to be opened and built with Visual Studio 2022 (last tested with version 17.8.4).
Run makeTittaMex.m
to build the mex file.
32-bit builds are no longer supported on Windows (they have never been on Linux). The last version of Titta/TittaMex supporting 32-bit Matlab is available here.
For building the Linux mex file the default gcc version 11.2.0 included with Ubuntu 22.04 was used. (The mex file currently does not build with gcc 9.3.0 provided in the mingw64 distribution that comes with Octave 6.4.0 on Windows.) For compatibility with an earlier version of Ubuntu, either install the right GLIBCXX version or recompile following the instructions here. See this issue for more information.
Some environment variables must be set when working on the code or building it from Visual Studio. Here are the values i used (at the time of writing):
MATLAB_ROOT
:C:\Program Files\MATLAB\R2023b
PYTHON_ROOT
:C:\Program Files\PsychoPy
readerwriterqueue located at deps/include/readerwriterqueue
is required for compiling Titta. Make sure you clone the Titta repository including all submodules so that this dependency is available.
To update the Tobii Pro C SDK used to build Titta against, you need to manually put the some files in the right place:
- The *.h include files are placed in
\SDK_wrapper\deps\include
- The Windows
Tobii_C_SDK\64\lib\tobii_research.lib
link library is placed in\SDK_wrapper\deps\lib
. - The *.dll and *.so files are placed in the respective output directories,
\SDK_wrapper\TittaMex\64\Windows
and\SDK_wrapper\TittaMex\64\Linux
, respectively.
Please note that the code for the Python wrapper is currently not actively maintained and will not build as is now. However, assuming its updated, the following steps will build the code:
- Make sure the PsychoPy version you want to work with is installed.
- Make sure the
PYTHON_ROOT
environment variable is set to the location of your PsychoPy installation. - Install PyBind11: in the root folder of your PsychoPy installation, execute
python -m pip install pybind11
. Alternatively, install pybind11 through a package manager like vcpkg. - As per here, make sure you have the Python Development workload for visual studio installed. Note however that you can unselect the Python 3 installation, the web tools and the miniconda installation that it by default installs, as we will be using the PsychoPy installation's Python environment. Check the "Python native development tools" option.
Last, visual studio needs to be able to find your PsychoPy's Python environment. To do so, add a new Python environment, choose existing environment, and point it to the root of your PsychoPy install. In my case, that is C:\Program Files\PsychoPy
.
To be able to debug both the Python and C++ side of things with PsychoPy, you must install the debug symbols for the Python installation. This is done through the installer normally, but we don't have an option to do that with PyschoPy. So we have to add them manually. Here's how:
- For 64bit Python 3.8.10 (what I am using in the current example), navigate to this download location.
- Download all
*_d.msi
and*_pdb.msi
files there (might be overkill, but better have them all). - Open a cmd with admin privileges, navigate to your download location.
- Execute for each file a command like:
core_d.msi TARGETDIR="C:\Program Files\PsychoPy"
, where theTARGETDIR
is set to the location of your PsychoPy installation.