From: Takashi Iwai Subject: Re: [RFC] ALSA SoC layer Date: Thu, 10 Nov 2005 11:57:34 +0100 Message-ID: References: <1131618567.14631.155.camel@cearnarfon> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mx2.suse.de (ns2.suse.de [195.135.220.15]) by alsa.jcu.cz (ALSA's E-mail Delivery System) with ESMTP id 85FAB1AB for ; Thu, 10 Nov 2005 11:57:43 +0100 (MET) In-Reply-To: <1131618567.14631.155.camel@cearnarfon> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Liam Girdwood Cc: alsa-devel@alsa-project.org, Richard Purdie List-Id: alsa-devel@alsa-project.org At Thu, 10 Nov 2005 10:29:27 +0000, Liam Girdwood wrote: > > I'd like to announce and gather some feedback from the community wrt a > project that Richard Purdie and I have been working on lately. > > The overall project goal of the ALSA System on Chip (ASoC) layer is to > provide better ALSA support for embedded system on chip procesors (e.g. > pxa2xx, au1x00, iMX, etc) and portable audio codecs. Currently there is > some support in the kernel for SoC audio, however IMO it has some > limitations:- > > o Currently, codec drivers are often tightly coupled to the underlying > SoC cpu. This is not ideal and leads to code duplication i.e. Linux now > has 4 different wm8731 drivers for 4 different SoC platforms. > > o There is no standard method to signal user initiated audio events. > e.g. Headphone/Mic insertion, Headphone/Mic detection after an insertion > event. These are quite common events on portable devices and often > require machine specific code to re route audio, enable amps etc after > such an event. > > o Current drivers tend to power up the entire codec when playing (or > recording) audio. This is fine for a PC, but tends to waste a lot of > power on portable devices. There is also no support for saving power via > changing codec oversampling rates, bias currents, etc. All agreed. The second and the thirt points are valid for the normal laptops, too. About the third point, I've been thinking of adding a switch (maybe via control API), to select the power-save behavior. > > The ASoC layer is designed to address these issues and provide the > following features :- > > o Codec independence. Allows reuse of codec drivers on other platforms > and machines. > > o Easy I2S/PCM audio interface setup between codec and SoC. Each SoC > interface and codec registers it's audio interface capabilities with the > core and are subsequently matched and configured when the application hw > params are known. > > o Codec Dynamic Power Management (DPM). DPM automatically sets the > codec to it's minimum power state at all times. This includes powering > up/down internal power blocks depending on the internal codec audio > routing and any active streams. > > o Pop and click reduction. Pops and clicks can be reduced by powering > the codec up/down in the correct sequence (including using digital > mute). ASoC signals the codec when to change power states. > > o Machine specific controls: Allow machines to add specific controls to > the sound card e.g. volume control for machine speaker amp. > > > To achieve all this, ASoC basically splits an embedded audio system into > 3 components :- > > o Codec driver: The codec driver is platform independent and contains > audio controls, audio interface capabilities, codec dpm definition and > codec IO functions. > > o Platform driver: The platform driver contains the audio dma engine > and audio interface drivers (e.g. I2S, AC97, PCM) for that platform. > > o Machine driver: The machine driver handles any machine specific > controls and audio events. i.e. turning on an amp at start of playback. > > > ASoC is still very much work in progress and currently the only > supported platform is the pxa2xx. Support for other platforms will > follow soon with the iMX and au1x00 SoC's (as I have both boards). SoC can superseed the existing drivers, right? > Atm, codec drivers exist for:- > > o WM8753 > o WM8731 > o WM8750 > o WM8971 > o WM9713 (voice interface) > o AC97 codec (supported via ac97_codec.c) > > and in progress:- > > o UDA1380 > o WM8772 > > The current ASoC snapshot (version 0.6) is available at > http://rpsys.net/openzaurus/patches/alsa/alsa-soc-0.6.patch > > New snapshots will be released weekly. The project will also shortly > have an online git repository and web page for easier community > collaboration. At a quick glance, the code looks promising. Very minor nitpicks: - case is usually not indented in switch() in kernel codes (althought not written explicitly in CodingStyle). - *_add_widgets() can be optimized with an array. - documentation is missing ;) How is the planned schedule? I'll merge my big patches to replace xxx_t with struct xxx likely in the next week just after releasing ALSA 1.0.10-final. Although the backward compatibility will be kept mostly, the code rewriting (just running sed or whatever) will be done after that. Takashi ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php