Author Topic: ALSA: Audio Compression Offloading, Power Savings  (Read 203 times)

Offline menotu

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 15296
  • ┌∩┐(◕_◕)┌∩┐
ALSA: Audio Compression Offloading, Power Savings
« on: August 30, 2012, 06:29:47 AM »
Posted by Michael Larabel on August 29, 2012

One of the new ALSA features is support for audio compression offloading where the DSP handling of compressed audio formats can be offloaded from the CPU to a DSP, which can be more efficient and lower the CPU usage. The kernel core API for this audio compression offloading was pushed into the Linux 3.3 kernel while with the Linux 3.7 kernel there will be ASoC integration support as well as support for compression offloading with the Intel Medfield audio driver. The ALSA library code for this support is currently in a separate Git tree and not in mainline ALSA at this point.

Jack detection for ALSA has been another hot topic. There isn't any ALSA library API yet for audio jack detection and there's jack detection support being looked at via input device, via a control API, or possibly via extcon.

The Advanced Linux Sound Architecture is also seeing more PCM time adjustments coming, wallclock timestamp support is coming for precise hardware sample times, and there's an open development topic about embedding timestamps in the stream. The embedded timestamps were requested by Video 4 Linux.

Power savings for ALSA and its supported audio kernel drivers is also being expanded upon. The HD audio driver saw power-savings work in the Linux 3.5 kernel while an explicit power-saving trigger by a Linux kernel parameter will come in the Linux 3.7 kernel. Run-time power management integration is also coming to the Linux 3.7 kernel for dynamically turning off the HD audio controller and codec automatically.

http://www.phoronix.com/scan.php?page=news_item&px=MTE3MTQ
PCLinuxOS 32bit KDE 4.10.1; kernel-3.4.11-pclos1.bfs & 64bit 3.2.18bfs; NVidia GeForce 8400GS 1GB 310.19 driver

Sony Vaio SVE1513A4ESI Laptop, Intel Core i5, 2.6GHz, 6GB RAM, 750GB, 15.6" Intel HD Graphics 4000

Offline menotu

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 15296
  • ┌∩┐(◕_◕)┌∩┐
Re: ALSA: Audio Compression Offloading, Power Savings
« Reply #1 on: February 25, 2013, 03:50:15 AM »
Posted by Michael Larabel on February 24, 2013

ALSA's TinyCompress Audio Library Gets A Release

Today marks the first tagged release of TinyCompress, a user-space library that takes advantage of ALSA Compressed APIs that were recently introduced in the mainline Linux kernel. This library allows for feeding compressed data like MP3 files directly to ALSA compressed audio devices. This allows for offloading more of the audio playback process to supported audio hardware. There's also additional information on this ALSA audio compression API within the Linux kernel source tree at Documentation/sound/alsa/compress_offload.txt:

    Since its early days, the ALSA API was defined with PCM support or constant bitrates payloads such as IEC61937 in mind. Arguments and returned values in frames are the norm, making it a challenge to extend the existing API to compressed data streams.

    In recent years, audio digital signal processors (DSP) were integrated in system-on-chip designs, and DSPs are also integrated in audio codecs. Processing compressed data on such DSPs results in a dramatic reduction of power consumption compared to host-based processing. Support for such hardware has not been very good in Linux, mostly because of a lack of a generic API available in the mainline kernel.

    Rather than requiring a compatibility break with an API change of the ALSA PCM interface, a new 'Compressed Data' API is introduced to provide a control and data-streaming interface for audio DSPs.

    The design of this API was inspired by the 2-year experience with the Intel Moorestown SOC, with many corrections required to upstream the API in the mainline kernel instead of the staging tree and make it usable by others.


TinyCompress is a project that's been in development for nearly one year and today saw its v0.1.0 release.

TinyCompress is a user-space library for taking advantage of this compressed API. Also included with TinyCompress is a sample command-line player showing how MP3 files can be fed to this audio compression kernel API. The work is dual-licensed under the LGPL and BSD.

TinyCompress was written by a developer at Intel. While it's too bad that sending compressed audio data won't work over the existing ALSA kernel APIs, it's nice that there's TinyCompress as a sample library implementation.

http://www.phoronix.com/scan.php?page=news_item&px=MTMxMTQ
PCLinuxOS 32bit KDE 4.10.1; kernel-3.4.11-pclos1.bfs & 64bit 3.2.18bfs; NVidia GeForce 8400GS 1GB 310.19 driver

Sony Vaio SVE1513A4ESI Laptop, Intel Core i5, 2.6GHz, 6GB RAM, 750GB, 15.6" Intel HD Graphics 4000