Commit Graph

311 Commits

Author SHA1 Message Date
Troy
2fe86bde5d Feature complete... and better! 2024-03-23 17:41:34 -04:00
Troy
8d687b3a86 Debugging 2024-03-23 10:10:09 -04:00
Troy
734ba39399 Fixes. Auto is too animated. 2024-03-23 09:29:32 -04:00
Will Tatam
9923a7a7d8 Swap to unsigned and pointers 2024-03-08 00:51:12 +00:00
Will Tatam
45d2ae7744 Clearer variable names 2024-03-07 19:21:03 +00:00
Will Tatam
6550504f60 Troy's extra data 2024-03-05 23:35:23 +00:00
Blaž Kristan
d484df0d06 Merge pull request #3732 from wled-install/patch-1
UM Audioreactive: add two compiler options
2024-02-12 22:02:04 +01:00
Troy
3c2feb82ed Settings to reject mic noise during line-in use. 2024-02-06 14:36:22 -05:00
Frank
2277d81699 AR sound sync bugfix
local samples were "sneaking in" when mode "receive or local" was receiving from network source.
2024-01-27 17:44:04 +01:00
Frank
14ab70dffe AR sound sync - document data offsets
The compiler has added gaps, to align our struct for hardware compatibility.

* made the gaps explicit
* added  `__attribute__ ((packed))`, to ensure that the data layout is the same on all platforms (extensa, risc-v, 8266)
2024-01-26 22:26:09 +01:00
Frank
b95a2094ce AR sound sync - make sequence checks user configurable
to support scenarios where several sending nodes are needed.
2023-12-30 19:50:07 +01:00
Frank
04136791b5 sound sync: shown "v2+" when framecounter is used
v2+ = improved format (MM fork only) including sequence frameCounter.
2023-12-18 10:44:05 +01:00
Frank
9024872f63 code spell checking - part3 (usermods)
if you can spell Fahrenheit, you can't spell Celsius. And vice versa :-)
2023-12-14 22:22:46 +01:00
Frank
4f30f69584 found a way to increase TCP stacksize (for AudioReactive UI)
we can use `-D CONFIG_ASYNC_TCP_TASK_STACK_SIZE=xxxx` to increase the stack size of AsyncWebserver - default is 8196.
This should give us a bit of headroom for new UI items.

We still need PR #94 for more savings.
2023-12-12 00:43:48 +01:00
Frank
6cd9d80dbe small fixie for audioreactive (info page)
info page was not showing "AGC gain" when local mic was in use during "receive or local" mode.
2023-12-06 12:32:57 +01:00
Frank
d2fc1f7bf9 experimental: Souns Sync "receive or local" mode
new "Receive or Local" mode:
if UDP sound is missing or interrupted for too long, switch back to local audio input.
UDP sound resumes when a fresh packet is received again.

--> still needs testing, and even more regression testing.
2023-12-05 23:46:01 +01:00
Frank
e14d5e6975 sound sync: replace magic numbers with constants 2023-12-05 21:30:29 +01:00
Frank
7c68c14e63 FASTPATH: minimize UDP sound latency
The standard build is sending packets each 20ms, which means there are double packets (no new FFT results yet) and the max. delay between sampling and sending is up to 50ms.

* (FASTPATH only): FFT Task directly notifies UDP send when it has new data, reducing delays to the absolute minimum. this also optimizes UDP packets throughput, by avoiding duplicates.

* (FASTPATH only): receiver polling frequency is increased, to process new packets earlier (may increase CPU load)
2023-11-29 13:08:14 +01:00
Frank
38352c9d20 Sound Sync: prevent GEQ hickups and stalls
UDP transfers have some delays (measured between 2ms and 400ms). As consequence, FFT results sometimes "freeze" for a short time as no new data is arriving.
To hide these freezes, we apply the same "dynamics limiter" method as for volumeSmth.
2023-11-29 12:25:22 +01:00
Frank
1ac24439d4 AR: fastpath optimizations
Some optimizations in FASTPATH mode, to ensure that audio processing takes places as soon as new samples are arriving:
* raise fftTask prio to 4 (above async_tcp) - to ensure that other gimmicks (MQTT, IR, alexa, live preview (ws), json API, or web UI) cannot cause delays by preempting audio.
* changed the "be nice" condition in AR::loop
2023-11-27 15:56:38 +01:00
Frank
d3d08f813b sound sync: prevent sequence "roll-back" due to late packets (1->254)
this is to prevent that an "old" packet with high sequence number (before counter roll-over) gets accepted wrongly.
2023-11-16 10:55:43 +01:00
Frank
ec4bdf90af sound sync: better handling of framecounter roll-over 2023-11-15 16:21:03 +01:00
TroyHacks
3ba2fe4ee0 WM8978 support for PicoDSP, etc. 2023-10-20 01:23:10 -04:00
netmindz
5476a90a69 Merge pull request #76 from MoonModules/audio-sync-framecounter
Audio sync framecounter
2023-10-09 18:28:49 +01:00
Will Tatam
f99856e863 Log packet counters 2023-10-08 19:35:26 +01:00
Frank
9ff7f56eb8 fix for partly uninitialized sound sync packets (audioreactive)
audioSyncPacket contains four "invisible" padding bytes added by the compiler. These need to be initialized to zero, as future versions of the protocol will make use of these fields.
2023-10-08 20:23:31 +02:00
Will Tatam
3b5c95b5e0 Try adding frame counter to detect duplicate or out of order sync frames 2023-10-08 14:10:48 +01:00
Frank
1fa5dc8ea8 audioreactive - spelling corrections in comments 2023-10-08 01:36:08 +02:00
Frank
b249a5af5e arduino-esp32 2.0.14 still contains the left-right-swapped bug
* use left-right-workaround up IDF 4.4.6
* fix for small typos
2023-10-08 00:03:11 +02:00
Frank
0ba8402e72 Align ADC init with WLED-SR
Feedback from SR is "it works better with analog", so let's align the driver code as much as possible.
2023-09-23 22:49:09 +02:00
Frank
acc2d3aa10 clean up I2C pin handling in audioreactive (ES7243+ES8388)
* remove double Wire.begin() - Wire cannot be re-initialized; its already started by pinManager.joinWire()
* Only use global I2C pins; make sure that audireactive I2C settings are aligned with global I2C pins
* minor cleanup
* remove I2C pins from AudioSource::initialize()

Note to self: sdaPin, sclPin are just dummy values now, good for UI consistency, but unused otherwise. Could be removed.
2023-09-19 19:33:36 +02:00
Frank
b3d9621427 fix wrong signature of SPH0654::initialize()
* debug messages added to different initializers
* SPH0654::initialize() was having a wrong signature: uint8 instead of int8.

C++ can be a real bastard ;-)
2023-09-19 16:42:45 +02:00
Frank
89c33607bc SR_DEBUG shows stack high water marks
some debug support for showing free stack space.
2023-09-18 22:05:53 +02:00
Frank
64223dbc02 audioreactive: stack size tuning
This gives ~3KB extra free heap on -S2.
2023-09-14 18:31:24 +02:00
Frank
523893be02 8266 audioreactive: fix crash during OTA
* fix crash when starting OTA: `Panic core_esp8266_main.cpp:191 __yield `
* prevent sound sync reconnect during OTA
2023-08-25 16:18:37 +02:00
Frank
07d204e431 enable AGC in new installs
if SR_SQUELCH is specified by the build env, change AGC default to enabled.
2023-08-25 15:00:49 +02:00
Frank
730b0ece87 cleanup for the cleanup
eliminating a duplicate condition in `#if`
2023-08-24 22:56:02 +02:00
Frank
31badb0e66 8266 onUpdateBegin, and minor cleanup
* 8266 audioreactive: added minimal `onUpdateBegin()`
* small cleanups
2023-08-24 22:50:50 +02:00
Frank
63375f5c84 esp32 audioreactive bugfix
small mistake, huge impact: the right way is to first create our FFT task, then check if task creation was successful.
2023-08-24 22:21:48 +02:00
netmindz
1b3ae20e6d Merge pull request #60 from MoonModules/ESP8266-Sync
Audio sync receive only - EPS8266
2023-08-23 18:59:45 +01:00
Frank
ecc6f1aa62 bugfix
seems I was too fast with removing _P from strncmp_P
2023-08-23 15:39:32 +02:00
Frank
3255530ee3 basic debug support on 8266 2023-08-23 14:40:47 +02:00
Frank
d221745e3f some improvements
* remove some internal variables (soundAgc, multAgc, ....)
* prototype for autoResetPeak(void)
* changed `#ifndef ESP8266` to `#ifdef ARDUINO_ARCH_ESP32`
* replacement code for computing max sample
* Info Page: "audio source" added (idle/receiving/not connected/Off)
2023-08-23 12:37:30 +02:00
Frank
2cc6925f17 agcSensitivity (to align um_data with esp32)
all elements of um_data must be filled, otherwise some effects will crash.
This adds a dummy " agcSensitivity" value that stays at 128.
2023-08-22 23:42:03 +02:00
Frank
f689d5115b 8266 hotfix: solving connectivity problems
* it seems that `WiFiUDP.flsuh()` does something completely different from 8266, and  its actually causing WLED to stall on UI calls. So not usable on 8266.
* fixing a few compiler warnings about "comparing signed and unsigned"

NB: its a hotfix, we have to check if there are other problems on 8266. Also its definitely ugly, but it helps as a band aid.
2023-08-22 23:17:57 +02:00
Frank
92e64b797a 8266 hotfix: solving connectivity problems
* it seems that `WiFiUDP.flsuh()` does something completely different from 8266, and  its actually causing WLED to stall on UI calls. So not usable on 8266.
* fixing a few compiler warnings about "comparing signed and unsigned"

NB: its a hotfix, we have to check if there are other problems on 8266. Also its definitely ugly, but it helps as a band aid.
2023-08-22 22:55:05 +02:00
Will Tatam
0672d1c59d Fix maxVol and binNum 2023-08-13 17:16:11 +01:00
Will Tatam
f0cc7f04ed Fix maxVol and binNum 2023-08-13 17:11:32 +01:00
Will Tatam
f4a1deba34 Expose dynamics - limiter, rise and fall as calc runs on receive too 2023-08-13 16:54:16 +01:00
Will Tatam
96c19b6c50 Revert placement of arduinoFFT.h include as per comments on PR:60 2023-08-13 16:40:43 +01:00