Commit Graph
21 Commits
Author SHA1 Message Date
Earle F. Philhower, III a6141473fb Update for ESP32 Arduino 3.x (#685)
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
2024-06-06 14:43:45 -07:00
Earle F. Philhower, III a6f1eda9a2 Get ESP8266 CI running again (#531)
Add LWIP to ESP8266 builds
New build step on ESP8266
Fix warnings, quiet get.py
Ack SPIFFS deprecation
Example fix
Clean up overzealous pragmas
Fix server.accept() deprecation
2022-05-18 22:12:33 -07:00
Pixtxa 9485887879 Set FollowRedirects in AudioFileSourceICYStream (#448) 2021-11-27 12:35:07 -08:00
Earle F. Philhower, III b37e9d232b Add support for Raspberry Pi Pico Arduino Core
Adds support for the RP2040 core and the PIO based I2S output device.
https://github.com/earlephilhower/arduino-pico

Poisons some ARM optimizations which don't work on modern Thumbs.
2021-04-02 19:40:58 -07:00
david gauchard 0cee4d410e Proposal for various tiny fixes (#357)
* 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)
2021-01-02 15:09:01 -08:00
Earle F. Philhower, III 7cb02a6986 Ensure only 1 ICY packet processed per reading (#356)
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.
2020-12-29 08:42:08 -08:00
Earle F. Philhower, III a781eef59c Rewrite ICY metadata parser to be faster
The ICY metadata parsing was very slow because of bytewise reading from
web stream.  Use a more convoluted, but faster, chunked method.
2019-04-12 20:29:48 -07:00
h3ndrik 2c5ae5d490 don't try to read 0 bytes if we hit the icy block (fixes #124) (#125)
* don't try to read 0 bytes if we hit the icy block

* make sure size isn't negative
2019-04-12 16:21:00 -07:00
Earle F. Philhower, III 2d8a97767c Update to remove warnings, fix new 8266 core rev
Remove build warnings and use the faster pgm_read_*_aligned macros to
update to the latest ESP8266 Arduino core.
2019-04-12 15:45:34 -07:00
h3ndrik 05a78dce2a Make stream reads orders of magnitude faster (fixes #38) (#44)
Fix by @h3ndrik 
* Use correct read for stream data on the ESP32 (fixes #38)
* Adjust types for read()
2018-01-31 19:18:35 -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 d04beb1105 More paranoid input checks, random error injection
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.
2018-01-20 21:08:13 -08:00
Earle F. Philhower, III 5b45a79cf7 Fix ICY decoder overflow causing streams to die 2017-12-16 16:16:01 -08:00
Earle F. Philhower, III 5a9340c452 Fix ICY decoding when apostrophes encountered
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.
2017-12-15 19:49:37 -08:00
Earle F. Philhower, III 8e94702468 Replace Stream with simple string in MD callback
@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.
2017-12-15 12:54:49 -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 9c120a777a Add callbacks for metadata and status reports
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.
2017-12-06 21:11:23 -08:00
Earle F. Philhower, III 3226d6ec0a Add metadta callback for Icy streams
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.
2017-12-04 12:45:16 -08:00
Earle F. Philhower, III 432f892d70 Add retry logic to HTTP Streams
On a 0-byte read or a disconnect, optionally automatically reconnect
up to a user specified number of tries with a delay between each attempt.
2017-11-22 07:20:42 -08:00
Earle F. Philhower, III 2737dec473 Fix block corruption when hitting an ICY block
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.
2017-11-21 20:09:37 -08:00
Earle F. Philhower, III 4b2bbe7ad5 Preliminary ICY HTTP stream support
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.
2017-11-21 11:55:23 -08:00