get rid of controls with snd_ctl_remove

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux