Personal tools
You are here: Home Hardware PRAP 'Pd anywhere' on the Beagle Board

'Pd anywhere' on the Beagle Board

Installing 'Pd anywhere' (PDa) on the Beagle Board. Note that this is an ongoing project, so read to the end before trying this!

Creating a BitBake recipe

After having set up an Open Embedded tool chain for the Beagle Board and having used it to build Tcl/Tk, the task of installing Pd anywhere (PDa) on the board basically boiled down to creating a bitbake recipe for PDa. I used one written by Hans-Christoph Steiner. The path where Open Embedded looks for bitbake recipes is defined by the BBFILES environment variable (which in my case is set in <my_open_embedded_dir>/oe/beagleboard/beagleboard/conf/local.conf and <my_open_embedded_dir>/oe/beagleboard/beagleboard/profile.sh; not sure which is relevant) to the following value:

BBFILES = "/home/flo/oe/openembedded/packages/*/*.bb"

So in this directory, I created a subdirectory for PDa:

mkdir <my_open_embedded_dir>/openembedded/packages/pda

and in that directory, I created a file called PDa_0.6.bb, with the content from Hans-Christoph's bitbake recipe. I reproduce it here for the sake of completeness:

PRIORITY = optional
DESCRIPTION = "Pure Data anywhere"
HOMEPAGE = "http://gige.xdv.org/pda/"
LICENSE = "GPL"
PACKAGES = "${PN}"

PR = "r1"

DEPENDS = "tk"
SRC_URI = "http://gige.xdv.org/pda/release/src/PDa-${PV}-src.tgz;md5sum=b0375f214cc46c04d207307eb2a9708b"

S = "${WORKDIR}/PDa/src"
FILES_${PN} = "${bindir}/pd \
                        ${bindir}/pdsend \
                        ${bindir}/pdreceive \
                        ${libdir}/pd/bin/* \
                        ${libdir}/pd/intern/*.pd_linux \
                        ${libdir}/pd/extra/*.pd_linux \
                        ${libdir}/pd/doc/* "

do_compile () {
    export BROOT=${STAGING_DIR}
    export X11LIB=${STAGING_LIBDIR}
    oe_runmake -C ${S} all
}
do_install() {
  oe_runmake -C ${S} DESTDIR=${D} install
}

Another thing tat turned out to be required before building the package was to add the URI of the PDa sources to <my_open_embedded_dir>/openembedded/conf/checksums.ini. I added the following lines to the top of the file:

[http://gige.xdv.org/pda/release/src/PDa-0.6-src.tgz]
md5=b0375f214cc46c04d207307eb2a9708b
sha256=934154ca290aeae47b78910da4ddbf5c181a5cc36294dea9d54617107cad4988

The two checksums I simply found by by downloading the PDa source package from the URL above and then running

md5sum PDa-0.6-src.tgz
sha256sum PDa-0.6-src.tgz

Building the PDa package

Eventually, I built the package with the following sequence:

cd <my_open_embedded_dir>
source beagleboard/beagleboard/profile.sh
cd openembedded
git pull
git checkout
cd ..
bitbake pda
I am not sure how BitBake handles the search for the right recipe, but be warned that the name of the recipe's directory does play a role in this. I had the directory named puredata first and tried to build the package with a 'bitbake puredata', but that resulted in an error message.

Installation on the Beagle Board

I then copied the packages for PDa, Tcl and Tk (all of which were located in <my_open_embedded_dir>/tmp/deploy/glibc/ipk/armv7a) onto the SD card holding Koen's Angstrom demo image and installed them there with the Beagle Board's GUI-based GPE-Package-Manager. However, when I tried to test PDa, this is what I got:

flo@beagleboard:~$ pd
Application initialization failed: Can't find a usable tk.tcl in the following directories: 
    /usr//lib/pd/tk/library /usr/lib/tcl8.4/tk8.4 /usr/lib/tk8.4 ./lib/tk8.4 ./library ./tk8.4.11/library
/usr/lib/tk8.4/tk.tcl: no event type or button # or keysym
no event type or button # or keysym
    while executing
"bind Listbox <MouseWheel> {
        %W yview scroll [expr {- (%D / 120) * 4}] units
    }"
    invoked from within
"if {[string equal [tk windowingsystem] "classic"]
        || [string equal [tk windowingsystem] "aqua"]} {
    bind Listbox <MouseWheel> {
        %W yview s..."
    (file "/usr/lib/tk8.4/listbox.tcl" line 182)
    invoked from within
"source /usr/lib/tk8.4/listbox.tcl"
    (in namespace eval "::" script line 1)
    invoked from within
"namespace eval :: [list source [file join $::tk_library $file.tcl]]"
    (procedure "SourceLibFile" line 2)
    invoked from within
"SourceLibFile listbox"
    (in namespace eval "::tk" script line 4)
    invoked from within
"namespace eval ::tk {
        SourceLibFile button
        SourceLibFile entry
        SourceLibFile listbox
        SourceLibFile menu
        SourceLibFile panedwindow
        SourceLibFile ..."
    invoked from within
"if {$::tk_library ne ""} {
    if {[string equal $tcl_platform(platform) "macintosh"]} {
        proc ::tk::SourceLibFile {file} {
            if {[catch {
                namesp..."
    (file "/usr/lib/tk8.4/tk.tcl" line 401)
    invoked from within
"source /usr/lib/tk8.4/tk.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list source $file]"

This probably means that tk wasn't installed properly.

After a bit of research, it seems that this is Tk bug 2010422, which is the result of a combination of a too-new X version (1.4.2 in my case) and a too-old Tk version (8.4.11-r5). I tried a

pd -nogui

but that crashes the machine with a kernel panic (which can be observed on the serial terminal).

Then, after some weeks, this email from Spencer Russell came:

alrighty, turns out that until recently u-boot didn't correctly set up something, which seems to be what was causing the kernel panic. Upgrading and re-flashing u-boot seems to solve the problem! I'm still not getting any sound with my compile of regular PD, but Hans, your image now works. Lots of underruns, and I'm still getting some errors about "You need to stop the DMA channels before unlinking" with what looks like some sort of non-fatal backtrace output, but I can get a pd patch to put out sound.

see http://elinux.org/BeagleBoardFAQ#NEON_performance for a bit more detail about the problem. You can get a new u-boot from http://www.angstrom-distribution.org/demo/beagleboard/ and look at README.txt for instructions on flashing it to NAND. make sure you change 160000 to 170000 in those instructions, though. u-boot has gotten a bit bigger since they were written.

Hans, do you have a bitbake recipe for PDa? I imagine it should be pretty easy to adapt my PD .bb file to grab/compile the PDa source, but I figure if you've already got one...

I've updated my PD recipe somewhat, I think I'll be starting a public git repo sometime in the near future, but let me know if you want it before. Something's wonky with the way it's accessing the audio hardware, because it thinks /dev/dsp is busy. I haven't really looked into it yet.

-s-

So we got the u-boot.bin from http://www.angstrom-distribution.org/demo/beagleboard/u-boot.bin. We put it on the SD card on which we already had our (self-built) PDa-16MB image as recipeed by Hans. We did not bother to copy over any of the other files again. and according to Spencer's recommendations then followed the http://www.angstrom-distribution.org/demo/beagleboard/README in a slightly adopted way:

mmcinit 
fatload mmc 0 0x80200000 MLO 
nand unlock 
nand ecc hw 
nand erase 0 80000 
nand write 0x80200000 0 80000 
fatload mmc 0 0x80200000 u-boot.bin
nand unlock 
nand ecc sw 
nand erase 80000 170000 
nand write 0x80200000 80000 170000

Note: after the third and fourth line, we had to type 'help' once before being able to proceed, since we got an error message about nand subsystem not being recognized or something like that. Also note that we did nand ecc rather than nandecc.

 

The bad news is that after that, the board would not boot any more.

Document Actions
Florian Hollerweger. Cite/attribute Resource. admin. (2008, November 08). \'Pd anywhere\' on the Beagle Board. Retrieved May 26, 2017, from Florian Hollerweger Web site: http://flo.mur.at/hardware/prap/pd-anywhere-on-the-beagle-board. All Rights Reserved.