Sunday, March 27, 2011

Spending some quality time with the toys.

Hmm, I've been ignoring this place for a bit.  Too busy playing with the toys to write about them.  So I guess it's about time.

I recently updated my Zipit patches to the latest rockbox sources and actually submitted them to the official rockbox bug and patch tracker for comments.

Main Zipit Patch
Rockbox Plugin Keymap Patch

This code update got me the fix for changing codecs on the fly.  Yay!  But unfortunately the "high performance" sigalstack thread implementation locks up on the splash screen in the IZ2S build, so I had to drop back to the low-tech SDL threads implementation, again.  Rockbox seems to use about 2% less CPU with the current code, but also seems about 10% more likely to skip or click than my older IZ2S build.  WTF?  Between this and GMU I'm starting to think the old stock zipit kernel scheduler has better audio thread response time with a higher CPU load.  Anyhow, I'm planning to build a z2lite version off the newer code and see if the sigalstack thread  implementation works there.  And I'm still hoping the pandora guys replace the SDL audio backend with an ALSA backend before I succumb to temptation and make a total mess of it.

Meanwhile, I made some minor changes to the keymap.  Borrowing ideas from GMU, I put the rewind and fast-forward keys on < and > so they're near the pause function, which is mapped to the space bar.  All easy to find by touch and thus good for the car.  The quickscreen and playlist functions previously on < and > have been moved up to the L and BS keys.  I don't use those nearly as much, and never need to find them by touch because they require me to look at the screen anyhow.

I also started on internet radio plugin.  Sorta.  I dreamed I could pipe the output of wget fetching an internet radio stream URL into rockbox using popen.  So I ran a quick command line test with "wget -qO- URL >file.mp3" and then played the file.mp3 with mplayer. That worked, so I coded up a quick and dirty viewer plugin and configured rockbox to let it take over whenever you click on a .pls file in the rockbox file browser.  So far it pulls out the stream URL and the name of the stream and displays them both briefly on the rockbox screen.

I got a bit lost trying to figure out where to send the stream data though.  Looking at the wavplay.c and video.c plugin code just made it worse.  There's IRQ handlers and buffers and I'm not sure if the mp3 codec API expects me to find the bitrate of the stream myself before doing anything with the stream data.  Plus I'm a bit nervous about using a pipe since I don't know how to stop or pause it, or handle it if it stops on it's own.  I also forgot pipes require a special pclose call to clean up the pipe when yer done.  So this idea may have to wait a bit until I dream up a better solution, a solution with all the pesky details included...

Maybe next time I'll dream about grafting it onto the FM radio code.  That might make more sense.  Pause controls, channel presets, and the FM play screen are probably analogous to the needs of an internet radio player.

Wednesday, March 9, 2011

Plugins and Performance Enhancers

I did some performance tuning (and lots of road testing) on the rockbox and gmu builds.  For rockbox I tracked down the settings for ARM5 assembler optimizations, added -O3 and other compiler settings, fixed some bugs so I could remove the unneeded touchscreen support (included by default perhaps because of android), and added real (if somewhat shaky) battery monitoring.  For gmu I added -O3 and a few compiler options allowed by the IZ2S toolchain.  This made the IZ2S builds useable, and made the uboot kernel version of rockbox work even at 208MHz, although just barely.

Spurred on by this success , I decided to build all the codecs for gmu and all the plugins for rockbox.  Now the plugins (and only some of them) are really only useable at 416MHz so I haven't assembled a full rockbox package for IZ2S,which runs at 312MHz.  However I did update the IZ2S download  to the new version, since it's smaller and includes the battery monitoring.  I also updated the rb.sh script to work around some bugs in the old version.  Wicknix has made the uboot builds of rockbox available at his z2lite site.

I haven't found a place yet for the IZ2S build of gmu, and it still clicks every once in a while so I'd like to fix that before I package it all up.  But it's looking promising, especially since I looked at the code and realized it could be modified to play internet radio without a whole lotta work.  Plus I found it's key customization file and moved the playlist/directory screen toggle  function to the Zipit key and moved Pause to the space key so I have all the important controls exposed or available by cracking the lid just a teensy bit, perfect for the car.

Moving on to rockbox plugin testing...  How about a quick game of rockblox?


Ok, so I may not be the worlds greatest rockblox player, but I totally own the high score on my zipit.

Update:  Here's a temporary link to a very preliminary package of gmu-0.7.2-iz2s-beta1.zip if anyone wants to try it.