All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Jaroslav Kysela <perex@perex.cz>
Cc: ALSA development <alsa-devel@alsa-project.org>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Ian Molton <ian@mnementh.co.uk>,
	Graeme Gregory <gg@slimlogic.co.uk>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: [PATCH] ascenario: Add scenario support to alsa-lib
Date: Tue, 06 Oct 2009 11:28:18 +0200	[thread overview]
Message-ID: <s5hvdis7txp.wl%tiwai@suse.de> (raw)
In-Reply-To: <alpine.LNX.2.00.0910061048410.31529@eeebox2.perex-int.cz>

[Forgot to follow up the first part]

At Tue, 6 Oct 2009 11:00:18 +0200 (CEST),
Jaroslav Kysela wrote:
> 
> On Tue, 6 Oct 2009, Takashi Iwai wrote:
> 
> > At Tue, 6 Oct 2009 10:23:56 +0200 (CEST),
> > Jaroslav Kysela wrote:
> >>
> >> Hi,
> >>
> >>  	Some ideas, proposal for further discussion...
> >>
> >> On Mon, 5 Oct 2009, Stefan Schmidt wrote:
> >>
> >>> Hello.
> >>>
> >>> On Mon, 2009-10-05 at 11:14, Jaroslav Kysela wrote:
> >>>> On Mon, 5 Oct 2009, Stefan Schmidt wrote:
> >>>>
> >>>>> On Thu, 2009-10-01 at 17:08, Stefan Schmidt wrote:
> >>>>>>
> >>>>>> For an updated patch with all your comments inlcuded see below.
> >>>>>
> >>>>> Here is another update on this patch. Fixed a problem I introduced in the last
> >>>>> iteration and changed the config tokens from MasterPlaybackVolume to Master
> >>>>> Playback Volume, etc. That's based on a siggestion from Mark which we had
> >>>>> offlist. Let me quote it here to explain the good reasoning behind it.
> >>>>
> >>>> Question: What's the IDs (integers) returned with
> >>>> snd_scenario_get_master_playback_volume() etc. functions?
> >>>
> >>> That is part of the code Liam wrote, but let me answer it (and maybe
> >>> Liam chime in if it is wrong or needs more explanation).
> >>>
> >>> It's just the numid of an alsa control which should be used as master
> >>> playback, etc in this scenario. It aliases the function we can use with
> >>> ascenario to the real ones in alsa which can bedifferent for different
> >>> scenarios.
> >>
> >> It's not very clear. The exported functions should be documented at least
> >> with doxygen.
> >>
> >> Also, I would move all _get_ functions to one with this interface:
> >>
> >> #define SND_SCENARIO_KEY_KCTL_MASTER_PLAYBACK_VOLUME	1
> >> .....
> >>
> >> int snd_scenario_get(scenario, int key, void *result);
> >>
> >> It will allow us to extend this interface without adding many functions in
> >> future, something like:
> >>
> >> #define SND_SCENARIO_KEY_PCM_PLAYBACK			11
> >> .....
> >
> > I find it's good to have a generic interface, too, but a void pointer
> > is discouraging.  It's too ambiguous and inconvenient when you use it
> > ("What type do I have to pass for SND_SCENARIO_XXX on earth???").
> 
> It might be solved with inline functions in header files to cover all 
> types.

Yes, but then why not providing functions for all types from the
beginning?  There shouldn't be so many different types.

A void pointer is nice for closures or an API like X protocol, but I
find no big merit in a small API set like scenario.

Well, it's just an implementation detail, though.

> My opinion is to not use so much function in alsa-lib for each 
> trivial interfaces.

We do have it per design, no?

The question is rather how often a "trivial" interface would be added
in future.  If the expected extension is limited, we don't have to
worry  about this too much.  Just adding a few new functions would be
much easier to maintain.


thanks,

Takashi

  parent reply	other threads:[~2009-10-06  9:28 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-01  9:47 [RFC] Add scenario management Stefan Schmidt
2009-10-01  9:47 ` [PATCH] ascenario: Add scenario support to alsa-lib Stefan Schmidt
2009-10-01 12:28   ` Mark Brown
2009-10-01 12:48     ` Liam Girdwood
2009-10-01 13:02       ` Mark Brown
2009-10-01 14:06         ` Liam Girdwood
2009-10-01 14:18           ` Mark Brown
2009-10-01 13:19     ` Stefan Schmidt
2009-10-01 13:24       ` Mark Brown
2009-10-01 13:38         ` Stefan Schmidt
2009-10-01 13:39         ` pl bossart
2009-10-01 13:54           ` Liam Girdwood
2009-10-01 14:11           ` Stefan Schmidt
2009-10-01 15:08       ` Stefan Schmidt
2009-10-05  8:27         ` Stefan Schmidt
2009-10-05  9:14           ` Jaroslav Kysela
2009-10-05  9:35             ` Stefan Schmidt
2009-10-06  8:23               ` Jaroslav Kysela
2009-10-06  8:41                 ` Takashi Iwai
2009-10-06  9:00                   ` Jaroslav Kysela
2009-10-06  9:13                     ` Takashi Iwai
2009-10-07  8:10                       ` Jaroslav Kysela
2009-10-07  8:52                         ` Takashi Iwai
2009-10-07  9:47                           ` Jaroslav Kysela
2009-10-07  9:55                             ` Takashi Iwai
2009-10-06  9:28                     ` Takashi Iwai [this message]
2009-10-06 11:05                       ` Jaroslav Kysela
2009-10-06 13:33                         ` Jaroslav Kysela
2009-10-06 13:46                           ` Takashi Iwai
2009-10-07 13:48                             ` Stefan Schmidt
2009-10-06 15:12                           ` Stefan Schmidt
2009-10-06 15:54                             ` [PATCH 0/3] ascenario: Bring it to compile after API changes Stefan Schmidt
2009-10-06 15:54                             ` [PATCH 1/3] ascenario: Fix typedef for snd_scenario_t Stefan Schmidt
2009-10-06 16:04                               ` Takashi Iwai
2009-10-06 17:08                                 ` Stefan Schmidt
2009-10-06 17:16                                   ` Jaroslav Kysela
2009-10-06 17:42                                     ` Stefan Schmidt
2009-10-06 15:54                             ` [PATCH 2/3] ascenario: Fix usage of new typedefed snd_scenario_t Stefan Schmidt
2009-10-06 15:54                             ` [PATCH 3/3] ascenario: Catchup with function declaration changes Stefan Schmidt
2009-10-07 13:53                           ` [PATCH] ascenario: Add scenario support to alsa-lib Mark Brown
2009-10-06 10:29                 ` Stefan Schmidt
2009-10-01  9:47 ` [PATCH] ascenario: Add dump and configure utils for ascneario Stefan Schmidt
2009-10-02  9:12 ` [RFC] Add scenario management Takashi Iwai
2009-10-02  9:55   ` Stefan Schmidt
2009-10-02  9:58     ` Takashi Iwai
2009-10-02  9:58   ` Jaroslav Kysela
2009-10-02 10:12     ` Takashi Iwai
2009-10-02 10:45     ` Liam Girdwood
2009-10-02 11:03       ` 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=s5hvdis7txp.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=gg@slimlogic.co.uk \
    --cc=ian@mnementh.co.uk \
    --cc=lrg@slimlogic.co.uk \
    --cc=perex@perex.cz \
    --cc=stefan@datenfreihafen.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.