Sunday, March 1, 2020

Saved at Last

This blog really needs some new life, maybe gotta take it in a new direction because the previous post is dated well over a year ago.  Yikes!  I suppose the problem here is that I really haven't done anything for a long while that felt interesting enough to discuss.  And then time passes and leaves me behind.  Youtube moved on, dropping support for the smaller, lower bitrate video streams of the past, as google is known to do.  So nothing suitable for the zipit.  I think that killed some of the spark that motivated my tinkering.  Keeping up with youtube on the zipit had become something of a quest.

At the same time, a 64GB micro-sd suddenly went read-only in the zipit I use exclusively for music in the car -- with only 34GB of the storage actually used up.  I can still play the music on it, but can't add any new stuff.  So much disappointment in such a small package!  I wasn't using that particular zipit for anything else, so I gotta assume maybe rockbox does too many small writes, possibly saving the current song location?  But I really don't know.  So I started over with a new 32GB sd and some new music.  I also went back booting into rockbox from the internal jffs instead of the sd card.  I'm pretty sure the internal nor flash supports many more writes, and the jffs most likely does much better wear leveling than the junk in the sd card.  Perhaps in time I'll regain the confidence to try a bigger sd again... 

Meanwhile I finally retired the old iphone 5 and got a new android phone. And the car supports android auto, so I figured I'd see how well that works.  After using it for a while, I'd say it has potential, but Rockbox is still a better interface for my stash of mp3s than any android app I've tried so far.  Musicolet is ok, but the android auto interface stinks compared to the one on the phone itself.  So much failure is built into car touch screens.  Don't get me started on the software built into entertainment system of the car itself.  A touch screen is a really stupid interface for a car because it forces you to look away from the road, unless maybe you've got a robot behind the wheel.  I don't have one yet, so Musicolet demands I stop touching and speak to it whenever I hit the android auto screen more than once a minute.  Makes sense, but I'm just not quite ready to go there yet.  And anyways, how's all that talking supposed to work when the music is blasting?

Also in the last year, at some point, Notepad++ was driving me nuts on the junky Windows machines I'm forced to use from time to time.  So I took up the defunct Windows port of qemacs and "finished" it.  There, that's much better...


Yes, I confess.  I do still use Windows XP sometimes...


Apparently there's loads of fairly new unreleased goodies in the official qemacs repository.  I need to play with all that and see what I like.  So I made a separate qemacs fork in my github, and updated the Windows fixes to fit.  I'll probably put it on the zipit as well someday and see if all the new code bloat is worth it there.

OK, so by now if you're paying attention you're probably wondering about the title of this post.  Yeah, I know.  If you got this far, you've already forgotten.  It's "Saved at Last".  What's all that about, you say?  Well, one area where the zipit still excels in my mind is for internet radio.  For that the zipit still works best for me.  But there was one key feature missing from the ziptuner.  It gave you the ability to find, sample, and save stations, but you still had to use another app to make use of the saves.  I finally got around to fixing that.  Hence the title.

Originally the ziptuner was supposed to be a quickie hack to fill a gap on the zipit.  At the time, there were several apps to play internet radio, but no easy way to find new stations and save the urls.  Hence the need for the ziptuner.  But the ziptuner grew up as I used it and learned what I really wanted it to do.  Unfortunately the code grew in the same haphazard fashion, new bits grafted on here and there, with no real plan or design.  It's a real pain to debug ncurses apps because they take over the screen you want to use for the debugger.  So bugs crept in and went unfixed.  Eventually I could no longer stand to even look at the code, much less work with it.  So I never added that final critical missing feature. 

Well, eventually it dawned on me that I could use Xdialog on my laptop as a cheap substitute for the ncurses dialog program.



It's missing some of the advanced button options.  But I could work around that, and it frees up the text console for the debugger.  So I was finally able to test and fix things in a comfortable debugging environment.  The ziptuner was saved at last from the code rot!

While smashing bugs I identified some code symmetries, allowing me to break it up into more manageable chunks instead of the deeply nested nonsense that it once was.  And when I could see what I had, I knew what I could do next, and voila!  Option 9 -- List Saved Stations -- was born.

 

Here's a sample Saved Stations list from my zipit.  Gonna play me some Groovetube.  And I'm all hooked up for Saint Patty's day in two weeks.  I'm pretty excited about it.


There's still more to be done.  I eventually added a -a command line option to resume playing a saved station on startup.  But the .pls format support is unfinished.  At least now there's some hope for that...

2 comments:

  1. Nice to see a recent post on your blog. Look forward to more new posts in the future.

    Don't know if you're using SDL 1.2.x or SDL 2.x at this point, but I'm looking into backporting some of the support libraries like sdl2_ttf and sdl2_image to SDL 1.2.15, so some of the new features will work with programs using SDL 1.2.15. It adds support for more image formats like SVG and fixes some Unicode issues.

    Hope you'll continue to work on some of your applications. You have some very interesting ones in your collection.

    ReplyDelete
  2. Hey that sounds useful. I don't know of an SDL 2 backend that works on the zipit, so I've stuck with SDL 1.2 I think one of the games I tinkered with a year ago had a shim layer to make SDL 1.2 look a bit more like SDL 2 so it seems like a common problem when you have no 3D hardware.

    ReplyDelete