This package exposes a Linux host’s ALSA microphone and speaker through the
standard Robonix audio contracts. It is a reusable hardware primitive and does
not depend on Webots.
When a device is null, the primitive scans ALSA and selects a suitable
device. Use arecord -l and aplay -l to find explicit device identifiers
such as hw:1,0. The complete configuration surface and defaults are in
config.spec.
Build and start it through the robot deployment:
rbnx build
rbnx boot
rbnx build first creates an isolated package-owned Python environment, installs
the pinned protobuf/gRPC compiler and runtime into it, and then generates the
contract bindings with that same interpreter. The build imports every generated
*_pb2.py and *_pb2_grpc.py module before accepting the package. At runtime,
the primitive reuses this environment. During Driver(CMD_INIT), it scans ALSA
and initializes the selected capture and playback devices.
Capabilities
Contract
Purpose
robonix/primitive/audio/mic
Streams raw microphone PCM to a caller.
robonix/primitive/audio/speaker
Plays caller-provided raw PCM.
robonix/primitive/audio/list_devices
Lists ALSA devices and the current route.
robonix/primitive/audio/select_device
Changes the input or output device.
robonix/primitive/audio/driver
Provides the standard lifecycle interface.
The microphone path defaults to mono, 16-bit PCM and probes a supported sample
rate, preferring 16 kHz. The speaker path defaults to mono, 16-bit PCM at
24 kHz. Consumers must send PCM matching the configured format.
Robonix ALSA Audio Primitive
This package exposes a Linux host’s ALSA microphone and speaker through the standard Robonix audio contracts. It is a reusable hardware primitive and does not depend on Webots.
Requirements
arecordandaplayfromalsa-utilsrbnx setupuvavailable onPATHOn Debian or Ubuntu:
Deployment
Reference the package from a robot deployment manifest:
When a device is
null, the primitive scans ALSA and selects a suitable device. Usearecord -landaplay -lto find explicit device identifiers such ashw:1,0. The complete configuration surface and defaults are inconfig.spec.Build and start it through the robot deployment:
rbnx buildfirst creates an isolated package-owned Python environment, installs the pinned protobuf/gRPC compiler and runtime into it, and then generates the contract bindings with that same interpreter. The build imports every generated*_pb2.pyand*_pb2_grpc.pymodule before accepting the package. At runtime, the primitive reuses this environment. DuringDriver(CMD_INIT), it scans ALSA and initializes the selected capture and playback devices.Capabilities
robonix/primitive/audio/microbonix/primitive/audio/speakerrobonix/primitive/audio/list_devicesrobonix/primitive/audio/select_devicerobonix/primitive/audio/driverThe microphone path defaults to mono, 16-bit PCM and probes a supported sample rate, preferring 16 kHz. The speaker path defaults to mono, 16-bit PCM at 24 kHz. Consumers must send PCM matching the configured format.
Development checks
The package uses
arecordandaplayonly at runtime; the unit test does not access an audio device.