Bela Platform Documentation

repository·master·Indexed 19 days ago

https://github.com/belaplatform/bela

A platform for ultra-low latency audio and sensor processing developed by the Augmented Instruments Laboratory at Queen Mary University of London. Includes documentation for the bela-config CLI utility for build flags and linker settings, the board_detect hardware identification tool, and the osc.js Node.js utility.

Tokens
837
Snippets
4
Records
4
Agent score
18%

What's inside Bela

  1. Use bela-config to retrieve build flags and linker settings

    master

    The bela-config script is a CLI utility used to retrieve the necessary compiler flags, include paths, and linker settings required to build applications against the Bela platform. It is particularly useful for integrating Bela into C++ build systems (like Makefiles or CMake) when targeting Xenomai-enabled hardware.

    Available flags:

    • --prefix: Returns the root directory of the Bela installation.
    • --cflags / --cxxflags: Returns the optimized C/C++ compiler flags (e.g., architecture-specific tuning like armv7-a and neon).
    • --ldflags: Returns the linker flags, including Xenomai POSIX skin configuration.
    • --defines: Returns the required preprocessor definitions (e.g., -DXENOMAI_SKIN_posix).
    • --includes: Returns the header search paths (Bela root and Bela include directories).
    • --libraries: Returns the library search paths and the specific libraries to link against (-lbela, -lcobalt, etc.).
    # Example: Getting all compiler flags
    CXXFLAGS=$(bela-config --cxxflags)
    
    # Example: Getting include paths
    INCLUDES=$(bela-config --includes)
    
    # Example: Getting linker flags and libraries
    LDFLAGS=$(bela-config --ldflags)
    LIBS=$(bela-config --libraries)
  2. Use the board_detect utility

    master

    The board_detect tool is a command-line utility used to identify the Bela hardware currently running. It accepts a single parameter that determines the detection mode. These modes correspond to the arguments used in the Bela_detectHw() function in the Bela C API.

    Usage

    ./board_detect <parameter>

    Parameters

    ParameterDescription
    scanPerforms a hardware scan.
    cacheUses cached hardware information.
    cacheOnlyUses only cached hardware information.
    user(Default) Detects hardware using user-level information.
    userOnlyUses only user-level information.
    allPerforms all detection modes in sequence and prints all results.
    helpDisplays the help message.

    Exit Codes

    • 0: Success.
    • 1: Hardware not detected (if a specific mode was requested and failed).
    • 2: Invalid parameter provided.
    # Example usage:
    
    # Detect hardware using the default user mode
    ./board_detect user
    
    # Perform a full scan
    ./board_detect scan
    
    # Run all detection modes to see all possible results
    ./board_detect all