Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Fernandes <joelf-l0cyMroinI0@public.gmane.org>
To: Mike Looijmans <mike.looijmans-Oq418RWZeHk@public.gmane.org>
Cc: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Query on Audio DMA using DMAEngine
Date: Wed, 3 Jul 2013 14:56:27 -0500	[thread overview]
Message-ID: <51D481EB.5030902@ti.com> (raw)
In-Reply-To: <51D4245F.8070307-Oq418RWZeHk@public.gmane.org>

Hi Mike,

On 07/03/2013 08:17 AM, Mike Looijmans wrote:
> On 07/03/2013 11:43 AM, Mark Brown wrote:
>> On Wed, Jul 03, 2013 at 11:09:22AM +0200, Lars-Peter Clausen wrote:
>>> On 07/02/2013 02:13 PM, Mark Brown wrote:
>>
>>>> This sort of cyclic thing tends to be best, ideally you don't need
>>>> interrupts at all (other than a timer).
>>
>>> Yes, this is usually how it is done. But I'm wondering maybe the EDMA
>>> controller only has a small total amount of slots available.
>>
>> Well, you don't need particularly many slots so long as you can cope
>> with a large period size.
> 
> On the OMAP L138, there are 128 PARAM slots. 32 of those are tied to hardware
> events (though you can use them if you aren't using the related hardware, for
> example the UART drivers don't use DMA so you can freely use those slots if you
> want), leaving (at least) 96 PARAM slots free. Both audio events are on the same
> controller, so you can't use the 128 of the other one (the OMAP has 2 EDMA
> controllers). Only a few dozen of those are being used by various drivers, the
> SD card driver being the most hungry.
> For the system to work, you can even get away with only using one slot, and
> hence one period, but then you'll have to use a mmap and a timer to fill it.
> 
> I experimented with various memory layouts. For large transfers, using 2 big
> periods was quite enough. I also tested with very small period sizes. Using the

Wouldn't very small periods take up too many interrupts, and also occupy lots of
slots?

> original code, I was unable to reliably capture (to /dev/null) at period sizes
> below 80 samples. With the cyclic DMA, I could set a period size of only 40
> samples and still be able to record audio reliably, when using only 8 periods.
> The same for playback, basically. So that's how I arrived at the MAX_PERIODS
> define of "8". It will only claim channels when you use them, so setting it to
> say "100" will not crash the system.

Thanks for your post Mike. It makes more sense to me now.
Correct me if I'm wrong but:
- more the periods, more the granularity- but the drawback is you'd need more
slots and too many interrupts; so we want fewer periods as many as we need. I
still don't know though, how do we arrive at an acceptable number that userspace
expects?
- periods also will determine buffer size. Considering in future if we'd want to
use IRAM as the buffer which is limited on some users of the davinci-pcm, there
might not be enough buffer space.

So too many periods is certainly not a good thing. I wonder how we can arrive at
what would constitute an acceptable number? As Linus said, "we never break
userspace :P" so I'd rather not change anything that breaks someone's audio
application.

I will post some RFC notes soon capture our discussion and other ideas I had put
together for EDMA as some notes to summarize and get everyone's opinion. I will
copy you on that as well. Thanks.

-Joel

  parent reply	other threads:[~2013-07-03 19:56 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <083BC63EECB6FD41B8E81CF7FD87CC0F2E4F1488@DLEE08.ent.ti.com>
2013-06-30 12:06 ` Query on Audio DMA using DMAEngine Lars-Peter Clausen
2013-07-01  6:10   ` Mike Looijmans
2013-07-02  1:28     ` Joel Fernandes
2013-07-02  6:02       ` Mike Looijmans
2013-07-02 12:16         ` Mark Brown
2013-07-02 13:30           ` Mike Looijmans
2013-07-02 14:58             ` Mark Brown
2013-07-04 11:00       ` Clemens Ladisch
2013-07-02  3:33     ` Joel Fernandes
2013-07-02  5:50       ` Mike Looijmans
2013-07-02 12:13         ` Mark Brown
2013-07-02 13:40           ` Mike Looijmans
2013-07-03  9:09           ` Lars-Peter Clausen
2013-07-03  9:43             ` Mark Brown
2013-07-03 13:17               ` Mike Looijmans
     [not found]                 ` <51D4245F.8070307-Oq418RWZeHk@public.gmane.org>
2013-07-03 19:56                   ` Joel Fernandes [this message]
     [not found]               ` <20130703094307.GE27646-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-07-03 17:55                 ` [alsa-devel] " Joel Fernandes
     [not found]                   ` <51D46598.6070005-l0cyMroinI0@public.gmane.org>
2013-07-03 18:12                     ` Mark Brown
2013-07-04  5:56                       ` Mike Looijmans
2013-07-04 10:49                         ` Mark Brown
2013-07-04  6:06                   ` [alsa-devel] " Mike Looijmans
2013-07-04 10:53                     ` Mark Brown
     [not found]                     ` <51D510EA.1030809-Oq418RWZeHk@public.gmane.org>
2013-07-04 10:59                       ` [alsa-devel] " Sekhar Nori
2013-08-14  4:30         ` Joel Fernandes
2013-08-14  4:53           ` Joel Fernandes
2013-08-14 14:10             ` Mike Looijmans
2013-08-14 12:06           ` Mark Brown
2013-07-02  1:04   ` Joel Fernandes
2013-07-03  9:07     ` Lars-Peter Clausen

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=51D481EB.5030902@ti.com \
    --to=joelf-l0cymroini0@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org \
    --cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mike.looijmans-Oq418RWZeHk@public.gmane.org \
    /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