All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abramo Bagnara <abramo.bagnara@libero.it>
To: Jaroslav Kysela <perex@suse.cz>
Cc: ALSA development <alsa-devel@alsa-project.org>
Subject: Re: New PCM API extension
Date: Mon, 24 Feb 2003 00:15:59 +0100	[thread overview]
Message-ID: <3E59562F.62929578@libero.it> (raw)
In-Reply-To: Pine.LNX.4.44.0302232154250.1263-100000@pnote.perex-int.cz

Jaroslav Kysela wrote:
> 
> I think that I have one present problem. It was not possible to write,
> something like the dmix plugin does (in the server/client model): Transfer
> data to different areas in the ring buffer. Imagine that client1 wants to
> write data at the end of the ring buffer (assume that server don't change
> the r/w pointer). Then client2 comes with some data to be placed at the
> start of the buffer later (server rewinds the stream position). Then
> hardware processed a period and client1 wants to continue (server forwards
> the stream position at the end of the ring buffer).
> 
> I can imagine more examples where "later" samples might be wanted to be
> processed before "quick" ones.

Your examples appears a little confused at my eyes, but if I've
understood correctly don't you think this might be solved by
snd_pcm_rewind done by server?

At least this is how it works in pcm_share.

> > > I'm also going to propose next extension: Actually, the appl_ptr managing
> > > routines - snd_pcm_reset(), snd_pcm_rewind(), snd_pcm_forward() always
> > > uses an ioctl for it's operation. I think that it wouldn't be a bad idea
> > > to implement these function in the lightweight variant, too. I mean that
> > > they will operate only with the actual hw_ptr without calling the kernel
> > > code. We have already functions to synchronize the hw_ptr with the
> > > hardware (snd_pcm_delay(), snd_pcm_hwsync()). Because it's late to change
> > > this behaviour in alsa-lib, I propose to create a function
> > > 'snd_pcm_fast_rw_change()' (better name?) which tells the alsa-lib that no
> > > accurate operation is required. Especially lowlatency applications will
> > > benefit that we removed more 'user<->kernel' switches.
> >
> > Note that the assumption of monotonic direction of appl_ptr is spread
> > everywhere so I doubt that this is feasible for snd_pcm_rewind.
> 
> I don't understand here. I've looked to the ioctl implementation and there
> are no problems to change appl_ptr in the user space only as well.

Have you thought what happens if appl_ptr is changed backward during
interrupt handler?

Lock free ring buffer absolute precondition is monotonic direction.

-- 
Abramo Bagnara                       mailto:abramo.bagnara@libero.it

Opera Unica                          Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy


-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge

  reply	other threads:[~2003-02-23 23:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-22 17:56 New PCM API extension Jaroslav Kysela
2003-02-22 21:11 ` Lynx Studio LynxTwo/L22 Driver Robert Robinson
2003-06-22  0:07   ` D. Sen
2003-06-22  0:07     ` D. Sen
     [not found]   ` <20030621170718-166800041>
2003-06-22 22:47     ` Giuliano Pochini
     [not found]     ` <20030622134708-168400041>
2003-06-23 10:28       ` D. Sen
2003-06-23 10:28         ` D. Sen
2003-02-22 21:55 ` New PCM API extension Abramo Bagnara
2003-02-23 18:46   ` Jaroslav Kysela
2003-02-23 19:24     ` Abramo Bagnara
2003-02-23 21:01       ` Paul Davis
2003-02-23 21:41       ` Jaroslav Kysela
2003-02-23 23:15         ` Abramo Bagnara [this message]
2003-02-24 15:20           ` Jaroslav Kysela
2003-02-24 19:51             ` Abramo Bagnara
2003-02-27 12:32 ` Kai Vehmanen
2003-02-27 14:22   ` Jaroslav Kysela

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=3E59562F.62929578@libero.it \
    --to=abramo.bagnara@libero.it \
    --cc=alsa-devel@alsa-project.org \
    --cc=perex@suse.cz \
    /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.