Birds Like Wires

Feed the Birds

Compiling Squeezeplay

If you’ve ever tried the binaries of Squeezeplay 7.6 available from the nightly downloads, you’ll know that things aren’t quite right for Ubuntu. The same holds true for the Joggler, where the graphics and the audio are pretty messed up. But there is a way, if you compile it yourself!

Compiling for Ubuntu

If you’re after a working version of Squeezeplay for Ubuntu, in an identical style to that seen on the Mac and Windows, then this article should be everything you need. If you’re wanting that dream Squeezeplay system on your Joggler, there is a little more work to do afterwards. I won’t be going into the detail in this post, but the reason you’ll have problems is that the standard Squeezeplay interfaces are designed for a fixed resolution of 480×272 or smaller, while the Joggler has an 800×480 display.

The reason for writing this when you can download Tarkan Akdam’s excellent Squeezeplay on the Joggler binaries is that I like to know how to do things from scratch. It gives a greater understanding of ‘how stuff works’, but can also take the pressure off those that supplied the binaries in the first place with regard to updates, keeping binaries online, fielding questions; all that admin kind of stuff.

At the end of this little guide you should have a working compiled version of Squeezeplay 7.6 that can be used on both Ubuntu and, to an extent, on the Joggler’s native operating system. Before starting, you’ll need a copy of Ubuntu 9.10 (not managed to get 10.04 to compile it as yet) and a Joggler with SSH (and preferably SCP) enabled if that’s your target. Unless you’re a whizz at cross-compiling, you’ll need an x86 system to target the Joggler.

The bulk of getting Squeezeplay to compile under Ubuntu was done by John Wells of www.jfwhome.com, so full credit goes to John as I would never have figured out what to do on my own.

Fetch Dependencies and SVN Source

On your Ubuntu system, open the Terminal and start off with this:

sudo apt-get install build-essential flex bison subversion automake libtool libpng12-dev libjpeg62-dev libexpat1-dev libreadline5-dev xorg-dev libflac++-dev libvorbis-dev libvorbisidec-dev libasound2-dev

This shouldn’t give you any errors and will put all of the libraries you require onto your system. Then create a directory somewhere, cd into it and grab the latest SVN source code:

svn co http://svn.slimdevices.com/repos/jive/7.6/trunk/squeezeplay

Tweaking

Open squeezeplay/src/Makefile.linux and change the following:

- 10: SRC_DIR = $(realpath ${PWD})
+ 10: SRC_DIR = $(realpath $(shell pwd))

- 146: cd luaprofiler-2.0 && make -f Makefile.linux install-
+ 146: cd luaprofiler-2.0 && LD="gcc -shared" make -f Makefile.linux install

Save the makefile and if you’re aiming for the Joggler, consider whether you think a visible cursor is any use on a touchscreen device with no mouse. If you think not, make the following change to squeezeplay/src/squeezeplay/src/ui/jive_framework.c to disable the pointer:

- 1075:                SDL_ShowCursor(SDL_ENABLE)
+ 1075:                SDL_ShowCursor(SDL_DISABLE)

Probably leave this out if you’re mouse-bound on an Ubuntu desktop.

There is one last thing to think about, and that’s the window that SqueezePlay will create for itself. On the Joggler Native OS there’s no problem, because there are no windows as such. But on Ubuntu there are, and depending on the sort of user interface you’re aiming for, you may want to consider looking around lines 843 and 855 in squeezeplay/src/squeezeplay/src/ui/jive_surface.c.

Firstly, do a search for SDL_RESIZABLE; there should be two instances. It seems to me a little pointless to have resizable windows for a non-resizable interface, so feel free to kill these flags off if you want. But my personal interest is in changing these to SDL_NOFRAME. By doing that you get no window furniture whatsoever, which is great if you want as much UI as possible. If you do this, make sure you export SDL_VIDEO_WINDOW_POS=0,0 (described below), as this will make sure it’s always drawn from the top-left of the screen.

Update PortAudio

Finally, the static library for PortAudio included with Squeezeplay needs updating. Grab a copy of the latest snapshot and decompress it into squeezeplay/src. The easiest way to get the new verison to be used is just to rename it to match the old version. Rename portaudio_v19_1360 to portaudio_v19_1360_old and rename portaudio to portaudio_v19_1360.

Update SDL (Optional)

I’m not sure why you’d need to do this at the moment, but just in case you need to there’s a patch file available on this thread that will prep SDL v1.2.14 for SqueezePlay. I was looking for a way to make the X11 screensaver work in full screen mode, but that’s an entirely different story.

Compile It!

While in squeezeplay/src, run:

make -f Makefile.linux

Make yourself some tea. If all goes well the last part of the compilation process should bundle everything into a .tgz in the squeezeplay/build directory.

Installation

Once you have some binaries, it’s time to install them.

On Ubuntu

Move the tarball to /opt/squeezeplay/ and decompress it. Squeezeplay has some issues with PulseAudio, so if you actually want to hear anything you’ll need to tweak your /usr/share/alsa/alsa.conf file and comment out the line that refers to pulse.conf.

Then you should just need to type /opt/squeezeplay/bin/squeezeplay.sh and you’ll be good to go. There’s even a .PNG icon in /opt/squeezeplay/share/jive/jive/ for you to use for your shortcut.

On the Joggler

Shift the tarball into /media/squeezeplay/ and decompress it. You will need to copy two libraries, libjpeg.so.62 and libpng12.so.0 from /usr/lib/ on Ubuntu into the /media/squeezeplay/lib directory, otherwise not very much will happen. Then open /media/squeezeplay/bin/squeezeplay.sh and make a few changes:

- 8: INSTALL_DIR=/opt/squeezeplay/
+ 8: INSTALL_DIR=/media/squeezeplay/

...

+ ## Joggler specific
+ export DISPLAY=:0.0
+ export SDL_AUDIODRIVER=alsa
+ export KMP_DUPLICATE_LIB_OK=TRUE
+ export SDL_VIDEO_WINDOW_POS=0,0

cd $INSTALL_DIR/bin
./jive

Save the file and try it out with /media/squeezeplay/bin/squeezeplay.sh.

The Squeezeplay default 480x272 skin on a Joggler.

You’ll quickly see why things aren’t perfect. While you should be able to use your freshly compiled Squeezeplay app, you were probably hoping it wouldn’t just appear in the top-left corner of the screen. That fixed layout of the WQVGAsmallSkin used by Squeezeplay means that you are limited to a resolution of 480×272, unless you tweak the skin. It’s now that you’re probably cursing and heading for squeezingtarkan, but have heart. It is possible to simply replace the WQVGAsmallSkin folder in /media/squeezeplay/share/jive/applets with the one from Tarkan Akdam’s version. Unless there have been important changes to the skin between SVN releases (which is entirely possible), you’ll find yourself with the latest code and an 800×480 skin to boot.

Watch this space, though. I might be working on something. :)

Thinning

The last thing you may want to do is bin anything that isn’t really required from the built version. The following is a list of files and folders that can be discarded, because they are either libraries that are already linked, or they have no use for us on the Joggler or Ubuntu.

bin/freetype-config
bin/gmon.out
bin/lua
bin/luac
bin/sdl-config
include/
lib/*.a
lib/*.la
share/jive/applets/Bounce

These last few can be removed if you have no use for skins other than WQVGAsmallSkin (the default).

share/jive/applets/QVGAlandscapeSkin
share/jive/applets/QVGAportraitSkin
share/jive/applets/SetupWallpaper/wallpaper/bb*
share/jive/applets/SetupWallpaper/wallpaper/jive*
share/jive/applets/WQVGAlargeSkin

You may want to make sure you have a backup before you start deleting!

← Recent Articles