During the COV-ID craziness I gave up on github because Microsoft started demanding a 2 factor setup for logins, which made it feel way too much like work. I hate that stuff. But it's been like 5 years and I still get the urge to code so I finally gave in and set it up. The MS github still complains my 2 factor selection is obsolete and threaten to lock me out, but it works for now. So I've resumed work on the ziptuner, trying to knock off some lingering items on the To Do list and clean up the crusty old code while I'm at it.
https://github.com/deeice/ziptuner/commits/master/
Here you can see the "Now playing" line shows the station name instead of just the number. I've also added several additional example scripts for more back-end players, including some that run in a separate window.
I kinda like the way SMPlayer shows the current song title from the meta tags and provides convenient access to the volume control. I can't really incorporate that into the main window since the Dialog program is doing all the work and I don't think it has an API for async updates. Back in the day I borrowed alt console /dev/tty4 on the zipit for status and control of the player program because the ziptuner dialogs hog the entire 320x240 pixel screen.
Unfortunately the modern internet moving from http to https has forced me to build a new curl for the zipit to use as a middle man, fetching and decrypting https streams and piping the unencrypted stream to the old players which lack support for that. Changing standards... what a hassle. The 15 year old libcurl from IZ2S couldn't do it so I'm now using tiny-curl with bearssl. Seems to work, but my build skills are week. It's significantly smaller than the old IZ2S curl, but bleeding edge openwrt is still the sleekest. They got some amazing build config setups.
Anyhow, here's a terminal screenshot of the new tiny-curl pipes that I made in an ssh session on the zipit. The new ziptuner is still pretty lean at 33 Kilobytes. I'm pretty happy with that. The mpg123-curl helper is used for http or https streams and mplayer-curl is used for the rest. This keeps the player pipeline as lean as possible. That's vital when you only got 32 Megabytes of RAM.
I still need to patch in /dev/tty4 support to catch the song titles. Hopefully I'll can keep this up and have more to say on this soon...
UPDATE Apr 19, 2026
I had thoughts about redirecting the output from mpg123 into a logfile and using a tailbox dialog to monitor it in the ziptuner. I'd have to add a 4th button called <Logs> to the main screen for but the code for that is really minimal and you get something like this mockup dialog I ran from an ssh session while mpg123 whipped up a log file. A tiny dose of grep and sed would clean that right up.
But apparently the ICY metadata with song titles is nonstandard web stuff, and curl needs special options to request it and keep it in the stream for https URLs. It also seems like mpg123 doesn't like the ICY meta in the pipeline when you do that. Is ICY meta not the same as ID3 tags? Probably not. So for the zipit the log idea would really only work for http streams because curl is not required.
This needs some research, and it may just be simpler to rebuild mplayer and mpg123. Darn it. I think I'll add the code anyhow since it's so small.
UPDATE Apr 23, 2026
I compiled the latest mpg123. It seemed about 10x bigger than the old mpg123 but a long session with the google AI eventually whittled it down to a similar size, cutting junk that's useless on the zipit with quite a few iterations thru the configure script. Turns out mpg123 itself uses an external curl pipe for https in the current code, but the command line is like a mile long to negotiate all the ICY header junk. The google AI only gave me tiny subsets of that nonsense in conflicting circular broken answers. So I never woulda got it working in the ziptuner script. The good news is the new mpg123 works for both http and https on IZ2S and may actually be tinier tighter code. It certainly helps keep the ziptuner script sleek with mpg123 handling the curl audio pipelines instead of me.
Mplayer was another story. I got it to compile but it refused to link. The problems were all in the internal ffmpeg library. Something wrong with libm and the floating point. With an FPU-less armv5te processor any floating point code is gonna be slow and problematic on the zipit. Meanwhile, mplayer is now mostly just a wrapper around ffmpeg so if I can get a modern ffmpeg to build then maybe I can use that for ziptuner instead. So I dug in with the AI and eventually came up with an ffmpeg config script for a fairly small fixed point only build. Sadly I gotta get another ssh/tls library built first if I wanna do https. It looks like mbed tls is the future. BearSSL is unsupported by ffmpeg, but mbed tls is currently supported by ffmpeg, curl, and openwrt. A zipit trifecta, I can get it to build. They switched to CMAKE after version 3.6.4 so I think I'll start with that code... but it's all taking too long so I'll have to get back to it later.
The ziptuner c code for the log viewer dialog was actually quite simple, as I said. But making the metadata logging work from inside the ziptuner was much trickier than expected. The problem is formulating the play script I want to pass to mpg123. The trouble with this is when you run it in the background mpg123 wants to buffer the ICY message output in 4K blocks. That's like 100 lines buffered before you see anything. Not good. So I spent a few long days back and forth with the google AI before I got something that works. It suggested stdbuf (or a one line c code shared lib that does the same thing for small systems without coreutils). That seemed reasonable but it doesn't work with static executables. That's a no go on the ancient zipit running IZ2S and it took like forever and a day to get the AI to admit it.
Fortunately busybox (which runs most of the zipit) comes with a script applet that does the trick, but formulating the exact command to make it work was like pulling teeth. Again the AI sent me off in the wrong direction with many ever so slightly broken variations of the same command. But eventually I got it down to the mp3 line in this, which gives me pretty much what you see above from my initial tests with command line scripts.
LANG=C DIALOGRC=/usr/local/share/ziptuner/dialogrc.soho ./ziptuner $A -u \
-mp3 'script -aqc "echo && date && mpg123 %s 2>&1" /tmp/ziptuner.log >/dev/null' \
-p '>/dev/null 2>&1 mplayer-curl' \
-s '{ killall mpg123; killall mplayer-10rc2; killall curl; } 2>/dev/null' \
/usr/share/radio /mnt/sd0/gmu/playlist.m3u
It drops a date/time stamp in the log before running mpg123. The -a tells script to append to the /tmp/ziptuner.log file or else it would overwrite whenever I change the channel. The q is for quiet and the c runs the command in quotes. The >/dev/null after /tmp/ziptuner.log is for stdout from script itself. Without it script will spam your tty with the same stuff it redirects into the ziptuner.log file.
I want to add a sed pipeline to the script command and maybe clean up the log a bit. This example leaves only the "Artist - Song Title" part of the ICY-META lines.
sed -u -e "s/.*Title=.//" -e "s/\x27;.*//"
Unfortunately incorporating that is yet another struggle. The sed commands themselves are relatively simple, and I've already tested some that make it look pretty nice, but it leads to triple nested quotes (and maybe a subshell) when I add it the the scripty mess above. So I suspect I should push this down to the bottom of my new To Do list.
The AI seems to agree, or it was just trained to be obsequious. When questioned on the evaluation order with it's choice of nested quotes it said, "You’re right to be skeptical—nested quoting is the fastest way to break a shell script." Then reworked it's shoddy code to put the single quotes on the outside. In the end I think this is gonna make me bring back the player helper script. I hate to do that, but Dialog really seems to need the \r characters stripped out for the tailbox or textbox to work and it's the least ugly way to isolate quote nesting layers.
First on the list should be another button or two in the Log Viewer so I can toggle it from a live tailbox to a static textbox with scrollbars. Also a log <DELETE> button might be nice if it gets too big. I should be able to code that up quickly in the ziptuner c code. Then maybe do some serious regression testing and a new release before I get bogged down in sed pipelines and triple nested quotes, or ffmpeg builds.



























