All of lore.kernel.org
 help / color / mirror / Atom feed
* Query regarding ALSA control interface
@ 2007-02-02  6:52 Aditya Shankar
       [not found] ` <1170404256.27352.1172535505@webmail.messagingengine.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Aditya Shankar @ 2007-02-02  6:52 UTC (permalink / raw)
  To: alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 1013 bytes --]

Hi All,

I have a small query regarding mixer controls. I work on a custom ARM
platform and am trying to get the control interface working.

I have defined a kcontrols structure and have initialized the name field to
"Master Capture Route". This does not show up as a control
when i run alsamixer but works well in OSS Emulation mode.

I did a alsactl store and found this in asound.state file..

control.6 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 1
                comment.range '0 - 7 (step 1)'
                iface MIXER
                name 'Master Capture Route'
                value 0
        }

The value field is initialized to an integer value in the case off all other
controls but here I find it to be 0. Is this the reason why i'm not finding
the control in the alsamixer window.? Can anybody let me know? Or Is there a
way to  get  the control component  working in both modes using a common
name??

Thanks in Advance,
Aditya

[-- Attachment #1.2: Type: text/html, Size: 1861 bytes --]

[-- Attachment #2: Type: text/plain, Size: 374 bytes --]

-------------------------------------------------------------------------
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

[-- Attachment #3: Type: text/plain, Size: 161 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

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

* Re: Query regarding ALSA control interface
       [not found]   ` <24a2bfdf0702020054g68ccd946v180eae48c2d55f0b@mail.gmail.com>
@ 2007-02-05 17:56     ` Clemens Ladisch
  2007-02-06 11:38       ` Aditya Shankar
  0 siblings, 1 reply; 6+ messages in thread
From: Clemens Ladisch @ 2007-02-05 17:56 UTC (permalink / raw)
  To: Aditya Shankar; +Cc: alsa-devel

(please don't top-post)
Aditya Shankar wrote:
> Thanks for your reply. But my problem is not that I dont see any capture
> controls. I am not able to get that particular control which I had mentioned
> in my earlier mail.

Please show the output of "amixer controls" and "amixer scontrols".


Regards,
Clemens

-------------------------------------------------------------------------
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] 6+ messages in thread

* Re: Query regarding ALSA control interface
  2007-02-05 17:56     ` Clemens Ladisch
@ 2007-02-06 11:38       ` Aditya Shankar
  0 siblings, 0 replies; 6+ messages in thread
From: Aditya Shankar @ 2007-02-06 11:38 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 1019 bytes --]

On 2/5/07, Clemens Ladisch <cladisch@fastmail.net> wrote:
>
> (please don't top-post)
> Aditya Shankar wrote:
> > Thanks for your reply. But my problem is not that I dont see any capture
> > controls. I am not able to get that particular control which I had
> mentioned
> > in my earlier mail.
>
> Please show the output of "amixer controls" and "amixer scontrols".
>
>
> Regards,
> Clemens
>

Hi Clemens,

The output of amixer controls is as below..

numid=4,iface=MIXER,name='Master Balance Playback Volume'
numid=3,iface=MIXER,name='Master Monoconfig Playback Volume'
numid=1,iface=MIXER,name='Master Output Playback Volume'
numid=2,iface=MIXER,name='Master Playback Volume'
numid=6,iface=MIXER,name='Master Capture Route'
numid=5,iface=MIXER,name='Master Capture Volume'

The output of amixer scontrols is

Simple mixer control 'Master',0
Simple mixer control 'Master Balance',0
Simple mixer control 'Master Monoconfig',0
Simple mixer control 'Master Output',0

Please let me know what you think..

Regards,
Aditya

[-- Attachment #1.2: Type: text/html, Size: 1641 bytes --]

[-- Attachment #2: Type: text/plain, Size: 374 bytes --]

-------------------------------------------------------------------------
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

[-- Attachment #3: Type: text/plain, Size: 161 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

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

* Re: Query regarding ALSA control interface
  2007-07-24  6:57 ` Clemens Ladisch
@ 2007-07-24 14:32   ` Pharaoh .
  0 siblings, 0 replies; 6+ messages in thread
From: Pharaoh . @ 2007-07-24 14:32 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel

On 7/24/07, Clemens Ladisch <cladisch@fastmail.net> wrote:
>
> Pharaoh . wrote:
> > Now, I have to implement a control which takes four different
> values..namely
> > 0,1.100 and 101. In this case what shoud be the type of control? It
> should
> > be ENUMERATED or INTEGER? I am confused here since the values are not
> > exactly in a range.
>
> An INTEGER control takes numeric values in a specific range, while an
> ENUMERATED control takes values that are not numerically related (but
> that are _internally_ represented as integers in a specific range).
>
> In your case, you'd probably want to use an enumerated control with the
> range 0..3, which maps to the four names "0", "1", "100" and "101".
>
>
> HTH
> Clemens



Thanks Clemens, I had implemented it using  ENUM type. It works.

-pharaoh.

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

* Re: Query regarding ALSA control interface
  2007-07-23 23:16 Pharaoh .
@ 2007-07-24  6:57 ` Clemens Ladisch
  2007-07-24 14:32   ` Pharaoh .
  0 siblings, 1 reply; 6+ messages in thread
From: Clemens Ladisch @ 2007-07-24  6:57 UTC (permalink / raw)
  To: Pharaoh ., alsa-devel

Pharaoh . wrote:
> Now, I have to implement a control which takes four different values..namely
> 0,1.100 and 101. In this case what shoud be the type of control? It should
> be ENUMERATED or INTEGER? I am confused here since the values are not
> exactly in a range.

An INTEGER control takes numeric values in a specific range, while an
ENUMERATED control takes values that are not numerically related (but
that are _internally_ represented as integers in a specific range).

In your case, you'd probably want to use an enumerated control with the
range 0..3, which maps to the four names "0", "1", "100" and "101".


HTH
Clemens

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

* Query regarding ALSA control interface
@ 2007-07-23 23:16 Pharaoh .
  2007-07-24  6:57 ` Clemens Ladisch
  0 siblings, 1 reply; 6+ messages in thread
From: Pharaoh . @ 2007-07-23 23:16 UTC (permalink / raw)
  To: alsa-devel

Hi
I am writing a pcm control interface for my alsa driver. I am confused about
how the switches are used.
I have implemented simple cases like following and they are working well.

static int audio_path_info(struct snd_kcontrol *kcontrol, struct
snd_ctl_elem_info *uinfo)
{
       /*Count is 256 since the values can vary from 0-255. But values fall
in this range only*/

        uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
        uinfo->count = 256;
        uinfo->value.integer.min = 0;
        uinfo->value.integer.max = 255;
        FN_EXIT;
        return 0;
}
static int audio_path_get(struct snd_kcontrol *kcontrol, struct
snd_ctl_elem_value *ucontrol)
{
    my_mixer_t *mixer_chip = snd_kcontrol_chip(kcontrol);
    ucontrol->value.integer.value[0] = mixer_chip->echo;
    ucontrol->value.integer.value[1] = mixer_chip->echo;
    return 0;
}
static int audio_path_put(struct snd_kcontrol *kcontrol, struct
snd_ctl_elem_value *ucontrol)
{
        my_mixer_t *mixer_chip = snd_kcontrol_chip(kcontrol);
       -----
       ----
}


Now, I have to implement a control which takes four different values..namely
0,1.100 and 101. In this case what shoud be the type of control? It should
be ENUMERATED or INTEGER? I am confused here since the values are not
exactly in a range.

-pharaoh.

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

end of thread, other threads:[~2007-07-24 14:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-02  6:52 Query regarding ALSA control interface Aditya Shankar
     [not found] ` <1170404256.27352.1172535505@webmail.messagingengine.com>
     [not found]   ` <24a2bfdf0702020054g68ccd946v180eae48c2d55f0b@mail.gmail.com>
2007-02-05 17:56     ` Clemens Ladisch
2007-02-06 11:38       ` Aditya Shankar
2007-07-23 23:16 Pharaoh .
2007-07-24  6:57 ` Clemens Ladisch
2007-07-24 14:32   ` Pharaoh .

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.