Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Roberto Fichera <kernel@tekno-soft.it>
To: Caleb Crome <caleb@crome.org>
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Shengjiu Wang <shengjiu.wang@freescale.com>,
	Nicolin Chen <nicoleotsuka@gmail.com>,
	"arnaud.mouiche@invoxia.com" <arnaud.mouiche@invoxia.com>,
	Markus Pargmann <mpa@pengutronix.de>,
	"shawn.guo@linaro.org" <shawn.guo@linaro.org>,
	Fabio Estevam <festevam@gmail.com>
Subject: Re: fsl_ssi.c: Roberto's problem: ssi hangs after some number of samples
Date: Tue, 3 Nov 2015 09:21:05 +0100	[thread overview]
Message-ID: <56386E71.4070403@tekno-soft.it> (raw)
In-Reply-To: <CAG5mAdzB52323JCvrOPj1Dr0zg4-SJM7gw-qmtqp1QZAEr5+yg@mail.gmail.com>

On 11/03/2015 01:56 AM, Caleb Crome wrote:
> On Mon, Nov 2, 2015 at 10:03 AM, Roberto Fichera <kernel@tekno-soft.it> wrote:
>> On 11/02/2015 06:51 PM, Roberto Fichera wrote:
>>>>>>> Overall, I don't see an obvious defect from you SSI side, but you
>>>>>>> may also try to toggle TDMAE and RDMAE at the point that callback
>>>>>>> stops -- re-raise the DMA requests by disabling and enabling TDMAE
>>>>>>> and RDMAE again and see if it works. I think either something did
>>>>>>> intervene register controls of SDMA or SSI,
>>>>> I will try this one.
>>> I will go over this tomorrow morning.
>>>
>> I've tried it just now but doesn't work at all! I'm getting only 2 sdma transfers.
> Heh, now I'm getting perhaps a similar issue -- transfers just stop
> for no good reason.
>
> I can use aplay all day long, and the transfers work great.  Even
> arecord + aplay together seem to work fine.
>
> However, when I use my portaudio based ramp checker, it runs from
> between 1 frame and several thousand, then the callbacks stop.  I
> don't know if this is a portaudio problem or an alsa problem -- i
> don't think I've seen the issue outside portaudio.
>
> Jackd seems to run okay too (I'm running an overnight full duplex test now).
>
> roberto, what user space library are you using?  Alsa directly, or
> portaudio, or something else? 

All is in kernel space, and as I've already said it's dahdi driver for a voip app.
The starting point I've used is fsl_ssi.c. I've removed most of the code not
related to TDM. Then I've added my dma support to move samples from TDM
to a dahdi audio sample buffer.
So it's supposed to be a very skinny TDM driver for SSI in normal and synch
mode.

> it looks like your data rate is quite
> manageable, right?  8kHz, 8 slots, 8 bits?  For me, it's a little
> better at 16kHz than 48kHz, but still just quits working after a
> while.

BCLK@2048KHz, FSYNC@8KHz, 32 slots at 8 bits but I'm masking all
except the first 2 I need.

> What's your experience of play vs. record, vs. full duplex?

Channels should be full duplex, and the samples has to go in dahdi buffer
finally used by asterisk as audio channel.

I'm currently thinking if would be better to write my driver as plain audio codec.
This means that I'll have to write my dahdi driver on top of either PCM or SND
framework, all within kernel space. But I guess this will over-complicate the things
compared to a straight TDM byte sequence, considering also that I'll have to
learn the sound API.

>
>
> -Caleb
>

  reply	other threads:[~2015-11-03  8:21 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-30 18:01 fsl_ssi.c: Roberto's problem: ssi hangs after some number of samples Caleb Crome
2015-10-31  9:16 ` Roberto Fichera
2015-11-01 20:31   ` Fabio Estevam
2015-11-02  9:57     ` Roberto Fichera
2015-11-02 17:51   ` Roberto Fichera
2015-11-02 18:03     ` Roberto Fichera
2015-11-03  0:56       ` Caleb Crome
2015-11-03  8:21         ` Roberto Fichera [this message]
2015-11-03 21:26   ` Caleb Crome
2015-11-04 15:33     ` Roberto Fichera
2015-11-04 16:53       ` Roberto Fichera
2015-11-04 17:41         ` Caleb Crome
2015-11-04 17:52           ` Roberto Fichera
2015-11-04 18:11             ` Nicolin Chen
2015-11-04 21:47               ` Roberto Fichera
2015-11-05 10:03               ` Roberto Fichera
2015-11-05 11:30                 ` Fabio Estevam
2015-11-05 11:48                   ` Roberto Fichera
2015-11-04 17:58       ` Nicolin Chen
2015-11-04 18:09         ` Roberto Fichera
2015-11-04 18:18           ` Nicolin Chen
2015-11-04 21:48             ` Roberto Fichera
  -- strict thread matches above, loose matches on Subject: below --
2015-11-05 21:34 Caleb Crome
2015-11-05 22:08 ` Roberto Fichera
2015-11-05 22:25   ` Caleb Crome
2015-11-05 22:40     ` Roberto Fichera
2015-11-05 22:49       ` Caleb Crome
2015-11-05 23:01         ` Roberto Fichera
2015-11-05 23:21           ` Caleb Crome
2015-11-05 23:28             ` Roberto Fichera
2015-11-05 23:30               ` Caleb Crome
2015-11-05 23:46                 ` Roberto Fichera
2015-11-06  0:35                   ` Caleb Crome

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56386E71.4070403@tekno-soft.it \
    --to=kernel@tekno-soft.it \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnaud.mouiche@invoxia.com \
    --cc=caleb@crome.org \
    --cc=fabio.estevam@freescale.com \
    --cc=festevam@gmail.com \
    --cc=mpa@pengutronix.de \
    --cc=nicoleotsuka@gmail.com \
    --cc=shawn.guo@linaro.org \
    --cc=shengjiu.wang@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox