Implement the renamed network client and other API changes when built
under the 3.x branch of the Arduino ESP32 core.
Disable building TSF on the ESP32, the Xtensa G++ backend bug is still there.
Minimal changes to get I2S to build under new IDF. Deprecated but
not removed, so warnings are expected but should not be fatal in
use.
Fixes#683
* replace a disappeared shoutcast url by a working one from another example
* increase a buffer size (found by valgrind)
* make emulated example closer to the not emulated one
use `./onHost diff` to show the diff -u
* add `diff` option to onHost script
* add a delay to local copy of AudioOutputNull
* increase another buffer size
* make AudioOutputNullSlow.h compatible with arduino api (not only emulation on host)
Thanks to @cjwhoishe, fixes#355 .
When a large enough read size was requested it is possible that for some
streams multiple ICY blocks could appear. The logic doesn't support
that, so only read up to 1/2 the ICY block interval to ensure there is
no way to see two ICY blocks in one readInternal call.
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.
Check for NULL input data buffers and set values to NULL after freeing()
local variables to avoid memory corruption on use-after-freee.
Add lots of error injection in the host testing to help find bugs on
the PC where they're easier to debug.
The ICYMDReader was not properly returning the unread "'" characters
and so StreamTitles were being truncated at the first apostrophe. Fix
the unread() and read() member functions to clean up.
@armSeb found that the stream interface caused a big slowdown and
hiccups in his playback, replace the MetadataCallback's *Stream with
a simple *char for faster operation and less overhead.
All objects can have a metadata and/or status report callback once created.
They will call the source program with the parsed ID3 tag, ICY StreamTitle,
or text and numeric error ID of any interesting event. It is up to the end
application to figure out what to do with this. Normally, you'd just print
it to the LCD or Serial port. But it is possible to detect, say, a buffer
overflow and then switch to a lower bitrate stream for example.
Allow a UI to get a notification when a StreamTitle or other metadata
comes into the stream. Callback function would normally just update a
flag and let the next global event loop handle updating the display.
Wasn't incrementing the returned data pointer when we had to split the
requested read into pre- and post-ICY blocks. This resulted in errors
in the decoded stream.
Add a subclass of the HTTPStream that can extract the ICY metadata.
Needs to implement a callback function or parse it internally and expose
a class variable to let the UI see the current stream information.