Matt
|
855d287e1d
|
Correct downsampling
|
2025-12-14 09:59:33 +00:00 |
|
Matt
|
1c29d37c6f
|
Replace form with div to avoid default button handling
|
2025-12-14 08:23:32 +00:00 |
|
Matt
|
2e36b44c7d
|
Really fix /poweroff
|
2025-12-14 00:17:11 +00:00 |
|
Matt
|
bc537c158a
|
Stop /poweroff reloading. Update 3D files
|
2025-12-13 23:53:34 +00:00 |
|
Matt
|
00c3c85c67
|
Add poweroff function & status LED. Include 3D files for Seeed XIAO
|
2025-12-13 17:38:18 +00:00 |
|
Matt
|
74dd3646b5
|
Performance tweaks
Optimization Walkthrough: 83kHz ADC Streaming
Achievement
Maximized the ESP32-C6 ADC continuous mode performance, achieving 83kHz stable streaming (hardware max) with 0 dropped packets.
Key Optimizations
1. Architecture: Zero-Copy Streaming
Change: Removed ws_sender_task and RingBuffer.
Mechanism:
adc_read_task
sends binary WebSocket frames directly.
Benefit: Reduced context switching and memory copies (approx +25% throughput).
2. Frontend: Decoupled Rendering
Change: Replaced onmessage -> draw() with requestAnimationFrame loop.
Mechanism: ws.onmessage only updates the data buffer. The browser draws at 60Hz.
Benefit: Eliminated UI jitter caused by drawing >60 times per second.
3. Latency: Power Save Disabled
Change: esp_wifi_set_ps(WIFI_PS_NONE)
Mechanism: Keeps the Wi-Fi radio active 100% of the time, preventing ~100ms sleep cycles.
Benefit: Eliminated periodic latency spikes which caused buffer overflows.
4. Buffering: Throughput Tuning
Change: ADC_READ_LEN increased 1024 -> 4096 bytes.
Change: Driver buffer max_store_buf_size increased 1024 -> 16384 bytes.
Benefit: Provided ~30ms of safety margin for Wi-Fi blocking operations, preventing driver-level overflows.
Final Configuration
Sample Rate: Up to 83kHz.
Packet Size: 4096 bytes (batched).
Latency: <50ms end-to-end.
Drops: 0.
|
2025-12-13 10:32:40 +00:00 |
|
Matt
|
d3dd05edc5
|
Increase buffer sizes to enable higher sample rates with less jitter
|
2025-12-13 00:26:46 +00:00 |
|
Matt
|
f77e4ae39a
|
Switch to binary websocket messages
|
2025-12-12 23:14:49 +00:00 |
|
Matt
|
f6553d8e41
|
Inital commit
|
2025-12-12 21:55:13 +00:00 |
|