Archive for the ‘Ubuntu’ Category

UCM for Android

March 23, 2012 Leave a comment

Following the ASoC Embedded ALSA Conference and the Linaro Multimedia Summit last year, I put plans in place to bring UCM to Linaro for both the Ubuntu-based builds and the Android builds.  We are seeing that happen.  UCM functionality is improving in Ubuntu and now is coming to Android.  Based on the initial drop of tinyhal by Mark Brown, I now have a prototype running on Pandaboard.  This code should be viewed as a proof-of-concept framework for UCM, not a complete fully-functioning implementation.  The code supports basic playback and will need to be enhanced for a full dynamic verb set.  I have created a git repository for my work here.

To give it a try, you will need to follow the Linaro Android instructions for building from source, which I recently blogged here.  Follow the README instructions for copying files to their needed locations.  You can test playback with tinyplay or the Android music player app.  The configuration file sets the initial volume, but the Android settings work normally for adjusting this level.

The remaining needed work will continue over the next several weeks, adding support for other mixing and routes.  I am also looking to unify the file formats between Ubuntu and Android.  Stay tuned for that proposal.  As always, contributions are welcome.


Setting up an Android Build

February 13, 2012 Leave a comment

Yes, it has been too long since I blogged, I won’t bore you with the details of why.  Instead, I’ll kick this off again with a step-by-step post on how to set up a system to do your first Android build.

Linaro has a great new Android homepage with lots of useful links on it, go explore the info there

I did my installation on Ubuntu 11.10 Oneiric, so this post will make the most sense if you do too.  Put away that P3 box in the corner you were planning on using.  It seems to be a wise requirement to use a quick box with x86_64 support. You will also need ~30G of free space on your drive an a good amount of memory, plan for it. So, go do your AMD64 install of Ubuntu Oneiric desktop and then come back.

The AOSP “Initializing a Build Environment” page is your next stop. It is slightly out of date, but work through it  Under the “Installing required packages” section, there is a package change for Oneiric. The package lib32readline5-dev is not available, use lib32readline-gplv2-dev instead.

Next, go get repo.  To do this, follow the first 3 steps under the Quickstart section at  Wait on running the repo init command for now.

Install gcc-4.5. I used software center, and uninstalled 4.6 first. You may not have to do this as it may have caused me some extra fun for me. Regardless, when you have it installed, make sure that you have /usr/bin/cc and /usr/bin/gcc symlinked to gcc-4.5, not 4.6.

I also experienced a problem that was well documented here:  As this post suggests, running “sudo ln -s /usr/include/`uname -m`-linux-gnu/asm/ /usr/include/asm” fixed the problem.

Now it is time to decide on the code to build.  I was interested in reproducing the 12.01 Linaro Android “tracking” build because it had the patches needed to make audio work on the Pandaboard. The best way to do this is to follow the “How to Get and Build the Source” on the page for the build you are interested in, in my case,  If you follow this exactly (with any changes for your environment, of course), you shouldn’t have any problems. Also, I hope you aren’t in a hurry. The repo sync alone will take over an hour unless you have a super fast connection and the build will depend on your host, but mine takes a good long time.

When the build is complete, check the build log in the root directory to make sure there wasn’t any issues. To use the build you just made, refer to the instructions “How to Use Prebuilt Images” on the same Linaro Build page you used in the step above. The boot, system and userdata compressed tarballs are available in the ~/android/out/target/product/<board> directory. Substitute <board> with your dev platform, in my case that was “pandaboard”. Blast these onto a SD card just like you’d do with the prebuilt images and you’ll be up an running on your own Android build.

That’s all there is to it. Hope this helps, I tried to capture everything that I went through to get it working. Please let me know if you find any omissions or problems so that I can edit this post with any corrections.

PulseAudio Configuration

March 29, 2011 Leave a comment

The best way to learn code is to work on it. I did just that implementing a feature to add tsched buffer size to the configuration file. Late in the process, I discovered that it was already possible to pass it to the ALSA module, so I abandoned the additional code. Since it stumped me, I figured the configuration of PulseAudio might be somewhat confusing and could use a blog entry, hence this.

First, if you have not yet read PerfectSetup, start with that.  You can find it here:

There are 3 places to change the configuration parameters and behavior of PulseAudio. – startup script to specify module loading, etc, module parameters are passed here, more on that later

client.conf – does just what is says, config file for clients

daemon.conf – configuration specific to the sound server daemon

On Ubuntu, these files are installed in /etc/pulse. The startup script is used when PulseAudio is used in system-wide mode. The other, daemon.conf is used when the sound server is started in user mode.

The values listed in these files are default values and are commented out. Obviously, uncommenting the parameter will not change anything unless the assignment is value changed.

The startup script can be used to pass module specific parameters. This is done by uncommenting the line in the file. For example, passing a new tsched buffer size to the ALSA module would look like this:

load-module module-alsa-sink tsched_buffer_size=XYZ

Here are all the module specific parameters for the ALSA module (from module-alsa-card.c) :

“name=<name for the card/sink/source, to be prefixed> ”
“card_name=<name for the card> ”
“card_properties=<properties for the card> ”
“sink_name=<name for the sink> ”
“sink_properties=<properties for the sink> ”
“source_name=<name for the source> ”
“source_properties=<properties for the source> ”
“namereg_fail=<pa_namereg_register() fail parameter value> ”
“device_id=<ALSA card index> ”
“format=<sample format> ”
“rate=<sample rate> ”
“fragments=<number of fragments> ”
“fragment_size=<fragment size> ”
“mmap=<enable memory mapping?> ”
“tsched=<enable system timer based scheduling mode?> ”
“tsched_buffer_size=<buffer size when using timer based scheduling> ”
“tsched_buffer_watermark=<lower fill watermark> ”
“profile=<profile name> ”
“ignore_dB=<ignore dB information from the device?> ”
“sync_volume=<syncronize sw and hw voluchanges in IO-thread?> ”
“profile_set=<profile set configuration file> “

PulseAudio Buffer Size Tests

March 7, 2011 2 comments

It has been a few weeks, but in my defense, I have been pretty busy testing and debugging in this new environment. As an assignee to the Linaro project, my first task was to figure out if increasing the buffer size would enable the ARM cpu to drop into a lower power state. Code investigation, community feedback and prototyping said probably not, but I followed through. Below is a chart showing all the testing done, including the recent work to go back through the tests with ALSA 1.0.24 in the stack to enable checking for  period disable. Enjoy!

PulseAudio Buffer Size Tests

PulseAudio Buffer Size Tests

Ubuntu on PandaBoard

January 26, 2011 Leave a comment
My PandaBoard

My PandaBoard

My PandaBoard still has not yet arrived, but I was able to get a loaner to explore buffers in PulseAudio.  Since it is not mine, I have not mounted it on it’s own fancy custom mounting base platform (cardboard) like I did with my BeagleBoard.  But, the Panda arrives with it’s own fancy little rubber feet that work fine as standoffs. Here’s what it looks like all hooked up.

Once I figured out where to get an Ubuntu image for it, it was pretty easy to get it up and running.  All you have to do is go to the website below and follow the instructions. You will get the Ubuntu Netbook 10.10 image and then write the raw image to a SD card. Simple.

Follow the instructions at

I did have lots of trouble getting the ubuntu-omap4-extras installed. I could never get the graphical method to work properly, but I did follow the comand line method further down the page on the website listed below and finally got it to install.

Follow the command line installation instructions at:

And finally, for help in many areas not covered here, if you have not already, read all you can at:

Categories: PandaBoard, Ubuntu Tags: , ,
%d bloggers like this: