Skip to content

How to build Pd-extended on the Raspberry Pi

2012 June 14
by Tedb0t

It was quite an ordeal, but I managed to build Pd-extended (Puredata with a bunch of externals) on my Raspberry Pi running Debian Squeeze.  I also uploaded my finished package (.deb) to puredata.info, see below for details.  Here’s what you need to do:

  1. Firstly, your SD card’s partition is probably not large enough to accomodate all the files we’ll need, so we have to expand it to fit your card first.  From a terminal session on your Pi:
    1. printf "d\n3\nd\n2\nn\np\n2\n157696\n\nw\n" | sudo fdisk -cu /dev/mmcblk0
    2. sudo reboot
    3. sudo resize2fs /dev/mmcblk0p2
  2. We need to add the repositories for the source to aptitude:
    sudo nano /etc/apt/sources.list

    Move to the bottom and paste this in and save (ctrl+o):

    deb-src http://ftp.uk.debian.org/debian/ squeeze main
    deb http://backports.debian.org/debian-backports squeeze-backports main
  3. Update your aptitude cache:
    sudo apt-get update
  4. We’ll need  to install a whole bunch of dependencies for building Pd and all the various externals.  This took like 4 days to manually figure out:
    sudo apt-get install rsync autoconf libfftw3-dev liblua5.1-0-dev swig libvorbis-dev ladspa-sdk libspeex-dev libmp3lame-dev lua5.1
  5. Copy the source:
    rsync -av --delete rsync://128.238.56.50/distros/pd-extended/ pd-extended/
  6. Since it will take a while, you may want to use this command to detach the process from your terminal session and log the output to a file:
    nohup rsync -av --delete rsync://128.238.56.50/distros/pd-extended/ pd-extended/ > rsync.log &
  7. Build the main Pd dependencies:
    sudo apt-get build-dep puredata gem pdp
  8. For some reason I had to change one of the externals’ makefile to get it to build correctly. Open /externals/OSCx/src/Makefile (I used nano), go to line 20 and remove “-lpd” so it looks like this:
    LIBS = -L../../../pd/bin -lc -lm
  9. OK, we’re now ready to actually start building. This will take a long time, hours most likely. I did it piecemeal so I can’t say for sure how long it takes from start to finish.
  10. cd pd-extended/packages/linux_make
  11. nohup make install > makeinstall.log &
  12. While you’re still logged in, you can monitor that logfile by doing
    tail -f makeinstall.log
  13. Once that finishes, you should see “linux_make install succeeded!” Yay! If you encounter any errors please post them here and we’ll see what I missed.
  14. Now we can make the actual Debian package that you can install like any other program:
    nohup make package > makepackage.log &
  15. If you previously installed Puredata vanilla (as per my previous post), you’ll need to uninstall that first:
    sudo apt-get --purge remove puredata
  16. For convenience I uploaded this package to puredata.info.  All you have to do is download that file to your RPi:
    wget -O Pd-0.43.1-extended-20120606.deb http://download.puredata.info/pd-extended-rpi/releases/1.0/Pd-0.43.1-extended-20120606.deb
  17. Finally, let’s install it:
    sudo dpkg -i Pd-0.43.1-extended-20120606.deb
  18. If everything goes well, you now have Pd-extended on your Raspberry Pi! Here’s a new test patch that uses Freeverb~ for you to test, like so:
    pd-extended -nogui -noadc -alsa testPatchExtended.pd
  19. Presently, I’m getting some serious noise and I think it has something to do with the ALSA driver still being in beta. Looking into it. If any other linux hackers have any ideas, please let me know!

Related Posts:


  • bart

    Thanks! Still working on it here.
    Two things I found:
    - in point 2 “deb http://backports.debian.org/debian-backports squeeze-backports” should be:
    deb http://backports.debian.org/debian-backports squeeze-backports main
    - I don’t have externals/OSCx/src/Makefile, only externals/OSCx/src/Makefile.in

    and in that file I cannot find “LIBS = -L../../../pd/bin -lc -lm”

    • http://log.liminastudio.com/ T3db0t

      1) Fixed, thanks!
      2) Hm.. well, try building and see if it works :)

      • http://www.facebook.com/chromatouch Leon Trimble

        i have the same, and no it doesn’t work…

        • http://log.liminastudio.com/ T3db0t

          What exactly is the error or failure you get?

          • http://www.facebook.com/chromatouch Leon Trimble

            having trouble posting comments (so i can cut n paste) in the crappy browser in squeeze, can’t seem to install chrome either, any advice?

  • http://www.facebook.com/chromatouch Leon Trimble

    ace

  • Richie

    I’m completely new to this.
    Question on 2.:
    How do I get to /etc/apt/sources.list: ?

    • http://log.liminastudio.com/ T3db0t

      I made it a bit more explicit :) Thanks for reading!

      • Richie

        Thanks! ctrl+w seems to be search not save. ctrl+o seems to be “write out” which I’m guessing is save but it gives me: “error writing permission denied”.

        • http://log.liminastudio.com/ T3db0t

          Oops, you’re right; I fixed that. Did you do “sudo” before the “nano” command?

  • Amit

    Hi!
    Thanks for this.
    I had some trouble but now I have pd-extended up an running, and actually playing something (random osc~ stuff). Amazing.
    I have forgotten all the steps I had to do (jumping back and forth as I did). I believe I had to install ALSA drivers and pulseaudio among other things.
    Yours, Amit

    • http://log.liminastudio.com/ T3db0t

      If you find out what else you had to do, please leave a note here, I’d love to know!

      • Amit

        I followed your instructions. Roughly though. Instead of:

        sudo apt-get build-dep pure data gem pdpI did:

        sudo apt-get build-dep puredata gem pdp

        I didn’t find:
        /externals/OSCx/src/Makefile

        And I didn’t:
        nohup make package > makepackage.log &

        Somewhere around here I did:
        sudo apt-get install pd

        and ended up with a version of pd I could open and make a patch.
        But no sound:
        “Can’t find etc/dev/dsp. No such file or directory” kept coming up.

        Finally I just deleted the pd from within X11, downloaded your package
        and did:
        sudo dpkg -i Pd-0.43.1-extended-20120606.deb

        Never thought this would work, but I actually got pd-extended where
        pd had been.

        Still no sound though so:
        sudo apt-get install alsa-utils
        sudo modprobe snd_bcm2835
        sudo amixer cset numid=3 1

        This I found here:
        http://mitchtech.net/raspberry-pi-audio/

        Still no sound and after some more digging I found that this:
        http://packages.debian.org/sv/sid/pulseaudio
        might help.

        And it did! :)
        Or something along the way.
        I’m really a newbie, so I guess this was a strike of luck in a stubbornly,
        iterative, recursively crazy behavior. :)

        Hope this is somewhat informative anyhow.
        /Amit

      • Amit

        I followed your instructions. Roughly though. Instead of:

        sudo apt-get build-dep pure data gem pdpI did:

        sudo apt-get build-dep puredata gem pdp

        I didn’t find:
        /externals/OSCx/src/Makefile

        And I didn’t:
        nohup make package > makepackage.log &

        Somewhere around here I did:
        sudo apt-get install pd

        and ended up with a version of pd I could open and make a patch.
        But no sound:
        “Can’t find etc/dev/dsp. No such file or directory” kept coming up.

        Finally I just deleted the pd from within X11, downloaded your package
        and did:
        sudo dpkg -i Pd-0.43.1-extended-20120606.deb

        and somewhere along the way I did do:
        sudo apt-get build-dep pure data gem pdp
        (with “pure” and “data” as two separate words)

        Never thought this would work, but I actually got pd-extended where
        pd had been.

        Still no sound though so:
        sudo apt-get install alsa-utils
        sudo modprobe snd_bcm2835
        sudo amixer cset numid=3 1

        This I found here:
        http://mitchtech.net/raspberry-pi-audio/

        Still no sound and after some more digging I found that this:
        http://packages.debian.org/sv/sid/pulseaudio
        might help.

        And it did! :)
        Or something along the way.
        I’m really a newbie, so I guess this was a strike of luck in a stubbornly,
        iterative, recursively crazy behavior. :)

        Hope this is somewhat informative anyhow.
        /Amit

  • http://twitter.com/Morpion_IDM Martin Herron

    Thanks for this post – I’ve nearly got there with the install after sorting out the OSCx error, but now I’m getting a similar error when Gem starts to compile (la.Glew-Tpo seems to be the problem).

    My last semi-successful run-through last night resulted in Pd-extended opening but loads of noise over the test tones, just like you mention in point 19. I’ve just found this post on the Pi forums with a firmware update to fix a blast of noise at the start of audio files which I’m also experiencing. Not had a chance to try it yet, but maybe the update listed here will help with the distortion: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=38&t=8783

  • Chris

    Hi, when I get to step 7 it says “E: Unable to find a source package for pure.” I’m a complete beginner with linux so I don’t really know what the problem is. Any advice? Thanks

    • Ted Hayes

      Oh wow, not sure how I missed that, it’s supposed to be “puredata.” Fixed.

      • chris

        thanks a lot, that step worked. question #2. when i got to step 8, line 20 of the file isn’t anything like you mentioned. it does indeed start with LIBS, but has something different after that. I don’t have my RPi hooked up now so I unfortunately can’t tell you exactly what it was until tmrw or something, but thought you might have an idea of what is wrong anyway. also, if i don’t do that step, will it just mean that one external isn’t built correctly? or will it mean that the whole process stops? Thanks so much for putting this up by the way–if it all works out, it will help me realize a project i have been working on for the last month.

        • Ted Hayes

          Well, if make runs into any kind of error, it will halt the entire process (as opposed to skipping just that external), because make can’t know that it’s ‘not important.’ So you may just have to try it and see :-/

  • loderbast

    great tutorial!

    i managed to compile it for the new raspbian armhf

    all i had to other than whats in the tutorial, was to add the soures to the sources. list:

    deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi

    and i had to add “tcl-dev” to the apt-get line in step4 of the tutorial to have it also installed.

    everything else is the same i think; the change in the OSCx makefile is still necessary

    i just finished so i have not tested to much.

    • jfenwick

      I’m getting the error:
      GEM: X server has no OpenGL GLX extension
      This is on Raspbian. I added the repository you listed before I compiled.
      How did you get gem to work?

      • http://log.liminastudio.com/ T3db0t

        I haven’t tried gem at all; I’ve only been using this headless (no monitor, no window manager).

        • jfenwick

          I know you haven’t yet, but loderblast claims in the post before this one that he got gem working.

  • loderbast

    update:

    gem, midi i/o and audio are all working.
    audio still has the glitches and noise bursts like before though

  • loderbast

    turns out, gem is not working in my raspbian build. it can`t open a window, because x server is missing GLX extension
    when i tried earlier, i had ssh`ed into my rpi from windows7 using xming and thats why it worked. (because the whole OpenGL Stuff was not actually done on the rpi)

    any idea, why it worked on the old debian squeeze ?
    pretty sure, i could create a gemwin with your pd package on debian squeeze.

    any idea where to start looking?
    i am a linux noob, so also stuff that might seem obvious to you might help me.

    • Ted Hayes

      I haven’t tried gem or windowed pd at all in fact; I’ve only been using it from the command line :/

  • fivegreenc

    I keep getting an eror messge after I try step 4: Unable to locate package autoconf libfftw3-dev. Any ideaswhat could be causing this?

    • http://log.liminastudio.com/ T3db0t

      It means you don’t have those programs/packages installed, so you need to install them. Try apt-get update and then apt-cache search to see if it’s something aptitude has, and then apt-get install . This is the entire tedious process of building an application for a new platform. You have to do a lot of googling.

  • tycho5

    Great tutorial, thanks! I can’t get the rsync to work to 128.238.56.50. It keeps timing out. Can you confirm that site works?

    Also, adding backports.debian.org to sources.list is throwing errors (failed to fetch). Did that url change?

    Thanks again!

    • http://www.facebook.com/hauki0 Hauki Hauer

      Same problem here… Any suggestions? THX!

      • ZDR

        Same issue… any solutions?

    • Joel

      same problem here, has anyone managed to get past this step? Im running raspbien myself so im not sure if thats the issue? Please get back to us if you have!? Thank you

  • http://www.facebook.com/outoff Sergey Komarov

    Thanks for tutorial, PD works well, BUT !!!! Do anyone has success with GEM !?
    How to fix problem with GLX? Best !

  • Pingback: Compte-rendu // jeudi 17 janvier 2013 |