Commit Graph
11 Commits
Author SHA1 Message Date
Earle F. Philhower, III e8e7acb884 Fix warnings and off-by-one in AAC 2018-01-21 19:27:07 -08:00
Earle F. Philhower, III 8ffebe6496 Enable static allocated buffers, no dynamic malloc
Because we are allocating objects totaling over 80% of the ESP8266 memory
space, we are very sensitive to memory fragmentation.  While we can control
our own allocs, the IP and SDK can allocate any size, at any time, which
can cause us to not be able to find the large contiguous memory areas we need
for the codes.

Work around this by preallocating, before anything else, buffer memory and
never freeing it.  Pass this memory into the codec and it will allocate from
this block and be guaranteed to always succeed.

This may fix the last of the hangs on the webradio/http streaming, which only
seemed to happen after a stop/start cycle.
2018-01-21 13:02:05 -08:00
Earle F. Philhower, III 68e557fdaa Remove ESP8266 compile warning in layer3.c 2018-01-19 22:28:00 -08:00
Earle F. Philhower, III 158fe23181 Don't crash on an invalid (layer I or II) frame
We removed the MP2-layer I and II decoders to save space, but an occasional
bad frame can come in that, by random chance, specifies one of this type.
Was calling NULL because of that.  Now, just skip the frame and no crash.
2018-01-19 20:40:00 -08:00
Earle F. Philhower, III e84123e03d Clean up ESP32 compile warnings, use audio PLL
Remove a couple compiler warnings found when building for the ESP32.

Enable the high-precision audio PLL as clock source on ESP32.
2018-01-18 10:01:32 -08:00
tueddy 03aa2467f0 Porting for ESP-32 (#33)
* support ESP-32
* make compile with ESP-32/arduino platform
* fixed: use libmad on ESP8266 as original
2018-01-18 08:55:03 -08:00
Earle F. Philhower, III 2d25b16f09 Preallocate all memory and move imdct_s to progmem
Because the mp3 player is a long living object and needs to allocate
large contiguous chunks on each frame, it is safer to allocate the
large xr[] and tmp[] arrays at the beginning.  Add them to the frame
structure which lives the entire time the mp3 object is alive.  No
heap allocations are now used by the mp3 player.

Move the imdct_s[] array to progmem, but do a memcpy_P() to stack
as the macros may cause a 16-bit access after optimization.  It's only
36 words long and each data is read, anyway, so this doesn't increase
the CPU work significantly.
2018-01-01 11:41:31 -08:00
Earle F. Philhower, III d923ebef36 Move the callback constant strings to PMEM 2017-12-15 12:03:05 -08:00
Earle F. Philhower, III cce9ceaffd Try and allocate inner loop mem on stack
Check the available stack space, and if large enough use a stack
variable for the inner loop.  If not, fall back to heap allocation.
2017-12-12 16:57:20 -08:00
Earle F. Philhower, III 4985aab58c Fix the schematic to remove overlaps 2017-08-12 10:39:29 -07:00
Earle F. Philhower, III 2cf8fcef2a Bring in files from original projects
The library was originally part of several separate projects.  Make the
needed structure and bring those files in, including some READMEs.
2017-08-12 09:01:42 -07:00