Skip to content

Commit

Permalink
ALSA: usbmixer: bail out early when parsing audio class v2 descriptors
Browse files Browse the repository at this point in the history
This is just a quick hack that needs to be removed once the new units
defined by the audio class v2.0 standard are supported.

However, it allows using these devices for now, without mixer support.

Signed-off-by: Daniel Mack <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
Daniel Mack authored and tiwai committed Feb 23, 2010
1 parent 53ee98f commit 7b8a043
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion sound/usb/usbmixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2258,7 +2258,8 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
};
struct usb_mixer_interface *mixer;
struct snd_info_entry *entry;
int err;
struct usb_host_interface *host_iface;
int err, protocol;

strcpy(chip->card->mixername, "USB Mixer");

Expand All @@ -2275,6 +2276,16 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
return -ENOMEM;
}

host_iface = &usb_ifnum_to_if(chip->dev, ctrlif)->altsetting[0];
protocol = host_iface->desc.bInterfaceProtocol;

/* FIXME! */
if (protocol != UAC_VERSION_1) {
snd_printk(KERN_WARNING "mixer interface protocol 0x%02x not yet supported\n",
protocol);
return 0;
}

if ((err = snd_usb_mixer_controls(mixer)) < 0 ||
(err = snd_usb_mixer_status_create(mixer)) < 0)
goto _error;
Expand Down

0 comments on commit 7b8a043

Please sign in to comment.