From: Adam Tla/lka <atlka@pg.gda.pl>
To: Paul Davis <paul@linuxaudiosystems.com>
Subject: Re: Re: [Alsa-user] AD1985 full-duplex(?)
Date: Mon, 13 Sep 2004 19:24:34 +0200 [thread overview]
Message-ID: <20040913172434.GC26354@sunrise.pg.gda.pl> (raw)
In-Reply-To: <200409131305.i8DD5udm014503@localhost.localdomain>
On Mon, Sep 13, 2004 at 09:05:56AM -0400, Paul Davis wrote:
> [ JACK ]
> realtime programming is realtime programming. either you use a
> programming approach that doesn't require realtime (which is what the
> "overwrite the older part of the hardware buffer" is all about), or
> you have to follow the requirements for RT, which include
> SCHED_FIFO/RR scheduling and locking all memory.
>
> and anyway, what JACK does is not at all unusual. its code was taken
> from within an older implementation of ardour, and currently ecasound
> and others do something very very similar.
Those are rather specialized sound apps. But I take a look at them.
> For the third time, it is *NOT* lost. What is lost is the ability to
> pretend that the h/w buffer is just a single contiguous chunk of
> physical RAM that is always accessible to the application. As Jaroslav
> and I have explained, you don't need to use the ALSA API "extras" for
> mmap mode. The cost of not doing so is that you lose the ability to
> get xrun detection, just as in OSS.
If I am not using snd_pcm_mmap_begin and snd_pcm_mmap_commit I can't
get ALSA buffer address and pointer so I can't also properly fill it.
So how do you suggest I should use mmapped mode without using this API?
> then why keep pushing for a (c)-style solution (i.e. compatible with
> all possible ALSA devices), when you clearly want either (a) or (b)?
I am using dmix plugin with card which has not hardware mixing.
> >mode. I allocate the buffer in AOSS lib so it is one chunk of mem.
>
> no, you don't allocate the real buffer at all.
look at pcm.c:1344 in alsa-oss/alsa:
assert(!str->mmap_buffer);
result = malloc(len);
OSS simulated ring buffer is allocated here ;-).
> AFAICT, the key functionality that you require is the ability to
> overwrite parts of the buffer that are outside the range of the
> current "period". but the buffer in question is not one allocated by
> libaoss or any other userspace software. it may not even be
> "allocated" by the kernel because it may correspond to memory
> physically located on the audio interface.
OK.
> if you decide you don't want this "overwrite data previously written"
> functionality, then there is nothing in the existing ALSA API that
> will cause you any problems. if you believe that the kernel will never
> screw up scheduling, ignore snd_pcm_avail() and go with your
> assumptions. if you don't care about xrun detection, ignore
> snd_pcm_forward() and it should work fine.
requested feature should work from OSS aps point of view but of course
will not really exist in ALSA implementation. So I must have as small
period size as possible on ALSA size. The app_ptr should be pushed by
calback fuction. Of course this is not an ideal soultion but if period
size will be small enough we should have proper sound.
Generally speaking ALSA AOSS lib is a partial solution. It doesn't
emulate all needed features of OSS and doesn't work with all apps -
statically compiled and disabling LD_PRELOAD variable.
LD_PRELOAD variable usage is a security violation IMHO.
Also poll/select call is not working fast enough for some apps
(those using SDL for example).
So there should be a kernel module which emulates OSS /dev calls
and routes them to some sound daemon using RT sched and memory locking
to do accurate mixing and other special sound processing.
An OSS app should not even know about these all so simple
cat file.wav > /dev/dsp will work properly.
Also proprietary apps with closed code will work properly.
Regards
--
Adam Tla/lka mailto:atlka@pg.gda.pl ^v^ ^v^ ^v^
System & Network Administration Group ~~~~~~
Computer Center, Gdansk University of Technology, Poland
PGP public key: finger atlka@sunrise.pg.gda.pl
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
next prev parent reply other threads:[~2004-09-13 17:25 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-31 8:52 Re: [Alsa-user] AD1985 full-duplex(?) Peter Zubaj
2004-08-31 9:39 ` Jaroslav Kysela
2004-09-06 20:45 ` Adam Tla/lka
2004-09-07 9:05 ` Jaroslav Kysela
2004-09-07 10:34 ` Adam Tla/lka
2004-09-07 13:23 ` Paul Davis
2004-09-07 13:40 ` Jaroslav Kysela
2004-09-08 17:15 ` Adam Tla/lka
[not found] ` <20040909122253.GE4584@sunrise.pg.gda.pl>
[not found] ` <Pine.LNX.4.58.0409091728420.4150@server.perex-int.cz>
2004-09-10 6:46 ` Adam Tla/lka
2004-09-09 5:52 ` Adam Tla/lka
2004-09-09 12:59 ` Paul Davis
2004-09-09 13:28 ` Adam Tla/lka
2004-09-09 15:14 ` Jaroslav Kysela
2004-09-10 7:16 ` Adam Tla/lka
2004-09-10 11:44 ` Paul Davis
2004-09-10 19:04 ` Adam Tla/lka
2004-09-13 13:05 ` Paul Davis
2004-09-13 17:24 ` Adam Tla/lka [this message]
2004-09-26 22:21 ` Adam Tlałka
2004-09-27 3:00 ` Paul Davis
2004-09-27 6:38 ` Adam Tlałka
2004-09-27 12:43 ` Jaroslav Kysela
2004-09-28 5:11 ` Adam Tlałka
2004-09-28 14:47 ` Paul Davis
2004-09-29 5:51 ` Adam Tlałka
2004-09-27 20:14 ` Paul Davis
2004-09-28 6:10 ` Adam Tlałka
[not found] <200409281113.i8SBDo5U021462@localhost.localdomain>
2004-09-28 13:22 ` Adam Tlałka
2004-09-28 14:48 ` Jaroslav Kysela
2004-09-28 14:57 ` Paul Davis
2004-09-28 15:21 ` Takashi Iwai
2004-09-29 6:15 ` Adam Tlałka
[not found] <Pine.HPX.4.33n.0408181538550.24798-100000@studcom.urz.uni-halle.de>
[not found] ` <1092842830.13603.3.camel@localhost.localdomain>
[not found] ` <20040818181350.2b38e875@mango.fruits.de>
2004-08-18 17:37 ` Jaroslav Kysela
2004-08-18 18:15 ` Florian Schmidt
2004-08-19 8:58 ` Jaroslav Kysela
2004-08-19 9:46 ` Takashi Iwai
2004-08-19 10:28 ` Jaroslav Kysela
2004-08-23 11:36 ` Adam Tlałka
2004-08-23 11:54 ` Jaroslav Kysela
2004-08-23 12:34 ` Adam Tlałka
2004-08-23 14:39 ` Jaroslav Kysela
2004-08-24 6:01 ` Adam Tla/lka
2004-08-23 15:30 ` Takashi Iwai
2004-08-28 19:10 ` Adam Tlałka
2004-08-29 9:54 ` Jaroslav Kysela
2004-08-29 18:35 ` Adam Tlałka
2004-08-31 8:09 ` Jaroslav Kysela
2004-08-19 9:48 ` Florian Schmidt
2004-08-20 10:58 ` 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=20040913172434.GC26354@sunrise.pg.gda.pl \
--to=atlka@pg.gda.pl \
--cc=paul@linuxaudiosystems.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 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.