Jump to content

RaspberryPi

From BCI2000 Wiki

Raspberry Pi (Linux) Build Dependencies (BCI2000 GUI build)

This section documents system packages needed to compile BCI2000 on a Raspberry Pi with GUI components enabled (e.g., OperatorQt, StimulusPresentation, BCI2000Viewer).

Raspberry Pi Performance

These instructions were created using a Raspberry Pi 3 model B running Debian GNU/Linux 13 (trixie). While Running the signal generator, DummySignalProcessing, and Stimulus Presentation we observed a power draw of between 2.2 and 4.2 Watts.

Dependencies observed during build troubleshooting

During compilation, missing headers/libraries were resolved by installing the following packages:

libdrm-dev — Direct Rendering Manager development files (graphics stack)

libxcb-dev / libxcb1-dev — XCB (X11) client library development files

libxcb-cursor-dev — XCB cursor support (required by Qt/X11)

Recommended minimal install command (GUI build)

The following is a practical minimal set for a Raspberry Pi OS / Debian-like system when building BCI2000 with Qt GUI components:

sudo apt update && sudo apt install -y \
build-essential \
cmake \
qtbase5-dev \
qt5-qmake \
qtbase5-dev-tools \
libdrm-dev \
libxcb1-dev \
libxcb-dev \
libxcb-cursor-dev \
libx11-dev \
libxext-dev \
libxrender-dev \
libxi-dev \
libxrandr-dev

Notes:

Qt on Linux typically depends on X11/XCB libraries, so missing XCB/DRM packages commonly block Qt GUI builds.

If you are doing a headless build (no GUI), you may be able to omit Qt and X11/XCB packages.

In addition to the libraries above, BCI2000 needs PortAudio, libsndfile, FFTW3, and FFMPEG libraries to build:

sudo apt update && sudo apt install -y \
portaudio19-dev \
libsndfile1-dev \
libfftw3-dev \
libavformat-dev libavcodec-dev libavdevice-dev libswresample-dev libswscale-dev libavutil-dev

Verify GUI dependency availability

To confirm the GUI-related packages are installed:

 dpkg -l | egrep "libdrm-dev|libxcb|qtbase5-dev|cmake"

Running the CMake GUI on Raspberry Pi (cmake-gui)

The CMake GUI executable is cmake-gui, provided by Debian’s cmake-qt-gui package. Debian Packages +1

1) Install the CMake GUI package

On Raspberry Pi OS / Debian Bookworm-like systems:

 sudo apt update && sudo apt install -y cmake-qt-gui

This installs the cmake-gui executable. Debian Packages +1

2) Run cmake-gui on the Pi desktop

If your Pi is running a desktop environment and you are logged in locally:

 cmake-gui

If launched from a terminal within the Pi desktop, it should open normally.


Configure BCI2000 for Compilation

Run the CMake GUI

Double-click "Configure.sh.cmd" in your BCI2000 build directory.

Tell CMake which Qt installation to use

Click "AddEntry" in the CMake window (Note that checking off "Advanced" in CMake is optional and does not impact compilation) and enter the path to a Qt directory. Use CMAKE_PREFIX_PATH as the name for the new entry. Be aware that the entry's name is case sensitive.


Configuration

In the CMake window, click "Configure" and choose a generator that is consistent with your compiler. This tutorial will be using Unix Makefiles.

Then click "Done" to perform the configuration step.

You will see a list of targets scrolling by, and a number of new entries in the variable list at the top of the window, marked in red.

Choose Build Options

Make sure the "Grouped" checkbox is checked, and configure the build by customizing values in the "BUILD" group, "EXTENSIONS" group, and "USE" group.

Generate Makefiles

Then, click "Generate" to create build files. When CMake displays its "Generating done" message, your BCI2000 build directory will now contain a Makefile (or a project file for your compiler of choice), as well as a number of additional CMake-generated files.

Compile BCI2000

Open Terminal

Open a new terminal window and navigate to your BCI2000 build directory.

Build Executables

Run:

make -j4

from your BCI2000 build directory. Once this is finished your BCI2000 prog directory will contain a number of executables, one for each module, plus a few helper executables. Not everything works the same or, in some cases, at all on non-windows platforms. See Non-Windows Functionality for more information.

The build process is now complete. Run

make -j4

again to recompile. Or

make <target>

to recompile only a specific target.