From: Abramo Bagnara <abramo@alsa-project.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: Paul Davis <pbd@op.net>, Jaroslav Kysela <perex@suse.cz>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: how to define a 2-index control element?
Date: Mon, 06 May 2002 14:19:14 +0200 [thread overview]
Message-ID: <3CD674C2.2358ECE0@alsa-project.org> (raw)
In-Reply-To: s5hhellmqjk.wl@alsa2.suse.de
Takashi Iwai wrote:
>
> At Sun, 05 May 2002 21:32:12 -0400,
> Paul Davis wrote:
> >
> > >On Sun, 5 May 2002, Paul Davis wrote:
> > >
> > >> >I suggest you to use the field index of struct sndrv_ctl_elem_id (one
> > >> >byte per dimension).
> > >> >
> > >> >id.index = (source << 8) | destination;
> > >>
> > >> but there are 1400+ possible id's ...
> > >
> > >I agree with Abramo. We can eventually optimize code to handle such amount
> > >of controls.
> >
> > there's no reason to do that. if you're going to require that the user
> > merge two values into a single variable (as above), the user can put
> > the merged result in control->value.integer.value[0]. i just wanted a
> > way to avoid the user having to do this, because otherwise, it will be
> > impossible to ever build an automated GUI for the control (you'll
> > never be able to figure out how to generate the correct values from
> > the control API's description of the control).
> >
> > in addition, no automated GUI is possible with 1400+ controls given
> > the current API.
> >
> > in short, i really do not want to implement the H-DSP driver with this
> > kind of control over the matrix mixer. i raised this issue a month or
> > two ago, and there was (implicit) agreement then that it was silly to
> > represent all possible combinations with a 1:1 mapping between ALSA
> > controls and source/destination pairs.
>
> the question is whether we do mapping on kernel or user space.
> Abramo's proposal means to do this on application side and it will
> need no change for API itself.
>
> of course, doing this straightforwardly is really annoying.
> i cannot imagine alsamixer showing over 1400 bars.
>
> > i guess i'll continue on trying to think of a different way to do
> > this. but it seems to me that if the control API cannot support
> > controls that need user data to read/write them, then we need to fix
> > the control API.
>
> i think adding new control types is a good solution in this case.
> at least, we should not mix up these huge controls with normal ones,
> to avoid to get GUIs confused.
>
> my proposal is:
>
> add two control types, MATRIX_INFO and MATRIX_ELEM.
> MATRIX_INFO contains the size of elements, which is needed to
> calculate the linear index from indices, so that the mapping is done
> inside the alsa-lib.
> some new (lib-)API functions will be provided to map the indices.
> (alternatively, the matrix info can be integrated in
> snd_ctl_elem_info. perhaps this is cleaner but the problem of
> listing remains - read ahead.)
>
> the values are stored in MATRIX_ELEM controls. each of them are
> distinguished by different index values.
> the notification will be sent to each MATRIX_ELEM, so the mechanism is
> kept as well as before.
>
> i'm not sure whether the matrix elements should be listed by
> snd_ctl_elem_list(). usually it would be enough to know only the
> matrix info, not the all values.
> if we use MATRIX_INFO as a control, then listing only this would be
> enough. if we implement matrix info in snd_ctl_elem_info, then there
> should be some workardound...
There is no need for MATRIX_ELEM type and however you'd need a _typed_
MATRIX_ELEM and this is a nonsense when already we have elements for
singleton controls.
Your question is: how to represent the info that a set of elements may
(should) be organized in a matrix?
We have already discussed that some time ago (about topology stuff,
etc., do you remember?) and we decided to keep out this mess from kernel
space.
We decided to have (if needed) card specific alsa-lib code to handle all
that.
If you ask me, I still think this this is indeed the right choice.
--
Abramo Bagnara mailto:abramo@alsa-project.org
Opera Unica Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy
ALSA project http://www.alsa-project.org
It sounds good!
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth@sourceforge.net
next prev parent reply other threads:[~2002-05-06 12:19 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-04 12:45 how to define a 2-index control element? Paul Davis
2002-05-04 13:18 ` Abramo Bagnara
2002-05-05 13:48 ` Paul Davis
2002-05-05 15:50 ` Jaroslav Kysela
2002-05-06 1:32 ` Paul Davis
2002-05-06 6:46 ` Jaroslav Kysela
2002-05-06 11:22 ` Paul Davis
2002-05-06 11:44 ` Jaroslav Kysela
2002-05-06 12:03 ` Takashi Iwai
2002-05-06 12:19 ` Abramo Bagnara [this message]
2002-05-06 12:53 ` Takashi Iwai
2002-05-06 19:11 ` Abramo Bagnara
2002-05-07 9:29 ` Takashi Iwai
2002-05-07 9:55 ` Jaroslav Kysela
2002-05-07 10:34 ` Takashi Iwai
2002-05-07 17:17 ` Paul Davis
2002-05-07 22:06 ` Abramo Bagnara
2002-05-08 0:00 ` Paul Davis
[not found] <20020508000005.EB5AC59D35D@kerberos.suse.cz>
2002-05-08 7:52 ` Jaroslav Kysela
2002-05-08 9:52 ` Takashi Iwai
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=3CD674C2.2358ECE0@alsa-project.org \
--to=abramo@alsa-project.org \
--cc=alsa-devel@alsa-project.org \
--cc=pbd@op.net \
--cc=perex@suse.cz \
--cc=tiwai@suse.de \
/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.