[alsa-devel] iMX6 ESAI TDM with underrun and overrun support

Aurelien Bouin a_bouin at yahoo.fr
Thu Dec 18 10:00:43 CET 2014


Hi Nicolin,


Le Jeudi 18 décembre 2014 0h36, Nicolin Chen <nicoleotsuka at gmail.com> a écrit :
>Hi Aurelien,
>
>
>On Wed, Dec 17, 2014 at 02:04:25PM -0200, Fabio Estevam wrote:
>> On Wed, Dec 17, 2014 at 1:13 PM, Aurelien Bouin <a_bouin at yahoo.fr> wrote:
>> > Hello,
>> > I am currently working on an iMX6 board, I work with the master branch
>> > of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
>> > I have seen some problems in the freescale ESAI implementation :
>> >
>> > 1.The registers TCCR and RCCR have TFP and RFP bits in register of a width
>> > of 5, not 4 !
>> > With a value of 5 we are able to use the full range of slots (32)
>> > Patch : http://pastebin.com/Ai1RZ9mE
>
>
>Only the width of xDC fields is incorrect as Fabio said.>
You are right ... only the xDC fields is incorrect ... 
>
>Please send your revised patch to alsa-maillist, CC me and Mark.

>(It'd be better to use ./scripts/get_maintainer.pl to get info)

I will send you a formated patch
Do you mean that I have to CC the patch to all the maintainers ?

>
>

>I'll wait for you patch; Otherwise, I can fix it this weekend.
>
>
>> > 2.The channels number are limited in Playback to 12, but actually we can
>> > rise 128, in Capture it is limited to 8 but actually we can rise 128 also
>> >
>> > Patch : http://pastebin.com/SHk5eHPa
>
>
>The limitation was applied because of the number of transmitters
>and receivers. TDM looks a bit a special case to me. So I
>personally encourage you to first apply the change it to your

>own code.>
>
>The other reason is that actually network mode only supports
>slots up to 32. So I don't get why you can make it happen to

>128.....
Yes and No.
It supports up to 32 words (slots) per period on each transmit line, in the limit of 128 words (FIFO limitations)
My reference is in the Reference Manual of the iMX6 "26.1.1 Features" in the ESAI chapter

FYI in the fsl_esai.c you can find how multiples lines and slots are handled : 
-> fsl_esai_hw_params : u32 pins = DIV_ROUND_UP(channels, esai_priv->slots);
Then it will enable the number of hardware pins used in transmit and receive mode with TFCR or RFCR :
val = ESAI_xFCR_xWA(width) | ESAI_xFCR_xFWM(esai_priv->fifo_depth) |
(tx ? ESAI_xFCR_TE(pins) | ESAI_xFCR_TIEN : ESAI_xFCR_RE(pins));



I first apply the patch on my kernel I am currently using 64 channels (32 slots of 8bits width on 2 transmits pins)

But for example you can use up to 6 transmits pins with a configuration of 2 slots of 16 bits width and 12 channels ask in alsa ...
>
>
>> > I use the iMX6 ESAI bus to send audio datas to other processors ... but
>> > actually I don't have any codec behind ...
>> > I am wondering if there is any solution with the devicetree to implementing
>> > such configuration with "simple-audio-card"
>> >
>> > Because for the moment I have not find another solution than doing a module
>> > : http://pastebin.com/cnGwnEjn
>> >
>> > I also see that the chip errata of the iMX6 ERR008000 is not handle ...
>> > Which make channel swapping on my ESAI bus ...
>> > Is there someone that succeed in implementing the underrun overrun catch ?
>> the esai driver?
>
>
>
>
>I think you may like to try the newer official BSP release from
>Freescale. I remember the fix is included and the fix is hard
>to merge into the Linux mainline because it hacks some common
>interfaces inside ASoC.
>
>

>http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git
I already tried the branches :
imx_3.10.31_1.1.0_alpha
imx_3.10.31_1.1.0_beta2
They implemented a fsl_reset function somewhere ... but it is never called ... and the problem persist ...
FYI I have posted something about the problem also on the IMX Community you can see some capture of the problem : 
https://community.freescale.com/message/463492#463492
It is easy to reproduce just take some cpu :
while true;do true; done
>
>

>Nicolin Chen


Thank you very much for your help,

Regards,
Aurelien BOUIN


More information about the Alsa-devel mailing list