[alsa-devel] Please help in adding ams-delta support to ASoC

Janusz Krzysztofik jkrzyszt at tis.icnet.pl
Tue May 26 15:17:23 CEST 2009


I am trying to add sound support for ams-delta omap machine, yet without 
much success.

Three years ago, Mark Underwood created an omap-alsa compatible driver 
that basically worked[1]. It was derieved from similiar driver for aic23 
codec found on omap osk machine. It looks like Mark has never managed to 
finish his work. It's not clear for me if he has found that getting a 
working fullduplex sound is technically impossible on a voice modem 
codec, shared among modem and cpu, controlable only from modem side 
afaik, but I have decided to give it a try.

Since Mark's initial work, omap-alsa framework has been depreciated in 
favour of soc-omap. API changes are so significant that Mark's code is 
rather not useable directly any more. However, I am trying to use it as 
a starting point, by comparing it against it's prototype osk/aic23 code.

Following Mark, I am trying to derieve the new ams-delta sound driver 
from current asoc driver for omap osk9512. For codec part, I decided to 
base my work on much more simple ad73311 rather that tlv320aic23.

Comparing Mark's code agaist it's osk/aic23 prototype, I can see the 
folowing significant changes:
1. rate tables/bitmaps found in hw_constraint_rates, 
snd_omap_alsa_playback and snd_omap_alsa_capture structures limited to 8kHz,
2. hardware related code found in codec_configure_dev(), 
codec_clock_on() and codec_clock_off() callback functions replaced with 
ams-delta hardware specific code that switches the codec DAI pins from 
modem chip to mcbsp cpu interface and back,
3. codec_set_samplerate() and all mixer related functions replaced with 
4. the following McBSP register settings changes:


+	.srgr1 = CLKGDV(0),

+       .srgr2 = GSYNC,

-	.pcr0 = CLKXP | CLKRP,  /* mcbsp: slave */

I have found points 1. to 3. rather trivial to implement in new 
framework. Regarding point 4., it looks like detailed register settings 
are now done inside omap-mcbsp.c, based on machine specified format, so 
I have to find out what format should be specified for ams-delta. Please 
correct me if I am missing something.

There was one more modification in Mark's code, addressing dma chaining 
problem on omap15xx hardware, but as far as I could see, the problem was 
already solved in the asoc omap framework.

Initially, I based my work on ompenembedded provided linux-omap.git 
revision 90e758af52ba803cba233fabee81176d99589f09. The results were 
rather poor - total system hangup after first device access, with no 
single message. So I have switched to linux-2.6.30-rc5 and now I can 
safely access the device, however it does not work as expected. aplay 
and arecord wait forever, cat to/from /dev/dsp breaks with hardware 
error messgae. DMA interrput counters stay at 0. However, codec 
switching that I do from machine->ops->startup/shutdown seems working, 
as modem stops producing any sounds while the alsa device is in use and 
gets back thereafter.

First of all, I'd like to make sure if my problem is related to my code 
only. As I am new in these areas, I would like to ask you if the omap 
asoc framework is stable enough to relay on. If yes, could you please 
look at my dirty code (attached) an give me some hints? I can provide 
you with more information if necessary.


[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ams-delta-sound.patch
Type: text/x-patch
Size: 15354 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20090526/58290253/attachment-0001.patch 

More information about the Alsa-devel mailing list