Cardputer ADV WebRadio v3.3.0 — sleep timer, playlists resolved, and https stations that play after all
**Playlists.**
Someone here pointed out that a `.pls` is just a note with the real stream URL on it. That is exactly right for `.pls` and plain `.m3u`, so the radio now reads the note and connects to what it finds. It is not right for `.m3u8`/HLS: that one holds a list of segments — `media_649.ts`, `media_650.ts` — that you would have to re-fetch every ten seconds and stitch together, with an MPEG-TS demuxer behind it. mpv and VLC do that through ffmpeg; a device with 13 to 23 KB of free heap does not. Those stations say `HLS - not supported` and leave it at that.
Measuring it was the interesting part: among the 250 most-clicked German stations, not one playlist arrives — the directory already resolves them. Among 120 Taiwanese stations, 21 do, and all 21 were HLS. So the resolver earns its keep on hand-entered stations, the kind you copy off a station's own page.
**https.**
The station directory files a lot of stations as https, and this device cannot do TLS — mbedTLS wants 32 KB of contiguous heap that does not exist here. So those stations were filtered out of the list entirely. Turns out that was the wrong conclusion: most of them are not https-only at all, only the listed as https, **80 of 80** serve the same audio over plain http — ten directly, seventy through a redirect that itself points at http. So the filter is gone and the address is simply rewritten and tried. Outside Germany it works less often (88 % UK, 74 % Taiwan, 72 % US, 66 % Poland), and where it fails the footer says `https not work`.
**Sleep timer.**
Menu → Sleeptime, set as `HH:MM` up to twelve hours, digit by digit — hours share an underline, each minute digit has its own. The remaining time counts down in the footer in yellow. At zero the stream stops and the display goes dark; the device stays on, and any key wakes it, restores the brightness it had and reconnects the station. The stream watchdog is suspended while it sleeps, otherwise it would treat the stopped stream as a dead one and dial back in within seconds.
Everything else is unchanged: 240 countries with a search field, a 5-band equalizer, CJK station names, VU meters and a 512-point FFT, and stations you can save to the SD card from the device itself.
Source, firmware and the full write-up of what does *not* work and why:
https://github.com/halbeshuhn/Cardputer-WebRadio
Board M5Cardputer, partition scheme Huge APP, PSRAM off. Built on the work of cyberwisk and WuSiU, decoding by earlephilhower's ESP8266Audio, station directory by radio-browser.info.
-------------------------------------------
Drei Sachen kamen aus den Rückmeldungen zur letzten Fassung, danke dafür.
**Wiedergabelisten.** Jemand wies darauf hin, dass in einer `.pls` doch die richtige Adresse drinsteht. Für `.pls` und einfache `.m3u` stimmt das genau, das Radio liest den Zettel jetzt und verbindet sich mit dem, was daraufsteht. Für `.m3u8`/HLS stimmt es nicht: dort steht eine Liste von Häppchen — `media_649.ts`, `media_650.ts` —, die man alle zehn Sekunden neu holen und aneinanderhängen müsste, dazu ein MPEG-TS-Demuxer. mpv und VLC machen das über ffmpeg; ein Gerät mit 13 bis 23 KB freiem Speicher macht es nicht. Solche Sender melden `HLS - not supported` und lassen es dabei.
Das Nachmessen war der interessante Teil: unter den 250 meistgeklickten deutschen Sendern kommt keine einzige Liste an, das Verzeichnis löst sie schon auf. Unter 120 taiwanesischen sind es 21 — und alle 21 waren HLS. Der Auflöser lohnt sich also für selbst eingetragene Sender, die man sich von der Senderseite kopiert.
**https.** Das Verzeichnis führt viele Sender als https, und TLS kann dieses Gerät nicht: mbedTLS will 32 KB am Stück, die es hier nicht gibt. Deshalb waren diese Sender bisher komplett aus der Liste gefiltert. Das war der falsche Schluss. Die meisten sind gar keine https-Sender, es steht bloß die https-Adresse in der Datenbank. Von den 80 meistgeklickten deutschen Sendern, die als https geführt sind, liefern **80 von 80** denselben Ton über plain http — zehn direkt, siebzig über eine Umleitung, die selbst wieder auf http zeigt. Der Filter ist also raus, die Adresse wird umgeschrieben und einfach versucht. Außerhalb Deutschlands klappt es seltener (88 % GB, 74 % Taiwan, 72 % USA, 66 % Polen), und wo nicht, sagt es die Fußzeile mit `https not work`.
**Sleeptimer.** Menü → Sleeptime, einzustellen als `HH:MM` bis zu zwölf Stunden, Stelle für Stelle — die Stunden teilen sich einen Strich, jede Minutenziffer hat ihren eigenen. Die Restzeit läuft unten links in Gelb rückwärts. Bei null hält der Stream an und der Schirm wird dunkel; das Gerät bleibt an, jede Taste weckt es, stellt die vorherige Helligkeit wieder her und holt den Sender zurück. Der Streamwächter ruht solange, sonst hielte er den angehaltenen Sender für tot und verbände sich nach Sekunden neu.
Alles andere wie gehabt: 240 Länder mit Suchfeld, 5-Band-Equalizer, CJK-Namen, VU-Meter und 512-Punkte-FFT, und Sender lassen sich vom Gerät aus auf die SD-Karte sichern.
Quelltext, Firmware und die vollständige Liste dessen, was *nicht* geht und warum: https://github.com/halbeshuhn/Cardputer-WebRadio
Board M5Cardputer, Partitionsschema Huge APP, PSRAM aus. Aufgebaut auf der Arbeit von cyberwisk und WuSiU, dekodiert wird mit ESP8266Audio von earlephilhower, das Senderverzeichnis kommt von radio-browser.info.