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: http://www.pulseaudio.org/wiki/PerfectSetup

There are 3 places to change the configuration parameters and behavior of PulseAudio.

system.pa/default.pa – 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 system.pa 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 https://wiki.ubuntu.com/ARM/OMAPMaverickInstall

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: http://www.omappedia.org/wiki/PandaBoard_Ubuntu_PPA

And finally, for help in many areas not covered here, if you have not already, read all you can at: http://www.omappedia.org/wiki/Main_Page

Categories: PandaBoard, Ubuntu Tags: , ,

Building PulseAudio

January 6, 2011 Leave a comment

Here are (now improved) quick instructions to create a working build sandbox for PulseAudio development on Ubuntu 10.10 Maverick on an i386 platform. I highly recommend reading all this post completely before starting this process.

Here are the steps to make PulseAudio that builds and works for Ubuntu:

  1. Install or update to Maverick and accept defaults, this process will probably work fine with other Ubuntu versions, so if you are not on Maverick, give it a try.
  2. Update all packages with Update Manager
  3. Install dpkg-dev -> sudo apt-get install dpkg-dev

If you are using source from git:

  1. Install git if you haven’t already -> sudo apt-get install git
  2. From your home directory, get the latest PulseAudio source -> git clone git://git.0pointer.de/pulseaudio.git
  3. Git will create the PulseAudio repository in a directory called pulseaudio, when the clone has completed, change to that directory -> cd ~/pulseaudio

If you are using Ubuntu maverick source:

  1. Install the source -> apt-get source pulseaudio

Configure and build the source:

  1. Install the prereq packages -> sudo apt-get build-dep pulseaudio
  2. To check the environment and set up the basics, run the bootstrap script -> ./bootstrap.sh
  3. Next, run configure -> ./configure
  4. Run make to build the executables

Note: the executables will be in the src directory. Change to that directory and run specifying that path so that you will not run the system programs. For example, to run pulseaudio with verbose log messages, cd to src and run -> ./pulseaudio -n -F ./default.pa -p ./.libs -vvvv

There are some very helpful hints at: http://colin.guthr.ie/2010/09/compiling-and-running-pulseaudio-from-git/ The steps on this page are slightly different for Ubuntu, but worth reading to better understand the process.  Also, this page does a really nice job of explaining how to run pulseaudio for test/debug.

Sound: BeagleBoard C4

December 31, 2010 Leave a comment

Here are my notes from the experimental process of learning how to get sound out of a Linaro image (Headless, ALIP, Netbook) and a BeagleBoard.

  • Plug amplified speakers into the 1/8″ jack closest to the s-video port – they must be amplified, signal is line level only
  • ALSA – Playback hardware devices:
    • card0: omap3beagle
    • device0: TWL4030
    • No regular simple controls like “Master” defined for BeagleBoard
  • Sounds installed in /usr/share/sounds
  • Test with aplay
  • By default, all sound outputs for ALSA are set to 0 and/or muted
  • Configure with alsamixer
    • Unmute HeadsetL and HeadsetR, turn volume up for “DAC2 Analog” ~50 and “DAC2 Digital Fine” ~50-75, and “Headset” to ~ 67 for best results, these are the only controls that change line-level output via the onboard jack
    • All controls listed must be turned up or no level is present at the jack
  • Pulseaudio – Successful playback of .wav with paplay, one dropout, quality fairly good


December 30, 2010 Leave a comment
My BeagleBoard

My BeagleBoard

It has begun! I officially started full-time on December 1st, and then shortly after went on vacation. I had started part-time around mid-November getting acquainted with everyone on the project and ordering my first development board. I ordered a BeagleBoard rev. C4 to get started. I quickly discovered that plugging and unplugging all the cables put them under a lot of stress, so, I created a very high-tech way of mounting the BeagleBoard with strain-relief cable ties on the serial plug. Yes, that is a double layer of cardboard with anti-stat foam under the board. Laugh all you want, it is light-weight, sturdy and very inexpensive. Here it is, isn’t it cute?

Categories: Linaro Sound Tags: ,

About this blog…

December 30, 2010 Leave a comment

This site is to publish information and document my experiences with Linux sound development. I have a long background with Linux and have experimented with digital audio and pro-audio workstation environments for many years. I am now blessed with the opportunity to work closely with the Linux sound stack as a part of my job.

Categories: Uncategorized
%d bloggers like this: