this only works for chunk sizes <= 10ms if set to 20ms server sometimes sends 20ms and sometimes 10ms frames which confuses esp client.
RESYNCING HARD 2 still happen very often for some reason.
remove bug in insert_pcm_chunk() resulting in dropped chunks if queue gets full, which isn't desired.
work in progress which eventually will enable the user to configure dsp processor on the fly using an on device http server.
first try and possible fix for #22
Signed-off-by: Karl Osterseher <karli_o@gmx.at>
dsp processor now will process smaller chunks of audio at a time and loop over the audio data array
which results in a much smaller RAM usage but probably longer execution times
of IIR filters.
Signed-off-by: Karl Osterseher <karli_o@gmx.at>
o wait max. 200ms and try to allocate memory every 1 ms
- set sync task to max priority and http task to (max priority - 1)
- mute audio if a hard resync happens to prevent clicks and other audible distortions
- reduce LWIP buffer sizes
Signed-off-by: Karl Osterseher <karli_o@gmx.at>
- instead of storing chunk duration in ms store the frame count
and do calculations based on that
- add updated snapserver.conf for reference (#17)
- some code clean up
- move Kconfig entries to correct place
- remove unnecessary Kconfig entries
- add necessary dependencies in Kconfig files
Signed-off-by: Karl Osterseher <karli_o@gmx.at>
- change some function return values from int8_t to int32_t
- improve syncing
o try to mimic original algorithm used by badaix
- latency_buffer_full() call in player sporadically returns negative value
which led to a unnecessary vTaskDelay --> resolved
- use esp_timer_get_time() instead of gettimeofday() for timestamping
- enable IRAM optimazations for WIFI
- decrease WIFI RX buffers
Signed-off-by: Karl Osterseher <karli_o@gmx.at>
- disable shortMedianFilter
- decrease control loop's calls to adjust_apll()
- increase size of latencyMedianFilterLong
Signed-off-by: Karl Osterseher <karli_o@gmx.at>
o configurable through CHNK_CTRL_CNT
- move time sync messaging to timer callback so it will keep going to send and receive them as long as we are connected to snapserver
- change task priorities and core IDs of tasks
Signed-off-by: Karl Osterseher <karli_o@gmx.at>
- increase DMA buffer size from 1 chunk to 3 chunks settable through source code Macro CHNK_CTRL_CNT
- activate OTA server
Signed-off-by: Karl Osterseher <karli_o@gmx.at>