Showing posts with label zipit rockbox. Show all posts
Showing posts with label zipit rockbox. Show all posts

Tuesday, February 22, 2011

Scratchbox and script practice

Turns out sound *does* work in IZ2Se after all.  It was all in the SD card.  As soon as I switched from a 4GB card to a smaller one suitable for for the stock Zipit Z2 kernel the ALSA goodies all magically started to function.  So now I just had to make some nifty scripts to work around the other issue with the SD cards - they all seem to fail/timeout somewhere in the rockbox threads whenever rockbox wants to write something to the SD card.  I already fudged the executable to do all it's working file manipulation out of /tmp, so I just needed a script to move the save state files into /tmp before starting rockbox and out to the .rockbox dir when it's done.  I also wanted to give a chance to go to headphones only before starting, and restore the speaker afterward.  It took a bit of work, but I think I have a script that'll do all that in either flavor of IZ2S and even in WEJP's os.

Rename this to rb and put it in your bin directory to make things easy.

Even so, the IZ2S version of rockbox seems to stutter a bit on startup of the first song played.  It doesn't do that on WEJP's os so maybe it's the older pthreads lib, or the older kernel, or even possibly just a slower SD card.  I don't know, so I think I might have to take another look at porting GMU to IZ2S, just in case.  But that's got a bunch of dependencies, so it seemed like a good idea to practice my lame scratchbox build skills on something a bit lighter.  I took a peek at the nanonote apps and selected nightsky since it only seemed to add SDL_image to my library list.  I ended up making a new libpng and zlib as well, but I'm not actually sure if they're needed.  I also converted all the doubles to floats since I seemed to be getting NAN errors.  What does the pxa270 compiler do when you ask for doubles?  It's already slow enough at emulating regular floating point numbers.

Anyhow, I can't see how you need double precision floats to display dots on a 320x240 screen, so it should be ok.  Don't blame me if you get lost in the woods at night though...


Here's a nightsky executable for IZ2S, along with the SDL shared libraries.

nightsky-iz2s.zip

Tuesday, February 15, 2011

Rockbox in Scratchbox

Well, I finally caved and assembled a system capable of running the scratchbox development VM for IZ2S.  And imagine that, it seems to work.  Sorta kinda.

I like all the goodies in IZ2Se, but I can't get any sound out of it.  Not even with the madplay and mpg123 executables that come with it.  But if I borrow the libSDL from IZ2Se and install it in the older IZ2S 2.05beta along with the scratchbox built rockbox, it makes noise.  Still needs work though.  I need to strip it down and tweak it a bit so it doesn't push the cpu and memory to the limits.  But this'll be really convenient because now I can load up a micro SD for the zipit with a single FAT partition containing IZ2S, rockbox, and a bunch of music.  And I can do that from Windows, Linux, or whatever.  Yay!

rockbox-iz2s.zip
libSDL is in nightsky-iz2s.zip
and
qemacs for IZ2S (everyone wants that, right?)

Tuesday, February 8, 2011

Buttons and Links

I think I figured out how the rockbox buttons are supposed to work in the SDL app.  It wants a 3x3 square of buttons that fit on the number pad.  So I filled in the missing buttons on the zipit using the O and P buttons just under the d-pad for the missing top-left and top-right buttons.  The comma and period fill in for the missing bottom-left and bottom-right buttons.  I also mapped the Zipit logo key as the top-left "Main Menu" button and the space bar as the center "Pause/Play" button for good measure.  You can never have too many redundant buttons, especially given that I can't predict how the various zipit userlands will map them.  The mouse scroll buttons turned out to be a red herring, and the volume keys on the side of the zipit work just fine when mapped to the rockbox top-middle and bottom-middle buttons.  So if anyone ever wants to run this with a usb scrolling mouse it should still work now.

Next up I'd like to add a function to toggle the headphones and speakers and hook  it up to the Q button which is nearest to the headphone jack.  That way I can avoid the alsamixer before running rockbox.  Or maybe I'll just add an alsactrl call to the rb startup script.  Hmm.

Anyhow, I made a new build and attempted to static link sdl and uclibc so I could use the same package in any userland with an updated kernel, but it still only works completely in the wejp userland.  On z2sid it runs the gui, but segfaults loading the codecs to play the songs.  So close...

rockbox-z2.tgz

Monday, February 7, 2011

Tweaking Rockbox

Not much to talk about today.  I did manage to get the +/- keys on the side of the zipit to control the volume in the Rockbox "While Playing Screen".  Yay.  Apparently the SDL app code expects to get that info from the scrollwheel and there's no such thing on the zipit.  So I disabled the wheelmouse hacks and voila, volume control.

Unfortunately the +/- keys are oriented wrong way on the zipit so when the volume works correctly the scroll action in the menus is backwards. Needs more work.  I also still need to do some more thinking on where I want to keep the runtime config files.  I got rid of the write permission errors by moving them to /tmp for now, but they really should go either in $HOME or /.rockbox.  Probably the rockbox dir since multiple users are unlikely on a zipit and that keeps it all self-contained.

I think I might try a static uclibc and sdl link soon.  In theory that should allow me do to one build for all the zipit Z2 userlands with an updated kernel, and one build for stock kernel systems like IZ2S.  I did actually try a build for IZ2S, but it just displayed the splash screen and promptly segfaulted.  Maybe I can track that down with strace, once I get the buttons and config file paths all sorted out to my liking.

Meanwhile, here's my patch file thus far and some Makefile and autoconf.h tweaks.  They're not yet up to official rockbox standards, but that can wait until it works a bit better.

rockbox-z2-patch.zip

Monday, January 31, 2011

We have liftoff

Rockbox for the Zipit has sound!

I tweaked the rockbox makefile and the rbpaths.h file a bit to split the difference between a normal sdl application and an embedded build that gets packed all up in the /.rockbox directory.  Then I added just a few lines of code to allow the zipit smily key (aka the ESC key in most of the userlands) to quit  the rockbox app and voila, we have an almost usable port of rockbox to the zipit.


I still need to add some more zipit specific key bindings to the sdl code, especially the two volume keys on the side of the zipit.  I also need to figure out why it complains about the playlist file.  Probably some sort of permissions issue with the way I grafted the /.rockbox directory onto the wejp userland.  But for now I think I'm just gonna sit back, crank up the tunes, and enjoy.

If you're running wejp's userland maybe you can help test it.  rockbox-z2-b8.tgz

Thursday, January 27, 2011

Looking for the right GUI.

Did I mention I want to remake the zipit into an mp3 player I can use in the car?  To me that means it must have a simple GUI controlled by the nice clickity d-pad in the top right corner of the zipit keypad.  It should be readable at a glance because I wanna keep my eyes on the road, mostly.  That means GMU needs some rework with a larger font and all the important controls moved closer to the d-pad.  I might go that route, so I decided to check out the gmenu2x program launcher GUI used on some other gizmos that also run GMU to get a better feel for what does and doesn't work on gizmos with this form factor.

At the time I only had a buildroot working for IZ2S and could only run static linked executables so I must say it was quite a pain in the butt to build.  Gotta get a better buildroot setup for OABI builds so I can use the shared libs from the IZ2S family of userlands!  Anyhow, the GUI seems to work ok and the controls are acceptable.  It doesn't actually launch anything yet, but here's a pretty pic of the progress so far.


I can't seem to get the ext2 filesystem on wejp's userland to survive a poweroff, but it came with a buildroot config file so I can build stuff to use the shared libs.  I just gotta reload the entire ext2 filesystem anytime I wanna test something.  Oh well, I'll figure out the filesystem problem later...  Meanwhile it appears to have everything I need to build rockbox as an SDL application.


Only the GUI works so far, but it was fairly easy to build so that's encouraging.






The preconfigured controls work almost exclusively off the d-pad, and the font in the default skin is already pretty good at 320x240.  Plus there are like 100 skins for the 320x240 ipod video, so I'm sure I can pick one that's car worthy. Now If I could just get it to gimme some sound.  It oughta work with SDL audio like the UI simulator, but I think I missed a few config options related to the location of the codec shared libs it built, as you can see in this picture.


So close, I can almost taste it...
 
I'm not sure where to go next.  I might try to move the rockbox experiment to IZ2S because the FAT filesystem makes it easier to move music to and from the SD card.  Plus it boots really fast, and I really like the wifi setup script.  Or I might see what it takes to tweak the GMU GUI for the car.  Or I may see what gmenu2x can do when I hook up the launcher part.  Who knows?  Not me.

Wednesday, January 26, 2011

First Post!

I'm on the internet.  I'm somebody now. Woo Hoo!!

Actually I've been here for just about forever it seems, but now I got me one of those fancy bloggy things.  Seems like a good excuse to avoid working on my other pet projects, which have been feeling much more like work than fun lately.

I suspect the dog must've sensed this as he got me a trio of zipit Z2s to tinker with for Christmas this year.  So my next few posts will most likely be about my pitiful attempts to shoehorn enough software into the poor little zipit to remake it into a suitable replacement for my aging juicebox as the car mp3 player of choice.


So far I've got one running IZ2S enhanced and I've managed to get a buildroot toolchain good enough to make a static partly broken version of qemacs that  runs on it.  Yeah, I know you don't really need emacs to play mp3s, but everyone wants emacs, right?

I've got another zipit converted to u-boot and running the teensy wejp userland with the gmu music player.  If I could get the ext2 filesystem to survive a reboot (and learn to control gmu without squinting) this one might be good enough for my purposes.  I've also compiled rockbox as an SDL app with the buildroot toolchain for this userland but haven't managed to test it due to filesystem unstability.  Dang it!  Rockbox would be perfect for the car.

We'll see how this all pans out soon I hope.