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:


34 Responses leave one →
  1. bart permalink
    June 14, 2012

    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”

    • June 14, 2012

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

      • June 15, 2012

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

        • June 15, 2012

          What exactly is the error or failure you get?

          • June 21, 2012

            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?

  2. June 14, 2012

    ace

  3. Richie permalink
    June 15, 2012

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

    • June 15, 2012

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

      • Richie permalink
        June 16, 2012

        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”.

        • June 25, 2012

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

  4. Amit permalink
    June 25, 2012

    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

    • June 25, 2012

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

      • Amit permalink
        June 25, 2012

        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 permalink
        June 25, 2012

        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

  5. July 6, 2012

    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

  6. Chris permalink
    July 13, 2012

    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 permalink
      July 13, 2012

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

      • chris permalink
        July 13, 2012

        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 permalink
          July 13, 2012

          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 :-/

  7. loderbast permalink
    July 19, 2012

    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 permalink
      August 10, 2012

      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?

      • August 10, 2012

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

        • jfenwick permalink
          August 10, 2012

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

  8. loderbast permalink
    July 19, 2012

    update:

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

  9. loderbast permalink
    July 19, 2012

    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 permalink
      July 19, 2012

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

  10. fivegreenc permalink
    August 2, 2012

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

    • August 2, 2012

      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.

  11. tycho5 permalink
    August 16, 2012

    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!

    • February 8, 2013

      Same problem here… Any suggestions? THX!

    • Joel permalink
      January 27, 2014

      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

  12. October 25, 2012

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

Trackbacks and Pingbacks

  1. Compte-rendu // jeudi 17 janvier 2013 |

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS