Compiling SqueezePlay on linux (Ubuntu AMD64)

Standard

Logitech Squeezeboxes are great little network audio streamers — I have a squeezebox Duet, which is much cooler (IMO) than an Apple TV + iPod.

Squeezeplay is the Squeezebox controller / squeezebox touch user interface, and it can run on any computer. You can use that computer as a controller for your squeezebox receiver, or as a complete squeezebox, playing music. If you can get it running on a portable device, you effectively get a new Squeezebox Controller for free.

Unfortunately, even though the Squeezeboxes are based on a GNU/Linux foundation, Linux users don’t get much love when it comes to releases of SqueezePlay… so we have to compile it ourselves.

Here is how to get SqueezePlay working on Ubuntu karmic amd64, but the instructions should apply to other distros. I’ve also tested it on Karmic 32 bit.

In order to run SqueezePlay, we need to compile the latest development code for SqueezePlay 7.5 that Logitech have available online on their SVN server. This guide is correct as at 21 Nov 2009, but as the Logitech devs work on the code, things will change, and they might introduce new bugs. For now, this is the procedure — and it works nicely with my SqueezeCentre 7.4.1.

First of all, we need to install the required dependencies. This may not be a complete list, as I may have had things installed already — if you get errors with ld towards the end of the process, you may be missing some.

Install the below packages with the following command in a terminal:

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 libasound-dev

Next, we need to grab the SVN source code. Create a directory somewhere, open a terminal, and cd into the directory. Then do:
svn co http://svn.slimdevices.com/repos/jive/7.5/trunk/squeezeplay

Wait while the source is downloaded.

Now, we need to fix a couple of bugs to ensure it compiles smoothly. I’ve reported these to the dev team, so if you can’t find the parts to change — or it looks like they are fixed already, then don’t worry :-)

The first two bugs are in <your-folder>/squeezeplay/src/Makefile.linux, so open up the file in a text editor, and make the following changes:

  • On line 10, change ${PWD} to $(shell pwd) . After the change, line 10 will look thus:
    SRC_DIR = $(realpath $(shell pwd)) .
  • Change line 146 from: cd luaprofiler-2.0 && make -f Makefile.linux install to: cd luaprofiler-2.0 && LD="gcc -shared" make -f Makefile.linux install

The third bug: browse to <your-folder>/squeezeplay/src/squeezeplay/src/audio/decode, and open decode.c. Find the printf statement on line 434, and change %llu to %"PRIu64". After this, line 434 will look like this:
printf("elapsed:%"PRIu64" buffers: %0.1f%%/%0.1f%%\n", elapsed, dbuf, obuf);

Finally, we need to replace one of the static libraries that squeezeplay is using — the version of portaudio that is included is out of date, and prevents sound from playing. So, download the latest portaudio here, put it in your squeezeplay/src directory, and double-click it to extract it there. Then rename Logitech’s portaudio_v19_1360 directory to portaudio_v19_1360-old, and rename your new portaudio directory to portaudio_v19_1360.

Now, it’s time to compile the code. Switch to the <your-folder>squeezeplay/src directory in your terminal (e.g. cd squeezeplay/src), and run the compile as follows:

sudo make -f Makefile.linux

This will take a while. Once done, you will have a tarball in the ../build directory. To install squeezeplay, you just need to extract the contents of this to /opt/squeezeplay:


cd ../build/
sudo mkdir /opt/squeezeplay
tar -C /opt/squeezeplay -xvf sq<TAB>

(the exact name of the squeezeplay tarball will vary — just hit tab to have it auto-complete).

then, to start squeezeplay, the command is:
/opt/squeezeplay/bin/squeezeplay.sh

to uninstall, just delete it from /opt.

Some potential hiccups:

  • Makefile.linux has a “-deb” option that is supposed to build a .deb package for installation. However, it doesn’t seem to work. Furthermore, if you try it, you’ll need to clear out your working folder and start again — even with ‘make clean’, you’ll never be able to build a package until you start over, for some reason.

 

Squeezeplay on Ubuntu

Squeezeplay on Ubuntu

My next step is to get it running on an old iPaq PDA I have lying around… watch this space!

80 thoughts on “Compiling SqueezePlay on linux (Ubuntu AMD64)

  1. stridger

    Did you actually get the audio working as well?

    I get errors of the kind:

    ALSA lib conf.c:2700:(snd_config_hooks_call) Cannot open shared library libasound_module_conf_pulse.so
    ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM default
    20091123 00:25:35.731 ERROR audio.output – decode_alsa_fork:180 jive_alsa failed to start

    I have fiddled for quite some time but was not able to solve it…

  2. admin

    Yes, I am getting the same error. When I wrote this, I assumed it was working, but I was wrong. As far as I can tell, it is one of the libraries not being compatible with the pulse audio alsa plugin, but I’m not sure how to solve it without killing pulse audio on my system, which I don’t want to do.

    I’ve tried compiling with the latest portaudio and portmixer from the audacity CVS source, and it doesn’t seem to help. What’s more, I only get the above error as root — as a normal user, I get permission denied.

    Do you get audio with cd opt/squeezeplay/bin; pasuspender ./squeezeplay.sh ?

    Nearly there!

  3. Thanks for the tutorial – however, I am stuck after the build command (sudo make -f Makefile.linux) … it is not creating a squeezeplay/build/ directory and I can’t actually find the file it is building … I ran it from the squeezeplay/src directory and it didn’t throw any errors. However, when I cd ../build/ directory does not exist.

    Something I did must not be right …

  4. admin

    Damon — if you are running it as root, check it didn’t make a /build folder in your root directory. If not, you probably tried building before, and it failed. Try running make -f Makefile.linux clean then compiling again. If that doesn’t work (and it didn’t always for me), delete everything and start with a fresh check-out.

  5. Jim

    Thank you for providing this information. for the first time, I have squeezeplay running on my amd64 desktop. It will operate and play my squeezebox, and acts like everything is running my desktop computer sound system, but alas, no sound ! I know the sound is working because other apps will make it work, but not the squeezeplay. However, most everything else appears to be working; including interaction with mysqueezebox.com, my squeezebox, all the settings, etc. Just no sound !

    Such a great thrill to see what we are so close to having, but not there yet.

  6. All right – I will start from scratch again (isn’t in /root/ folder and I can’t get it to clean without errors. I can’t remember if I tried it twice, but I might have.

    Should I be running make -f Makefile.linux clean (from you comment) or sudo make -f Makefile.linux clean (from the post) from the outset?

    Thanks! Hope we can get the sound working!

  7. Graham

    Hitting the same error

    ERROR audio.output – decode_alsa_fork:180 jive_alsa failed to start

    I get the same errors from

    sudo pasuspender ./squeezeplay.sh
    and
    sudo pasuspender ./jive

    tried to directly run ./jive_alsa but I haven’t figured out the right options

  8. admin

    I am getting closer.

    First of all, thanks to stridger, try deleting /opt/squeezeplay/lib/libFLAC.so.8.2.0 . That should get rid of the module error, but you then have to run jive as root.

    Let me know the errors you get as root and non-root after that.

    I think the permissions error might be due to AppArmor in Ubuntu 9.10. You could try sudo aa-complain /opt/squeezeplay/jive to see if it helps — I’m still working on it.

    This might be enough to get you sound — let me know. In my case, jive_alsa doesn’t seem to start — or the forked process doesn’t seem to survive. I’m trying to debug and get the arguments to run it directly, will let you know.

  9. markusk

    great to see this running, but as all of you – i don’t get no sound :(

    sudo aa-complain /opt/squeezeplay/bin/jive doesn’t seem to do nor help anything either..

    hope u wizards can get it sorted out..

  10. Graham

    Tried deleting /opt/squeezeplay/lib/libFLAC.so.8.2.0, but I still get errors

    /opt/squeezeplay# ./bin/squeezeplay.sh

    20091128 07:46:06.115 ERROR audio.output – decode_alsa_fork:165 execv failed 2

    20091128 07:46:06.615 ERROR audio.output – decode_alsa_fork:180 jive_alsa failed to start

  11. dormant

    When installing on 32-bit Ubuntu, is the third bug still relevant?

    It’s just that a variable called “PRIu64″ might be 64-bit specific.

    Any more progress on sound?

  12. Morten

    I followed your instructions to build SqueezePlay 7.5 on my 64bit Ubuntu 9.10. I ran into another problem, where the build failed because of a missing config/compile directory.

    After I changed line 49 of src/squeezeplay/Makefile.in to ‘$(top_srcdir)/src/config.h.in \’ the build is ok.

    Unfortunately no sound for me either…

  13. dormant

    When I try and run jive_alsa on its own, I get

    $ /opt/squeezeplay/bin/jive_alsa -d default -c default -b 30000 -p 3 -s 16 -f 3
    ALSA lib conf.c:2700:(snd_config_hooks_call) Cannot open shared library libasound_module_conf_pulse.so
    ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM default

    It appears is if this library has been dropped from libasound2-plugins.

    I got the library by removing libasound2-plugins and manually instaling libasound2-plugins_1.0.20-1ubuntu6_i386.deb.

    However, I still get the same fork error – it looks (to this non-programmer) as if there is a problem with the path set in decode_alsa.c

  14. f948lan

    All,

    Thanks for the guide, I’ve just got it going on a new Gentoo Linux system.

    The fork error is caused by squeezeplay looking for jive-alsa in the current directory. If you edit the launch script (/opt/squeezeplay/bin/squeezeplay.sh) and add:

    cd $INSTALL_DIR/bin

    before the last line, so the last few lines end up looking like this:

    ## Start up
    export LD_LIBRARY_PATH=$LIB_DIR:$LD_LIBRARY_PATH
    export LD_INCLUDE_PATH=$INC_DIR:$LD_INCLUDE_PATH

    cd $INSTALL_DIR/bin
    $INSTALL_DIR/bin/jive

    jive-alsa will then launch correctly.

    If you also have the ‘Cannot open shared library’ error, hopefully the instructions in the post above will fix that, as I didn’t suffer that problem on Gentoo.

  15. Graham

    Doesn’t llok like a path issue. I added cd $INSTALL_DIR/bin to /opt/squeezeplay/bin/squeezeplay.sh and got the same error

    20091203 06:25:37.143 ERROR audio.output – decode_alsa_fork:180 jive_alsa failed to start

  16. MattyJ

    A big thankyou from here. Got squeezeplay 7.5 built and working (with sound) on karmic using all the tips above. I had to do a couple of other things to get sound working:-

    1) completely remove pulseaudio :-

    sudo apt-get purge pulseaudio

    2) changed the permissions to allow all in /opt/squeezeplay with:-

    sudo chmod -R 777 /opt/squeezeplay

    Hope this helps some of you. In my experience pulseaudio has been add the root of all the sound problems I have had in ubuntu. Removing it has solved a lot of problems.

    I now have four instances of squeezeplay running on four different PCs all in perfect sync with my squeeezbox boom and squeezebox radio. I am a very happy bunny

  17. Jim

    Same here. Remove that pulseaudio. Didn’t like it anyway. Turned out that was the cause of several problems I was having with the karmic upgrade. This has to be the worst ubuntu upgrade ever. Enough to revert back to another distribution.

    Anyway, squeezeplay is great and thank you so much for posting this. Perhaps this will inspire logitech or someone to package this. It works !

  18. jerry

    Thanks. Fantastic instructions that can be followed by a linux know nothing like me. Worked beautifully on xubuntu on a pretty low powered desktop.

  19. Mate, thanks a bunch for your guide! I couldn’t get SqueezePlay 7.4 to compile properly but following your guide and going for version 7.5 worked!

    I had some issues with decode_vorbis.c though. There seemed to be a mismatch with the tremor headers. For instance, the included tremor/ogg.h didn’t contain OGG_STARVED which was required by decode_vorbis.c. Not sure why, because there hasn’t been any changes to it in trunk since your post.

    Anyways, I noticed that there was a Tremor dir included with the SqueezePlay project which contained the correct headers, so I just switched:
    #include
    #include
    #include

    to

    #include “../../../../Tremor/ogg.h”
    #include “../../../../Tremor/ivorbiscodec.h”
    #include “../../../../Tremor/ivorbisfile.h”

    Voila! SqueezePlay is up and running.

  20. Tom

    great guide, but it’s still not working here.
    this is the error message: 20091230 20:14:04.952 ERROR squeezeplay.ui.draw – jive_surface_load_image:195 Can’t find image jive/splash1920x1080.png
    20091230 20:14:05.554 ERROR squeezeplay.ui.draw – jive_surface_set_video_mode:65 SDL_SetVideoMode(1920,1080,32): Couldn’t set console screen info

    i’m a linux newbie, but i guess it’s has got to do with my screen resolution; any ideas ? thnx

  21. Walter

    Your guide works essentially verbatim on Fedora 11. However, after squeezeplay (v7.5.0 r8272M) tries to connect to either a local squeezebox server or mysqueezebox.net, it dies, saying:

    20100103 23:54:47.641 ERROR audio.output – decode_alsa_check_pids:48 exit, playback child is dead

    In this case,
    /opt/squeezeplay/bin/jive_alsa -d default -c default -b 30000 -p 3 -s 16 -f 3
    runs indefinitely and silently. (I don’t know where to look for any output, though.)

    How can I turn on debugging to get more information?

    Thanks very much for the helpful instructions to get this far.

  22. Steve Carter

    Great tutorial, all working well. For me the following small changes were necessary (Ubuntu 9.10 Karmic AMD64)…

    1 – The very first command I got an error relating to libasound-dev stating I had to be specific and had to change to libasound2-dev (note addition of ’2′). i.e:

    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

    2 – Second from last command needed a ‘sudo’ i.e:

    sudo tar -C /opt/squeezeplay -xvf sq

    3 – Followed MattyJ’s post December 3rd, 2009 on 5:02 pm:

    > completely remove pulseaudio :-

    sudo apt-get purge pulseaudio

    > changed the permissions to allow all in /opt/squeezeplay with:-

    sudo chmod -R 777 /opt/squeezeplay

    Very happy, thanks Jfw and the rest of you.

  23. Kev Walke

    I could never get this to work. However, I checked out the 7.6 branch instead, and was able to build the application using only the second change to the makefile you outline above and installing the package “realpath”. The squeezeplay-deb makefile option also worked successfully for me. However, it still does not play nicely with pulseaudio.

  24. Peter

    On Ubuntu 9.10 x86, I was able to compile with minimal changes. The result plays audio on my 8.04 LTS x64 system (even though it uses PulseAudio!) but is mute on my 9.10 system (where I have not gone so far as to try removing PulseAudio). Since SqueezePlay is now under a BSD-style license, I’ve put binaries up in my web space, http://www.tux.org/~peterw/slim/squeezeplay/

    You’ll find the patch I applied there (yes, I used the portaudio code from Logitech), and detached PGP signatures for the build tarballs.

  25. Nemno

    Got the windows version working on ubuntu with wine :p
    Downloaded wine with pulseaudio driver and installed the windows version of squeezeplay.

    I didn’t want to remove pulseaudio so this works for the moment.
    So now waiting for someone (maybe myself) to make a pulseaudio version.

  26. Mervin

    Jeff, when you say that “they have fixed the audio output problems”, do you mean that you’ve compiled a version that will work with pulseaudio?

    That’s my remaining issue with squeezeplay, as the other audio tools I use are set up and work well on Lucid/pulseaudio.

  27. Wilhelm

    I got this error on Ubuntu 10.04. Does anyone know what I missed. I would really appreciate it.

    config.status: creating Makefile
    config.status: creating src/config.h
    config.status: src/config.h is unchanged
    config.status: executing depfiles commands
    tolua++ -n jive -o src/ui/lua_jiveui.c src/ui/lua_jiveui.pkg
    /bin/bash: tolua++: command not found
    make[1]: *** [src/ui/lua_jiveui.c] Error 127
    make[1]: Leaving directory `/home/ubuntu/Downloads/squeezeplay/src/squeezeplay’
    make: *** [squeezeplay] Error 2

    Thanks

  28. Esben

    I just managed to build SqueezePlay on Ubuntu 10.04. In particular, the most recent version snapshot of http://svn.slimdevices.com/repos/jive/7.5/trunk/squeezeplay/ which now is SVN revision 9083. I still had to make the changes described by John (at the top of this page), i.e. modify src/Makefile.linux, update src/portaudio_v19_1360, and install the required packages (with apt-get).
    In addition to this I had to build tolua++ (as noted by Wilhelm above), which can be done using the code in src/tolua++-1.0.92/. Doing so involves roughly -
    1) insert the project’s include-path and lib-path in src/tolua++-1.0.92/config_linux.py, something like this –
    CCFLAGS = ['-I/usr/local/include', '-I/.../squeezeplay-7.5/build/linux/include', '-O2', '-ansi', '-Wall']
    LIBPATH = ['/.../squeezeplay-7.5/build/linux/lib/']
    2) install and run ‘scons’ in squeezeplay-7.5/src/tolua++-1.0.92
    3) make the resulting executable ‘squeezeplay-7.5/src/tolua++-1.0.92/bin/tolua++’ visible for the makefile, e.g. make a symlink.

    After taking these steps, the ‘make -f Makefile.linux’ actually completes the build without errors. Alas, the fresh SqueezePlay does not run, but aborts with the error:

    Squeezeplay 7.5.1 rexported
    Jive: …opt/squeezeplay/share/jive/jive/InputToActionMap.lua:83: table index is nil
    stack traceback:
    …opt/squeezeplay/share/jive/jive/InputToActionMap.lua:83: in main chunk
    [C 0x811fb70]: in function ‘require’
    /opt/squeezeplay/share/jive/jive/JiveMain.lua:44: in main chunk
    [C 0x811fb70]: ?
    [C 0x805b64a]: ?

    Does anybody know where to go from here?

  29. David MacDonald

    I seem to get stuck at tar -C /opt/squeezeplay -xvf sq. I assume that is not typred into the terminal but rather I hit the Tab key at that point. If I do that the computer makes a thump sound but does nothing. If I then hit enter I get the following :
    david@Mainq:~$ tar -C /opt/squeezeplay -xvf sq
    tar: sq: Cannot open: No such file or directory
    tar: Error is not recoverable: exiting now
    david@Mainq:~$ tar -C /opt/squeezeplay -xvf sq

    Sorry if this is all rather obvious I am a bit new to Ubuntu
    Using version 10.10 64 bit

  30. David MacDonald

    Clarification—I mean’t the is not typed into terminal just the rest of cmd. I am a little new to Ubuntu

  31. David MacDonald

    Clarification—I mean’t the TAB is not typed into terminal just the rest of cmd. I am a little new to Ubuntu

  32. admin

    David: the tab is for auto-completion. If you are in the directory the file is in, hitting tab after typing the first few letters is the same as typing the full filename.

    J

  33. David MacDonald

    I can’t seem to unpack the tarball in ..build to /opt/squeezeplay. In fact if I go into /squeezeplay/build I find a folder called linux with 5 nested folders inside. Is this the unpacked tarball? Can I just copy and paste it into /opt/squeezeplay? Also I notice at the end of sudo make -f Makefile.linux compiling I get a list of errors as follows:cc1: warnings being treated as errors
    src/audio/decode/decode.c: In function ‘decode_thread_execute’:
    src/audio/decode/decode.c:443: error: format ‘%lu’ expects type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’
    make[2]: *** [decode.lo] Error 1
    make[2]: Leaving directory `/home/dave/squeezeplay/src/squeezeplay’
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/home/dave/squeezeplay/src/squeezeplay’
    make: *** [squeezeplay] Error 2

  34. Simon Andrews

    Firstly, thanks for this article! It has been a great help and I’ve used it numerous times.

    The last time I used this (32 bit Ubuntu 10.04) I followed the instructions as detailed above, but I’ve just installed Squeezeplay on 64 bit Ubuntu 10.10 and the steps for decode.c were not required, leave the string as %llu (if you make the change you get the error that David MacDonald got).

    It’s probably got nothing to do with the OS, it looks like the devs have change the source to work unmodified.

  35. David MacDonald

    Came back to this web site after a month, having given up on the installation of Squeezeplay. Now thanks to the author of these directions and help from the comments section (Simon Andrews and MattyJ ) I have a working copy on 64 bit Ubuntu 10.10….Thanks

  36. Richard

    I’m running 10.04 LTS. When I use these instructions and even without using them (so before applying the edits above), I always run into the same issue of being unable to login as ‘anonymous’ to the Mars.org FTP site. When I ftp from CLI, I need to give the site my email address as my password or it won’t let me proceed – so, Where can I add an email address to get me beyond this issue or how might I circumvent this need altogether?

    TIA

  37. Richard

    OK, My FTP woes were circumvented by
    [1] doing the install as a regular user sudoing,
    [2] removing the wget from Makefile.linux but adding the libmad tarball to the ‘generated’ folder in src.

    Now I have a GUI which starts up and boasts functionality but no sound so far..just static

  38. Richard

    Music at last! Sounds much better than iTunes too, Had to remove PulseAudio like some others. Thank you to all contributors for getting me up and running with SqueezePlay, especially JfW.

  39. After an afternoon of head scratching and compiling I’ve got this to work on Ubuntu 10.10 as a non root user with pulse audio.
    The various patches needed bringing up to date with the svn version of squeezeplayer.

    Email me at mitchell_neill@hotmail.com and I’ll give details of where to get a working tarball.

  40. Justin

    Got it working with pulseaudio…problem for me was in the libFLAC library. The makefiles had stream_encoder.c commented out, but that is where a few extern variables like FLAC__StreamEncoderInitStatusString are declared, so it kept throwing an error when looking for those symbols

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>