All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: van der Linden <ejvanderlinden@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Communication between Xenomai and Linux domains
Date: Sun, 13 Apr 2008 17:43:16 +0200	[thread overview]
Message-ID: <48022A14.4050802@domain.hid> (raw)
In-Reply-To: <003401c89d78$d187bf70$0202a8c0@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 2310 bytes --]

van der Linden wrote:
> Jan,
> 
> I have two real-time requirements:
> 
> 1.  I have to get audio from ALSA and deliver it to a custom FPGA driver and 
> vice versa each 5 miliseconds.
>      So, I will set the chunk size for ALSA in such a way I get 5 ms audio 
> samples. From the FPGA I also get chunks of 5ms.
> 
>      There may be some jitter in delivering between ALSA and FPGA but think 
> of one or two miliseconds.

That sounds more than feasible.

> 
> 2. I want to receive 5ms audio from ALSA and after filtering and processing 
> it I have to sent it back to ALSA.
>     This must be done within 10ms.
> 
> We tested the real-time patches but the interrupt latency was not good 
> enough on our Blackfin 537 DSP (measured with a latency measuring tool).
> With Xenomai installed the latency tool showed very good response. So I want 
> to go the Xenomai way.

Yeah, there is no -rt in sight for Blackfin, thus going this way makes
sense. But you won't get around porting basic ALSA support into the
Xenomai domain. However, this can be fairly simply, provided a straight
audio controller design.

> 
> So therefor I like to know more about the Xenomai / Linux interaction and 
> the performance measuring method (see original mailing).

Regarding Xenomai/Linux interaction, there are basically two patterns:

 - Lock-less queues in shared memory between both sides.

 - A Xenomai "borderline" thread at low priority that interacts with
   other Xenomai threads in primary mode (e.g. via message queues or
   using shared memory and Xenomai mutexes, semaphores, etc.), then
   switches to secondary mode for its Linux tasks (like socket access)
   but without holding any lock at this point(!), and finally starts the
   loop all over again. Note that domain switching takes place
   automatically, you only have to take care of a clean design
   (RT/non-RT separation).

One warning regarding I-pipe/Xenomai on Blackfin, though: the last time
I checked we still had some issue in the patch that can cause scheduling
artifacts on the Linux side (but not for Xenomai!). This may not bite
you in your scenario, and I know of quite a few Blackfin applications
based on Xenomai which are fine as well, but one should be aware of this.

HTH,
Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

  reply	other threads:[~2008-04-13 15:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-12 17:59 [Xenomai-help] Communication between Xenomai and Linux domains van der Linden
2008-04-12 18:32 ` Gilles Chanteperdrix
2008-04-13 13:16   ` van der Linden
2008-04-13 13:51     ` Jan Kiszka
2008-04-13 15:12       ` van der Linden
2008-04-13 15:43         ` Jan Kiszka [this message]
2008-04-13 15:55         ` Gilles Chanteperdrix
2008-04-13 17:05           ` van der Linden
2008-04-13 18:18             ` Gilles Chanteperdrix

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=48022A14.4050802@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=ejvanderlinden@domain.hid \
    --cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.