DSP on Beagleboard running Android

We finally managed to get a simple DSP task node running on our Beagleboard using Android. The sources were taken from felipec’s dsp-dummy at github. Many thanks for sharing this!

In this post we will provide you with a step by step guide for doing the exact same thing:

1. Get the dsp-dummy sources aswell as a C6x compiler and doffbuild tools. Make sure that you get the latest dsp-dummy sources by downloading them with git (the provided ZIP and TAR files may contain older versions)

git clone git://github.com/felipec/dsp-dummy.git

The C6x Compiler for the DSP can be downloaded from Texas Instruments . We have been using the linux version of C6000 Code Generation Tools v6.1.12. Preferably install to /opt/dsptools

Doffbuild tools are downloaded through

git clone git://gitorious.org/ti-dspbridge/userspace.git

You will end up with three subfolders called binaries, documents and source. Doffbuild tools are located in ./source/dsp/bdsptools/packages/ti/dspbridge/dsp/doffbuild. Copy the doffbuild folder to /opt/doffbuild or anywhere you like.

2. Now that we have all needed sources and programs, we will build the ARM and DSP side applications (you may notice that we only build the DSP side though 🙂 ). Change to the dsp-dummy folder previously downloaded and issue

of course, you will have to adapt CROSS_COMPILE to whatever cross-compiler you are using. If everything went well, there will be two important files created, namely ‘dummy.dll64P’ for DSP-side, and ‘dummy’ for ARM-side. Copy dummy.dll64P to /lib/dsp on the android filesystem. If you try to run dummy on Android, you will end up with an error
dummy: not found

But dont panic, continue with step 3!
(or alternatively, set LDFLAGS to -static in the Makefile, and jump over to step 4… Oh no, now I spoiled everything! 😀 )

3. Now we will build the dummy userspace application especially for Android. In the Android sources, create a new folder under external/dsp-dummy

mkdir /external/dsp-dummy

Copy and paste everything from the dsp-dummy source folder into it. Also create an Android.mk file in that new folder containing the following lines

Now source envsetup.sh followed by choosecombo, to set all environment variables and dependecies

. build/envsetup.sh
choosecombo

… and finally we create the dsp-dummy for Android …

mmm external/dsp-dummy/

If everything went well, you will find dsp-dummy in ./out/target/product/generic/system/bin/dsp-dummy. Copy this to the target file system.

4. In this step we will load a base image onto the DSP. We used to have DSP Bridge Driver statically included in the android omap.git kernel. One would normally load a base image with a DSP/BIOS Bridge Driver utility called ‘exec’ (sometimes called exec.out). However, until now we couldn’t get exec working on android so we will do this in a slightly different way. One can also load a DSP base image when inserting the bridgedriver.ko module into the kernel, and this is exactly what we’ll do!

First of all run

make menuconfig

inside the kernel folder. Go to device drivers, and in the bottom you will find DSP Bridge driver. Press M to modularize it. Now you can try to build the modules with

make -j4 modules CROSS_COMPILE=<path to crosscompiler> CC_PATH=<path to crosscompiler>

However, the bridgedriver module will not succeed. We have to modify a source file in the kernel (this is probably not nice!)

gedit ./kernel/fork.c

and add the following on line 161; just after the function void __put_task_struct(struct task_struct *tsk) ends.

EXPORT_SYMBOL(__put_task_struct);

Now you can build the modules! As a result, you’ll get dspbridge.ko and bridgedriver.ko. Copy these two to the Beagleboard. We will load the dspbridge.ko module using insmod, and also load the bridgedriver.ko with an additional paramter specifying the location of a DSP base image.

For the base image we use the provided dynbase_tiomap3430.dof64P, which can be found in the binaries subfolder from step 1 of this guide. Do you still remember? Therefore copy dynbase_tiomap3430.dof64P to the target filesystem and issue the command above.

5. Now you can finally run the dsp-dummy application on Android Beagleboard, what a relief!

24 Replies to “DSP on Beagleboard running Android”

Great Job…
Could you please let me know the steps followed to make the DSPBridge up on Android for Beageboard.
1. I took the Omap kernel and put in Android/Kernel folder
2. I tried make menuconfig with DSP bridge option , and the modules are compiled successfully.
3. I built android with make -j, and build stuck in external/jpeg folder and the out/target/* files are updated.
4. I replace uImage in my exisiting SD card to boot android(I am succesfully running android with the downloaded images from embunix )
5.I am getting kernel panic error
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum … OK
Loading Kernel Image … OK
OK

Starting kernel …

Uncompressing Linux…………………………………………………………………………………………………… done, booting the kernel.
and I’m stuck up in kernel panick.
Please guide me as to how i can proceed.
Thanks and Regards
Aparna

You will not have to change your uImage (keep the Embinux one). With the make command you will build the modules used for dspbridge.
I can’t exactly recall where they are put after compilation but you can search for them by issuing command

@Aparna
Hello Aparna,
we have not tried using dspbridge with the embinux kernel image, so we are not sure if it will work. Instead we have been using the official android omap.git kernel. It is also these kernel sources we are refering to in step 4 of the above post. You can use our config file from this post to compile that kernel. If everything works fine, you’ll get a new uImage to put on your SD card.

Thanks for the reply..
I’ve tried integrating the dspbridge with the kernel from android omap.git kernel. official site.
It’s running successfully But the keyboard and mouse doest get detected….!
Now I’m using the images from embinux So.. any help for this kernel would be highly appreciated….

@Aparna
Hello again
where did you plugin your mouse and keyboard? With the said android omap.git kernel, the normal usb host connector will not work. You need to plugin a USB hub to the USB OTG connector (“the mini socket”). And then plugin all peripherals to this hub. Also, if I remember correctly, the USB hub needs an external power source.

By the way, I dont want to discourage you or anybody else at all to use dspbridge, however we recently had more success using DSP/BIOS Link. There is a good guide on the ossie project site. I will also make a new post for running dsplink with detailed instructions in the next few days.

Unfortunately, we dont have much experience using the embinux kernel images. Have you ever tried “make menuconfig” in the kernel sources, and then look for an option that may enable dspbridge? Im sorry I cant be of any more help to you…

@ Andreas ,
Please help me to solve this problem. I followed all the steps mentioned in STEP-4. But I failed to build dspbridge.ko modules. Please help me to solve this problem. My email address is : tapascst@gmail.com.

Hey guys…I’m on my final year project …I’m thinking of doing a digital filter using Beagle Board and Android…Well I downloaded few files 0xkernel-beagle.bin,uImage.bin, android-beagle.ubi..from Oxdriod site..and my beagle board is set up as said ..but I’m having no idea at all about programming the DSP.Can u guys pls tell me what tools i need to program the DSP..and how to set it up…pls?..thanx,,,

@Aparna
hello Aparna
I want to know how to do ? image from android omap.git kernel or embinux kernel image?
I get error the same to you ! I don’t known how to do . thanks .my email is yezhij2008@sohu.com,I hope you can help me!