Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Public Attributes | List of all members
BelaInitSettings Struct Reference

Structure containing initialisation parameters for the real-time audio control system. More...

#include <Bela.h>

Public Attributes

int periodSize
 Number of audio frames per period ("blocksize"). More...
 
int useAnalog
 Whether to use the analog input and output.
 
int useDigital
 Whether to use the 16 programmable GPIOs.
 
int numAudioInChannels
 How many audio input channels [ignored].
 
int numAudioOutChannels
 How many audio out channels [ignored].
 
int numAnalogInChannels
 How many analog input channels.
 
int numAnalogOutChannels
 How many analog output channels.
 
int numDigitalChannels
 How many channels for the GPIOs.
 
int beginMuted
 Whether to begin with the speakers muted.
 
float dacLevel
 Level for the audio DAC output. DEPRECATED: ues lineOutGains.
 
float adcLevel
 Level for the audio ADC input. DEPRECATED: use audioInputGains.
 
float pgaGain [2]
 Gains for the PGA, left and right channels. DEPRECATED: use audioInputGains.
 
float headphoneLevel
 Level for the headphone output. DEPRECATED: use headphoneGains.
 
int numMuxChannels
 How many channels to use on the multiplexer capelet, if enabled.
 
unsigned int audioExpanderInputs
 Which audio expander settings to use on the input.
 
unsigned int audioExpanderOutputs
 Which audio expander settings to use on the input.
 
int pruNumber
 Which PRU (0 or 1) the code should run on.
 
char pruFilename [MAX_PRU_FILENAME_LENGTH]
 The external .bin file to load. If empty will use PRU code from pru_rtaudio_bin.h.
 
int detectUnderruns
 Whether to detect and log underruns.
 
int verbose
 Whether to use verbose logging.
 
int enableLED
 Whether to use the blinking LED to indicate Bela is running.
 
int stopButtonPin
 
int highPerformanceMode
 
int interleave
 Whether audio/analog data should be interleaved.
 
int analogOutputsPersist
 Whether analog outputs should persist to future frames. More...
 
int uniformSampleRate
 Whether the analog channels should be resampled to audio sampling rate.
 
unsigned int audioThreadStackSize
 
unsigned int auxiliaryTaskStackSize
 
bool(* setup )(BelaContext *, void *)
 
void(* render )(BelaContext *, void *)
 
void(* cleanup )(BelaContext *, void *)
 
int ampMutePin
 Pin where amplifier mute can be found.
 
void(* audioThreadDone )(BelaContext *, void *)
 
char * codecMode
 A codec-specific intialisation parameter.
 
struct BelaChannelGainArray audioInputGains
 audio input gains
 
struct BelaChannelGainArray headphoneGains
 level for headphone outputs
 
struct BelaChannelGainArray adcGains
 Level for the audio ADC input DEPRECATED: use audioInputGains.
 
struct BelaChannelGainArray lineOutGains
 Level for the audio line level output.
 
uint32_t disabledDigitalChannels
 A bitmask of disabled digital channels.
 
char unused [MAX_UNUSED_LENGTH]
 
BelaHw board
 User selected board to work with (as opposed to detected hardware).
 
char * projectName
 Name of running project.
 

Detailed Description

Structure containing initialisation parameters for the real-time audio control system.

This structure is initialised using Bela_defaultSettings(). Its contents are used up through the point of calling Bela_initAudio() at which point it is no longer needed.

Examples:
Extras/pru-pwm/render.cpp, and Extras/second-pru/render.cpp.

Member Data Documentation

int BelaInitSettings::periodSize

Number of audio frames per period ("blocksize").

The number of analog frames depends on relative sample rates of the two. By default, audio is twice the sample rate, so has twice the period size.

int BelaInitSettings::stopButtonPin

What GPIO pin to monitor for stopping the program. Defaults to 115 (button on P9.27/P2.34/GPIO3[19]). Pass -1 to disable monitoring.

int BelaInitSettings::highPerformanceMode

Whether to use high-performance mode: gives more CPU to the Bela task. The Linux part of the board and the IDE may freeze while the program is running. Use the button on the Bela cape to forcefully stop the running program

int BelaInitSettings::analogOutputsPersist

Whether analog outputs should persist to future frames.

n.b. digital pins always persist, audio never does

void(* BelaInitSettings::audioThreadDone)(BelaContext *, void *)

Pointer to an optional function to be called when the audio thread is done. This function is called from the audio thread itself just before it returns.


The documentation for this struct was generated from the following file: