Archive for the ‘ALSA’ Category

A Second Android UCM

Now there are two. Yes, there are now two different UCM prototypes for Android on Pandaboard. But why?  Well, the first, tinyHAL, came out of conversations with Mark Brown and others, as described in my earlier post.  The second came from later discovering that Gabriel Beddingfield had implemented a similar PoC for Blaze. They are both good starts and both have their pluses, and now both run on Pandaboard with the Linaro Android builds.

The first, tinyHAL is available at here.  The second, android-ucm, is available here.  I have also facilitated the relicensing of the dependencies for android-ucm and deposited them here and here.  Please refer to the README in each of these repositories for the instructions on how to build these components in a Linaro Android build.

So, which one should be used and enhanced? Well, I like the XML mapping from android-ucm, and I like the XML configuration formats from tinyHAL. I suspect that the way forward should be to decide the best features, and then combine, refactor, and merge efforts. For now, try them both and see which one you prefer. As always, contributions are always welcome and feel free to contact me or if you have comments.


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.

Group Photo: ASoC and Embedded Linux Audio Conference

Here is a group photo of the attendees at the ASoC and Embedded Linux Audio Conference in Edinburgh :

ASoC Group Photo

Travel to ASoC and LAC

I’ve been a little busy lately with new assignments and travel. I just returned from two back-to-back conferences, in two different countries, in less than one week.

The first was the ASoC and Embedded Linux Audio Conference in Edinburgh. This was a gathering of about 30-40 multimedia developers from all over the world representing almost every company involved in this space and I was honored to be invited. After introductions, the 2 days worth of in-depth technical discussions got started with a description of the ASoC DSP support, focused on the description and charts shown here ->   We then shifted to OS integration topics that mainly centered around Android’s need for a different ALSA user space lib, with more business favorable license terms. Several options were discussed. The UCM talk was next and with an initial brief overview and then enumerating the needs moving forward, including PulseAudio work. Next were discussions on QoS, run-time coefficients, firmware and events. The meeting drew to a close with a summary, questions time and assignments review. I drew the assignment for looking into getting an install script and  git set up for the UCM profile config files, something we will need for Linaro.  All in all, a great technical conference that was well prepared and useful. Also, it was a fantastic opportunity to meet everyone I have been interacting with in email and IRC, plus many new contacts. I look forward to attending the next one!

The second was the Linux Audio Conference in Dublin, aka, LAC2011. I worked with the planners of this conference to get the PulseAudio folks, including Lennart Poettering,  a place to work. The space we were allocated was large enough to allow others to come and listen and ask a few questions. I want to apologize to the people that waited so patiently to ask questions.  We had such an active discussion between the developers that they could hardly get a word in edge wise. I learned a lot and hopefully contributed to the overall discussion, direction and schedule. The rest of the conference was more general purpose for all things Linux Audio including: sound generation, sequencing, pro audio, and composition. I have followed this for many years now and it was really interesting to see how it continues to evolve. Even though it was a Linux conference, there were constant references to Apple and iPad integration with the applications used, even a session on running PulseAudio on Mac OS X. I think that mobile Linux has an opportunity to reach these folks.

Even though the trip was jam-packed, it was a perfect technical requirements review for going into the next development cycle for Linaro.  They were both worth the hectic travel schedule.

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

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
%d bloggers like this: