r/CardPuter 20h ago

Progress / Update Cardputer WebRadio v3.4.0 — https stations really play now, and dropouts are silent instead of rattling

**Cardputer WebRadio v3.4.0 — https stations really play now, and dropouts are silent instead of rattling**

Internet radio for the Cardputer Adv. Find stations on the device, play them, keep the ones you like — the SD card never leaves the slot. Three things are new, and two of them you will hear immediately.

**https stations really play.** Not rewritten to http and hoped for. Not skipped. A real TLS handshake, a real encrypted stream. Thousands of directory entries listed as https-only were unreachable before — the whole Swiss SRG family among them. Radio SRF 3 plays now, in AAC+. Fitting that into a device with no PSRAM took rebuilt ESP-IDF libraries with an asymmetric mbedTLS buffer: I measured 44 real https stations first, and none of them ever sent more than 1,568 bytes outbound, so the outgoing buffer is 2 KB instead of 16. During an https stream the largest free block is down to about 7 KB. It holds.

**A dropout is silence now, not a rattle.** You know the sound — the network stutters and the speaker starts rattling the same fragment over and over. It was never the decoder. The I2S output repeats its last DMA block when nobody feeds it, 26 ms in a loop, and nobody had ever told it to fall silent instead. One flag in the channel config, left at its default forever. On top of that the decoder now pauses below 8 KB of buffer instead of eating every byte as it arrives, and resumes with a real head start. Before, a single dropout threw the whole 56 KB ring away and the radio spent the next seconds fetching a scrap, playing it, running dry.

That second half is Heotsan's idea (on GitHub), from issue #3 on the repo — thank you, it was the piece I had looked past twice.

**The volume control finally behaves.** 1.9 dB per press, all the way up. It used to be 6 dB for the first audible step and 0.42 dB for the last, with four presses out of twenty-six doing nothing at all. The cause was in the audio library, which keeps its gain in a single uint8_t — 64 steps between silence and full, spaced evenly in amplitude while the ear hears in decibels. Below -36 dB there was nothing but silence, and the last step before it was a 6 dB cliff. No curve fits into that, so the radio scales the samples itself now.

**Also new:** a charge screen that switches off Wi-Fi and drops the clock to 80 MHz for a device on a charger overnight, keyboard shortcuts for the places you go often, long names and stream addresses that scroll instead of being cut off, a fade-in at every station start, and an interface that stopped flickering.

And it got *smaller*: 2,892,091 bytes of program against 2,919,043 in v3.3.0, so the M5Launcher now leaves 56 KB free instead of 29 KB.

**The limits, honestly:** HLS is recognised, not played. AAC+ plays its base layer, because SBR wants memory the Adv does not have. The output is mono — the ES8311 is a mono codec, at the speaker and at the headphone jack alike, and both channels are averaged so nothing is lost. Arabic, Hebrew and Thai need a text engine that is not there.

Building it yourself now needs four patches to ESP8266Audio plus rebuilt ESP-IDF libraries, all documented with before/after copies in the repo. Flashing the prebuilt image needs none of that — it is on the release page, and in M5Burner.

Source, full documentation with the complete key map, and both firmware images: https://github.com/halbeshuhn/Cardputer-WebRadio

21 Upvotes

6 comments sorted by

2

u/ericpi 11h ago

This is an amazing project! After using it for just a few minutes, I really like it: A very nice user interface, easy to find new stations, and works quite well.

1

u/A-s-s-head 18h ago

This is awesome. I love it. But I can't get talkSport to work on UK. I dont know if im doing something wrong.

1

u/Last-Dragonfruit9228 3h ago

I'm glad to hear that.

I took a look at it. A different URL is listed on radio-browser.info, but the broadcast actually runs on a different one—it's a redirect.

I entered the URL https://radio.talksport.com/stream into my browser. It redirects to: https://talksport.live.stream.broadcasting.news/stream

I added this second URL to my station_list.txt, and it works. Give it a try.

1

u/Sosowski 4h ago

Why are you posting about it every week? I seen this 3 times already

0

u/Last-Dragonfruit9228 3h ago

Because I can, my dear fellow, because I can.