[alsa-devel] [PATCH 1/7] Unify M-Audio Fast Track Ultra and Ebox-44 mixer quirks.
Takashi Iwai
tiwai at suse.de
Tue Apr 24 08:22:09 CEST 2012
At Mon, 23 Apr 2012 19:43:09 +0100 (BST),
Mark Hills wrote:
>
> On Mon, 23 Apr 2012, Takashi Iwai wrote:
>
> > At Mon, 23 Apr 2012 16:37:31 +0200, Felix Homann wrote:
> [...]
> > > /*
> > > * Create mixer for Electrix Ebox-44
> > > *
> > > @@ -605,17 +636,26 @@ static int snd_ebox44_create_ctl(struct usb_mixer_interface *mixer,
> > >
> > > static int snd_ebox44_create_mixer(struct usb_mixer_interface *mixer)
> > > {
> > > - snd_ebox44_create_ctl(mixer, 4, 1, 0x0, USB_MIXER_INV_BOOLEAN, "Headphone Playback Switch");
> > > - snd_ebox44_create_ctl(mixer, 4, 2, 0x1, USB_MIXER_S16, "Headphone A Mix Playback Volume");
> > > - snd_ebox44_create_ctl(mixer, 4, 2, 0x2, USB_MIXER_S16, "Headphone B Mix Playback Volume");
> > > -
> > > - snd_ebox44_create_ctl(mixer, 7, 1, 0x0, USB_MIXER_INV_BOOLEAN, "Output Playback Switch");
> > > - snd_ebox44_create_ctl(mixer, 7, 2, 0x1, USB_MIXER_S16, "Output A Playback Volume");
> > > - snd_ebox44_create_ctl(mixer, 7, 2, 0x2, USB_MIXER_S16, "Output B Playback Volume");
> > > -
> > > - snd_ebox44_create_ctl(mixer, 10, 1, 0x0, USB_MIXER_INV_BOOLEAN, "Input Capture Switch");
> > > - snd_ebox44_create_ctl(mixer, 10, 2, 0x1, USB_MIXER_S16, "Input A Capture Volume");
> > > - snd_ebox44_create_ctl(mixer, 10, 2, 0x2, USB_MIXER_S16, "Input B Capture Volume");
> > > + snd_create_std_mono_ctl(mixer, 4, 1, 0x0, USB_MIXER_INV_BOOLEAN,
> > > + "Headphone Playback Switch", NULL);
> > > + snd_create_std_mono_ctl(mixer, 4, 2, 0x1, USB_MIXER_S16,
> > > + "Headphone A Mix Playback Volume", NULL);
> > > + snd_create_std_mono_ctl(mixer, 4, 2, 0x2, USB_MIXER_S16,
> > > + "Headphone B Mix Playback Volume", NULL);
> > > +
> > > + snd_create_std_mono_ctl(mixer, 7, 1, 0x0, USB_MIXER_INV_BOOLEAN,
> > > + "Output Playback Switch", NULL);
> > > + snd_create_std_mono_ctl(mixer, 7, 2, 0x1, USB_MIXER_S16,
> > > + "Output A Playback Volume", NULL);
> > > + snd_create_std_mono_ctl(mixer, 7, 2, 0x2, USB_MIXER_S16,
> > > + "Output B Playback Volume", NULL);
> > > +
> > > + snd_create_std_mono_ctl(mixer, 10, 1, 0x0, USB_MIXER_INV_BOOLEAN,
> > > + "Input Capture Switch", NULL);
> > > + snd_create_std_mono_ctl(mixer, 10, 2, 0x1, USB_MIXER_S16,
> > > + "Input A Capture Volume", NULL);
> > > + snd_create_std_mono_ctl(mixer, 10, 2, 0x2, USB_MIXER_S16,
> > > + "Input B Capture Volume", NULL);
> >
> > It would be safer to check the error of each call, but then it'd be
> > better to make a table and loop over it. You can create a new patch
> > for that.
>
> I can do this, if somebody can tell me how best to handle the error. If
> snd_ebox44_create_ctl fails andI return an error code, I become
> responsible for un-winding the previous creations?
This doesn't matter. The leftover control elements are released
automatically by the card instance destructor.
Anyway, I fixed this manually now together with Felix's patches.
thanks,
Takashi
More information about the Alsa-devel
mailing list