* ALSA Control Interface - default values?
@ 2010-05-10 13:35 Max Klein
2010-05-10 13:54 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Max Klein @ 2010-05-10 13:35 UTC (permalink / raw)
To: alsa-devel
Hello,
when writing an alsa driver, in the info callback of the control I can specify which range of values this control does accept (uinfo->value.integer.min and .max). If I put 1 as minimum and 10 as maximum for example, I would expect that the default value of this control is something in between the range, e.g. 1, after the driver is loaded.
But I figured out, that ALSA initializes the control with a value of 0, which is not in between the range.
Can someone please tell me why ALSA initializes the Control with a value of zero, even if the minimum in the info callback is 1 ?
Is there any way to initialize the control with some "default" values, aside of snd_ctl_add()?
Best regards and thanks for your help!
Max
--
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ALSA Control Interface - default values?
2010-05-10 13:35 ALSA Control Interface - default values? Max Klein
@ 2010-05-10 13:54 ` Mark Brown
[not found] ` <20100510142507.41960@gmx.net>
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2010-05-10 13:54 UTC (permalink / raw)
To: Max Klein; +Cc: alsa-devel
On Mon, May 10, 2010 at 03:35:16PM +0200, Max Klein wrote:
> Can someone please tell me why ALSA initializes the Control with a value of zero, even if the minimum in the info callback is 1 ?
> Is there any way to initialize the control with some "default" values, aside of snd_ctl_add()?
What is the problem here? The driver is responsible for the default
values - where do you believe that ALSA is overwriting the values you're
looking for?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ALSA Control Interface - default values?
[not found] ` <20100510142507.41960@gmx.net>
@ 2010-05-10 15:31 ` Mark Brown
0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2010-05-10 15:31 UTC (permalink / raw)
To: Max Klein; +Cc: alsa-devel
On Mon, May 10, 2010 at 04:25:07PM +0200, Max Klein wrote:
> thanks for fast reply, may you tell me how the driver can set the defaults?
> EDIT: whoops, I guess it was an error in reasoning from myself...as I have the control of all those variables outputted by the get and put callbacks, I just have to initialize those variables before initializing the control interface, right?
Yes, the driver just needs to make sure that whatever it uses to return
the current setting when queried is going to give the right answer from
the time the control is set up, normally by initialising variables
though if you're doing things like read data back from hardware then you
may be able to rely on the hardware defaults.
[Re-adding CC to alsa-devel - it's normal to do a reply to all for Linux
lists.]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-05-10 15:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-10 13:35 ALSA Control Interface - default values? Max Klein
2010-05-10 13:54 ` Mark Brown
[not found] ` <20100510142507.41960@gmx.net>
2010-05-10 15:31 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).