Record the device through its own USB audio
crosspad_captureStarts and stops background recording of a CrossPad's UAC2 audio, returning a WAV with peak/RMS, overrun and silence stats, then restores the default audio profile.
Instructions
[ESP HW] Record the audio a CrossPad plays, through its own UAC2 endpoint (one cable, no external interface). start returns a cap_N handle and records in the background so you can drive pads meanwhile; stop returns the WAV as a link with peak/rms dBFS, overruns and whether the take was silent. The audio profile parks the RT mixer and removes the CDC endpoint; this tool resumes the mixer and restores the default profile for you. silent: true means no signal: resume the mixer or check the preset, do not report it as a failed performance.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "crosspad_capture"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | No | start: where to write the WAV (default under hil_logs/) | |
| action | Yes | start → cap_N handle; health while it runs; stop → the WAV and its stats | |
| device | No | Device id (dev_xxxx); implicit when one board is attached | |
| handle | No | cap_N handle from start; required by health and stop | |
| preset | No | Which path to record. headphone/speaker are the DAC→ADC loop (what the device is playing); mics/line_in are external inputs | headphone |
| volume | No | start: codec volume for the take | |
| seconds | No | start: stop by itself after this long; omit to record until stop | |
| keep_mode | No | start: stay in the USB-audio profile after stop (CDC stays gone). Default restores the default profile | |
| sample_rate | No | start: capture rate (default 48000, the only rate the device offers) | |
| resume_audio_tasks | No | start: resume the RT mixer after the profile switch. Leave true — the audio profile parks it and the take comes out silent |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ts | No | ||
| wav | No | ||
| docs | No | ||
| next | No | ||
| error | No | ||
| action | No | ||
| device | No | ||
| handle | No | ||
| notice | No | ||
| preset | No | ||
| result | No | ||
| silent | No | ||
| running | No | ||
| seconds | No | ||
| success | Yes | ||
| overruns | No | ||
| rms_dbfs | No | ||
| peak_dbfs | No |