All of lore.kernel.org
 help / color / mirror / Atom feed
* mixer kcontrol documents?
@ 2007-02-08 17:42 Brad Beveridge
  2007-02-08 21:27 ` Seth Forshee
  0 siblings, 1 reply; 2+ messages in thread
From: Brad Beveridge @ 2007-02-08 17:42 UTC (permalink / raw)
  To: alsa-devel

Hi all,
In a previous thread Liam suggested that I should expose some driver
functionality via a mixer kcontrol.  I am quite new to working on ALSA
stuff, so I don't really know how to go about doing this.
I couldn't really find any info about kcontrols in
kernel/Documentation/sound/alsa, or on the ALSA website.

Basically I'd like to expose to userland a control called "De-emphasis
filter" which will take the values:
 - ON or OFF
or maybe
 - OFF, 32kHz, 44.1kHz, 48kHz

I'm unsure which to choose, but I suspect on/off and automatically
choose the correct config based on the current sampling rate - but I
don't expect it matters right now.

I've looked at the snd_kcontrol_new structure, and I assume that I
really only need to fill in the fields and (somehow) register the
structure.  Any tips, or existing drivers I can look at that will give
me a bit more knowledge here?

Thanks
Brad

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mixer kcontrol documents?
  2007-02-08 17:42 mixer kcontrol documents? Brad Beveridge
@ 2007-02-08 21:27 ` Seth Forshee
  0 siblings, 0 replies; 2+ messages in thread
From: Seth Forshee @ 2007-02-08 21:27 UTC (permalink / raw)
  To: Brad Beveridge; +Cc: alsa-devel

Hi Brad,

On 2/8/07, Brad Beveridge <brad.beveridge@gmail.com> wrote:
> Hi all,
> In a previous thread Liam suggested that I should expose some driver
> functionality via a mixer kcontrol.  I am quite new to working on ALSA
> stuff, so I don't really know how to go about doing this.
> I couldn't really find any info about kcontrols in
> kernel/Documentation/sound/alsa, or on the ALSA website.
>
> Basically I'd like to expose to userland a control called "De-emphasis
> filter" which will take the values:
>  - ON or OFF
> or maybe
>  - OFF, 32kHz, 44.1kHz, 48kHz
>
> I'm unsure which to choose, but I suspect on/off and automatically
> choose the correct config based on the current sampling rate - but I
> don't expect it matters right now.
>
> I've looked at the snd_kcontrol_new structure, and I assume that I
> really only need to fill in the fields and (somehow) register the
> structure.  Any tips, or existing drivers I can look at that will give
> me a bit more knowledge here?
>

There are a number of convenience macros found in linux/sound/soc.h to
help you set up kcontrols in ASoC drivers.  Based on your previous
e-mail (you need to set up your filter in your machine driver via
GPIOs, correct?) you probably want to use SOC_ENUM_EXT().  This will
set up the kcontrol so that functions in your machine driver get
called whenever someone tries to read or write its value.

There are a number of examples of this in ASoC machine drivers -- one
good example is found in sound/soc/pxa/corgi.c.  Look at the
wm8731_corgi_controls array and you'll see an example of a simple
on/off control and another one with several possible values.  You can
work your way backwards from there to see how everything is set up.
Also be sure to note the call to snd_ctl_add() in corgi_wm8731_init().

Cheers,
Seth

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-08 21:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-08 17:42 mixer kcontrol documents? Brad Beveridge
2007-02-08 21:27 ` Seth Forshee

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.