跳至主要内容

Start a microphone test

POST 

/api/peripherals/microphones/test

Starts recording from a scanned microphone on the board and returns 202 at once. It records until POST .../test/stop or for seconds (at most 30); poll GET for the live level and the result. Insight first re-reads SiMa Sentinel's catalog: when that microphone's capture target or identity changed since the scan (a replug, or a restarted Sentinel routing the id elsewhere), it returns 409 stale_snapshot without recording; other catalog changes, such as a previewing camera's rate, do not count; it also refuses a microphone whose provider data is from an earlier scan (409 stale_snapshot), and one without a safe Sentinel selector (502 peripheral_response). Sentinel's availability is not used to refuse: Insight then checks the capture PCM on the board and returns 409 microphone_in_use, naming the holding process where it can see it, only when a substream is open now. The board runs arecord on Sentinel's plughw:CARD=<id>,DEV=<n> selector, converted to 16-bit PCM at 48 kHz when the device offers it (else its nearest rate below, never above 48 kHz) and at most two channels. Only one test records at a time (409 test_running). Returns 409 stale_snapshot when the selected board changed since the scan. A busy device, a board without arecord, or a failed recording ends the test with state: failed and the error.

Request​

Responses​

Recording started.