The sound of sorting

sound-of-sortingI’m a little bit of a sorts geek, I like all types of sorting algorithm and in the dim and distant past I actually had a few of the sorts I wrote In BASIC published in some Computer magazines & newsletters. So when I stumbled across earlier today while doing some research into something else I immediately got side tracked :) and just HAD to try it on the Raspberry Pi. As the Raspberry Pi I am currently working with, my current dev pi is a 256meg Model B that I have been using to play around with the Pibrella, Simpie & TI Chronos watch on which means i’d only installed python, wiringPi & Phil Howard’s Pibrella python lib installed already and because sound-of-sorting requires the SDL & wxWidgets development packages I had to install SDL & wxWidgets on the raspberry Pi.

 sudo apt-get install libsdl1.2-dev libwxgtk2.8-0 libwxgtk2.8-dev

and downloaded the sound-of-sorting source code.


and then untar’ed it.

tar xjvf sound-of-sorting-0.6.5.tar.bz2

and then did the normal

cd sound-of-sorting-0.6.5

However when building a few sign comparision warnings came up and when I ran it with sound enabled the audio cut off after a few seconds, it looked like the buffers weren’t being refilled however as I don’t normally do anything with audio I wasn’t sure whether I had my audio setup correctly or not. So I tried with the version of sound-of-sorting from git.

 git clone

and rebuilt it and this time it built with no warnings, however audio still cut out after a few seconds :( Everything else worked as expected and is actually quite fun to leave running but as part of the fun of watching sorts sort is if they have audio then to watch AND listen to the sorts working i really wanted to workout why it wasn’t working so set SDL to write the audio to a file rather than try to play it but setting the environment variable SDL_AUDIODRIVER to disk.


and after running sound-of-sorting and looking at the file sdlaudio.raw it looked like it was working but audio on my Raspberry Pi is not setup correctly so i asked on twitter for volunteers to try the binary i’d built & Phil Howard (@gadgetoid) tried it for me and it worked for him :)

So it looks like I need to setup audio correctly on this raspberry Pi and that sound-of-sorting does work on the Raspberry Pi so you can either build it yourself or to save time you can use the binary I built although you’ll need to install wxwidgets & sdl libs. The Raspberry Pi binary is available at


Leave a Reply

Your email address will not be published. Required fields are marked * © 2014 Frontier Theme