From: Stefan Schmidt <stefan@datenfreihafen.org>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org,
Stefan Schmidt <stefan@slimlogic.co.uk>,
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: Thu, 1 Oct 2009 15:19:48 +0200 [thread overview]
Message-ID: <20091001131948.GA5936@excalibur.local> (raw)
In-Reply-To: <20091001122835.GC14417@sirena.org.uk>
Hello.
On Thu, 2009-10-01 at 13:28, Mark Brown wrote:
> On Thu, Oct 01, 2009 at 11:47:15AM +0200, Stefan Schmidt wrote:
>
> > It allows switching audio settings between scenarios or uses-cases like
> > listening to music and answering an incoming phone call. Made of control
> > aliasing for playback, capture master and switch as well as the option to
> > post- and prefix a sequence of control changes avoiding pops and other
> > unwanted noise. Some example programs will be available in alsa-utils.
>
> Overall this looks good - it's certainly dealing with the issues we
> currently have with separating routing control and 'end user' controls.
Thanks. I'm sure there a are a lot things to improve, but I had the feeling that
it is mature enough for the basic things.
> > +/** Scenario ID's
> > + *
> > + * Standard Scenario ID's - Add new scenarios at the end.
> > + */
>
> Extra 's here.
That way?
/**
* Scenario ID's
*
* Standard Scenario ID's - Add new scenarios at the end.
*/
> > +/**
> > + * snd_scenario_reload - reload and reparse scenario configuration
> > + * @scn: scenario
> > + *
> > + * Reloads and reparses sound card scenario configuration.
> > + */
> > +int snd_scenario_reload(struct snd_scenario *scn);
>
> I guess the idea is that in the future this will be removed and the
> scenario API will use inotify or similar to pick up changes.
Indeed. Certainly a Todo item for later enhancements. Do you guys prefer such
todo items in the code or noted somewhere else?
> One thing I think I'm missing with the API documentation here is a
> separation between the API used for setting up scenarios and the API
> used by random client applications - it's there, but it could be
> underlined a bit more. Probably putting the client application stuff at
> the top of the header file would help here since the functions that more
> people will use will be visible first.
Sure can do this.
> > +/* load scenario i */
> > +static int read_scenario_file(struct snd_scenario *scn)
> > +{
> > + int fd, ret;
> > + FILE *f;
> > + char filename[MAX_FILE];
> > + struct scenario_info *info = &scn->scenario[scn->current_scenario];
> > +
> > + sprintf(filename, "%s/%s/%s", ALSA_SCN_DIR, scn->card_name,
> > + info->file);
>
> snprintf().
Oops. Good point. Fixed in the next version.
> > + if (strncmp(tbuf, "MasterPlaybackVolume", 20) == 0) {
> > + info->playback_volume_id = get_int(tbuf + 20);
> > + if (info->playback_volume_id < 0) {
> > + scn_error("%s: failed to get MasterPlaybackVolume\n",
> > + __func__);
> > + goto err;
> > + }
> > + continue;
> > + }
>
> I don't see anywhere which supplies a default value for all these
> control IDs. A memset() of the allocated block should deal with that
> I think since IIRC zero isn't a valid control ID. It'd also be nice to
> be able to use control names instead but that's something that could be
> added later.
ID's start with 1 so the memset approach should work here. Will be fixed in the
next patch. Using the control name is also a good suggestion. I did this for the
sequencer already. Will add it to the todo list.
> Thinking out loud here but I'm wondering if it might make sense to
> replace the fixed list of controls that is there currently with
> something string based which can remap the control names if required.
> This would allow for (probably in the future) having the scenario pass
> back a list of controls without the API having to cater for each
> explicitly, which would allow for other things like hardware EQ controls
> to be passed on to the scenario users if desired - this is useful when
> you get things like systems with multiple EQs.
>
> This would complicate the API, though, and so I think it would be better
> left as-is until we get to the point of having something like a plugin
> for rewriting the controls for applications so they don't need explicit
> knowledge of scenarios. At that point it would only impact the scenario
> manager implementation which should deal with the complexity, at least
> externally.
>
> I'm also thinking that it could be good to add functions to identify
> which PCMs on a card to use in the scenario, perhaps differentiated by
> quality or something. The CPU may have PCMs to multiple devices or with
> differing capabilities and may want to switch between them depending on
> scenario (and possibly stream).
I aggree with you and Liam here. Wondering again where to put the todo list.
Within the code, as separate text file, in the wiki, ...
regards
Stefan Schmidt
next prev parent reply other threads:[~2009-10-01 13:20 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 [this message]
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
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=20091001131948.GA5936@excalibur.local \
--to=stefan@datenfreihafen.org \
--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=stefan@slimlogic.co.uk \
/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.