11 Commits

Author SHA1 Message Date
Alex
38d21ef53c Add multi-speaker tracking with beam steering (#5)
multi_speaker.py: Tracks up to 2 speakers simultaneously. When 2 distinct
DoA angles are detected (30°+ apart) for >1s, locks the XVF3800's fixed
beams onto each speaker. Releases back to auto mode when only 1 speaker
remains (3s timeout). Manages beam gating so only the speaking beam is active.

xvf3800.py: Added beam steering commands — enable_fixed_beams(),
set_beam_azimuths(), enable_beam_gating(), read_all_beams().
Manager gets steer_beams() and release_beams() convenience methods.

headmic.py: Wire multi-speaker tracker into DoA loop. New endpoint:
GET /speakers/tracked — current speaker positions, beam mode, lock state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 21:37:49 -05:00
Alex
88fb18800c Fix VAD — use processed_doa NaN as speech indicator
The auto-select beam always returns an angle (even for noise), so
VAD was always true. The processed_doa (index 0) is NaN when no
speech is present and a real angle when speech is detected.
Now: angle from auto-select beam, VAD from processed_doa being non-NaN.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 21:08:50 -05:00
Alex
afc8694c1a Switch DoA to AUDIO_MGR_SELECTED_AZIMUTHS (auto-select beam)
DOA_VALUE on GPO resource was sluggish/cached. The beamformer-level
AUDIO_MGR_SELECTED_AZIMUTHS on resource 35 tracks the active speaker
in real time. Falls back to simple DOA_VALUE when both azimuths are NaN.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 18:06:40 -05:00
Alex
f4452865d1 Fix USB read length to match official tool protocol
The XVF3800 expects exact wLength: count * type_size + 1 (status byte).
Requesting wrong length caused stale/corrupted responses when polling.
Split _read into _read_uint16 and _read_float matching official format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 17:30:29 -05:00
Alex
8d73aaad5e Fix DoA reading — skip 1-byte status header in USB response
Response format is [status_byte, angle_lo, angle_hi, vad_lo, vad_hi],
not [angle_lo, angle_hi, vad_lo, vad_hi]. Was reading the status byte
(0x42=66) as the angle, which is why DoA was always stuck at 66.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 17:23:07 -05:00
Alex
f41b852b5d fixing leds 2026-04-11 16:28:15 -05:00
Alex
3b4799069d fixing leds 2026-04-11 16:06:40 -05:00
Alex
46ace966bc fixing leds 2026-04-11 16:05:27 -05:00
Alex
2f7b45fa45 fixing leds 2026-04-11 15:58:56 -05:00
Alex
10e39dd0f1 fix leds 2026-04-11 15:51:24 -05:00
Alex
6c10e75cbc updates for dual mic array 2026-04-11 15:11:22 -05:00