Saturday, February 26, 2011

MP3 Performance Testing

I built gmu for iz2s to compare against rockbox and see what I could dig up on the stutter problem.  I'm lazy so I only built the mpg123 codec library for gmu, but as a bonus that codec comes with the standalone mpg123 command line player.  Now the standalone mpg123 executable linked against libmpg123.so works fine, but gmu stutters just like rockbox.  So opened up top in an ssh window to investigate.  The standalone exe uses very little memory, and no threads or SDL.  It seemed to hover around 12% CPU.  GMU used about 6MB (and might have been leaking more) launched several threads, one of which used about 15% CPU and another which used about 5%.  At 6MB, there was memory to spare, so I think we can rule that out as the stutter problem.  So I think that leaves SDL and pthreads.  That 5% CPU process stands out as suspicious.  Is the SDL event loop or screen refresh code keeping the processor that busy?  Hopefully the event loop is doing nothing.  So screen refreshing?  Hmm, I think maybe gmu can run without the screen.  I'll have to read up on that. 

Anyhow 5% still doesn't seem all that bad, so I'll have to look at the pthread context switching.  Perhaps major improvements have been made in recent years.

In other news, I traded one of my troublesome 4GB SD cards for an older 2GB card which seems to make the zipit happier.  It's already survived several reboots and one actual SD card removal on my ubooted zipit.  Right not it's loaded up with the new z2lite userland, which runs the rockbox I built for wejp's userland just fine.  No stuttering, so far.  It also appears to be able to change codecs on the fly, and it even kept track of rockbox theme changes.  Now I just gotta grab a few of the ipod video 320x240 themes and try them out.  The "retroTape" theme looks like fun, while "Big info" and "DriveBox" might be good for the car.





Here's the zipit running the "Big info" theme.  I think I can read that from the driver seat.

1 comment:

  1. Bonjour,
    Sorry not being on irc, but my english is too uneasy, and I am very busy at work.
    Something strange happened to me: I never could have a 4GB SDHC card working properly on IZ2S. So I decided to part one with 2 fat partitions. The first booted and worked fine, but I could not mount the 2nd, even with the help of rkdavis by mail. So I have reparted my SDHC card with one 4GB partition, with gparted on my linux machine. And without conviction, I copied IZ2S and your rockbox on it, and retest. And surprise, it boots and works faster than with my previous 2GB SD card, and rockbox plays without any stutter. I can navigate the menus without altering the sound. Changing theme while playing skips only one second. I'm really happy with 4G now !
    Did gparted facilitate my card access ? I am an hardware guy, I cannot answer, and even less cross-compile apps! Thanks again.

    ReplyDelete