Saturday, June 20, 2026

Gmu Too


While I was working the recent burst of ziptuner updates I had some thoughts that perhaps I could do a similar refresh for the gmu build on the IZ2S zipit.  About 5 years ago I got a nifty client server setup going between my old record collection (converted to mp3 files on my PC) and the gmu player on the zipit.  Unfortunately, transforming the living room into a exercise room for the COV-ID lockdown kinda put the kabosh on all that.  Things got moved and I eventually lost track of the client server setup.  Back in the day that was pure http to the local server, so I imagined perhaps gmu could also use an update to https.  Why not leverage the same tiny-curl path as the ziptuner?

I quickly realized I could  also use an update to the theme choices with a font somewhere between huge and microscopic, so I could see a reasonable readable chunk of my playlist right in the gmu gui like I could in the old scripts.  Something like this.

  I can read this on the tiny zipit screen.

I consulted the Google AI to see what format was used for the font files. I sorta suspected SFont and the AI doubled down on that, but that's not quite it.  Meanwhile I examined the letters_large_white.png font file in mtpaint.  I divided the dimensions of the transparent png by the size of the large font letters in the theme.conf file, accounted for white space padding, and calculated 186 letters.  That skips the ASCII control chars and implements what looks like the Latin1 codepage.  It was actually a bit of a struggle do the resize math and get the characters in the right place in the bitmap to make display work.  The AI revealed it's quite bad at math but has an endless supply of sketchy ideas.  It got the list of letters wrong and rolled out several nifty chunks of code using SDL_ttf to generate new font files with that were never gonna work.

I did a quick and dirty rescale of the giant font file with imagemagick convert and tweaked the coordinates in the theme file and voila, we have a medium size theme. But all the letters were off by N and sliced up.  Oops.  I based my calculations on the outside dimensions of the letter boxes and the actual character dimensions came out something like 7.5 pixels wide instead of 7.  So I recalculated for real 7x10 characters and fudged the padding instead.  This time it worked.

Here's how it looks.  It's actually not terrible. 

Meanwhile there's some new stuff in the gmu github logs, including SDL_ttf font support.  What?  Why didn't the AI point that out while I was scrambling to resize the old bitmap font file.  I told it why I wanted to do that, and all of it's bad ideas used SDL_ttf fonts to generate bitmaps,  but it never connected the dots.  Anyhow, that's the right solution, but it only exists in the SDL2 branch of the gmu source code.  Gotta port that to the ancient SDL12 branch that I'm  currently working with.  Or... waitaminute, maybe I should build SDL2 for the zipit?  The AI helpfully suggested there's at least 2 different framebuffer backends now, when before there were none.  It enthusiastically provided a whole lotta suggestions, and went in circles several times over which choice was best until I finally had enough and called a halt.  Stash that idea for later. SDL12 with the blurry font was good enough for now.  The https support was top priority.  (You always gotta remember your priorities when AI cheerfully drags you off on another tangent)

I pulled out a copy of the old gmu-0.10.2-RC1 code and got busy.  It took several days to re-familiarize myself with all the build instructions and packaging tricks required to make it work on the zipit.  In 2021 I was using the Openwrt OS on the zipit OS and had to remember the completely different workarounds for the IZ2S build that I wanted this time.  I'd forgotten about the structural change to the config files around version 0.10 so I wasted a few days wondering why nothing worked.  But I got over the hump eventually and got some sound.  Then I assembled a test playlist with a sampling of sources, some http and some https, mostly mp3, but one flac, maybe an ogg stream, and even one in mono.  Not many of these would actually play in the baseline build.  Maybe just one.

 

To be continued... 

No comments:

Post a Comment