All of lore.kernel.org
 help / color / mirror / Atom feed
* get rid of controls with snd_ctl_remove
@ 2008-08-29 12:54 Harald Radke
  2008-08-29 13:01 ` Takashi Iwai
  0 siblings, 1 reply; 15+ messages in thread
From: Harald Radke @ 2008-08-29 12:54 UTC (permalink / raw)
  To: alsa-devel

Hi there!

Please be patient with me, I am quite inexperienced with alsa programming, so 
this might be a dumb question:

We have a WM8750 working in our PDA, the codec is working so far but I want to 
remove some of the control since they aren't needed.

Instead of copying the wm8750.c file and adjusting it, I want to write another 
module which basically get rid of those controls, something like:

[...]

static const char* unused_controls[] = {"AAAA", "BBBB,"CCCC"};

        struct snd_kcontrol *ctl;

        list_for_each_entry(ctl, &card->controls, list)
          for(i=0; i <  ARRAY_SIZE(unused_controls); i++)
            if (!strcmp(unused_controls[i],ctl->id.name)) {
              down_write(&card->controls_rwsem);
              snd_ctl_remove(card,ctl);
              up_write(&card->controls_rwsem);
              break;
            }

unfortunatly this doesn't work (module segfaults...."of course" you will say 
*g*)

My question: is it possible at all and I am just not deep nuff in understanding 
the sound system or do I have to adjust the original code?

Thx

Harry

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

end of thread, other threads:[~2008-09-02 10:05 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-29 12:54 get rid of controls with snd_ctl_remove Harald Radke
2008-08-29 13:01 ` Takashi Iwai
2008-08-29 13:16   ` Liam Girdwood
2008-08-29 13:41     ` Takashi Iwai
2008-08-29 13:56       ` Liam Girdwood
2008-08-29 16:42         ` Takashi Iwai
2008-08-29 20:10           ` Liam Girdwood
2008-08-29 22:19           ` Harald Radke
2008-09-01  5:56             ` Takashi Iwai
2008-09-01 11:04               ` Harald Radke
2008-09-01 11:09                 ` CORRECTION (get rid of controls with snd_ctl_remove) Harald Radke
2008-09-01 11:51                   ` Liam Girdwood
2008-09-02  8:02                     ` CORRECTION (get rid of controls with snd_ctl_remove ) Harald Radke
2008-09-02  9:46                       ` CORRECTION (get rid of controls with?snd_ctl_remove ) Mark Brown
2008-09-02 10:05                         ` Harald Radke

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.