diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-08-13 09:40:53 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-08-15 05:48:01 -0400 |
commit | 7a9b8063cf7d78d7de4f2555357101087548c699 (patch) | |
tree | e52206406078301f572057597ba45eb0a7a413ca | |
parent | 8a8f2662c535e1dedced896cc68cb8473fd98fa0 (diff) |
ALSA: usb-audio - Add ignore_ctl_error parameter
Added the ignore_ctl_error parameter to enable/disable the control-error
handling for mixer interfaces. It was a hard-coded ifdef, and now you
can change it more easily.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r-- | Documentation/sound/alsa/ALSA-Configuration.txt | 5 | ||||
-rw-r--r-- | sound/usb/usbaudio.c | 7 | ||||
-rw-r--r-- | sound/usb/usbaudio.h | 3 | ||||
-rw-r--r-- | sound/usb/usbmixer.c | 7 |
4 files changed, 15 insertions, 7 deletions
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index 68bbc25ff39e..b33e030509fb 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt | |||
@@ -1983,6 +1983,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1983 | device_setup - Device specific magic number (optional) | 1983 | device_setup - Device specific magic number (optional) |
1984 | - Influence depends on the device | 1984 | - Influence depends on the device |
1985 | - Default: 0x0000 | 1985 | - Default: 0x0000 |
1986 | ignore_ctl_error - Ignore any USB-controller regarding mixer | ||
1987 | interface (default: no) | ||
1986 | 1988 | ||
1987 | This module supports multiple devices, autoprobe and hotplugging. | 1989 | This module supports multiple devices, autoprobe and hotplugging. |
1988 | 1990 | ||
@@ -1991,6 +1993,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1991 | check. | 1993 | check. |
1992 | NB: async_unlink=0 would cause Oops. It remains just for | 1994 | NB: async_unlink=0 would cause Oops. It remains just for |
1993 | debugging purpose (if any). | 1995 | debugging purpose (if any). |
1996 | NB: ignore_ctl_error=1 may help when you get an error at accessing | ||
1997 | the mixer element such as URB error -22. This happens on some | ||
1998 | buggy USB device or the controller. | ||
1994 | 1999 | ||
1995 | Module snd-usb-caiaq | 2000 | Module snd-usb-caiaq |
1996 | -------------------- | 2001 | -------------------- |
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index c91f18cdc8b5..c5cf682c352f 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c | |||
@@ -71,6 +71,7 @@ static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; | |||
71 | static int nrpacks = 8; /* max. number of packets per urb */ | 71 | static int nrpacks = 8; /* max. number of packets per urb */ |
72 | static int async_unlink = 1; | 72 | static int async_unlink = 1; |
73 | static int device_setup[SNDRV_CARDS]; /* device parameter for this card*/ | 73 | static int device_setup[SNDRV_CARDS]; /* device parameter for this card*/ |
74 | static int ignore_ctl_error; | ||
74 | 75 | ||
75 | module_param_array(index, int, NULL, 0444); | 76 | module_param_array(index, int, NULL, 0444); |
76 | MODULE_PARM_DESC(index, "Index value for the USB audio adapter."); | 77 | MODULE_PARM_DESC(index, "Index value for the USB audio adapter."); |
@@ -88,7 +89,9 @@ module_param(async_unlink, bool, 0444); | |||
88 | MODULE_PARM_DESC(async_unlink, "Use async unlink mode."); | 89 | MODULE_PARM_DESC(async_unlink, "Use async unlink mode."); |
89 | module_param_array(device_setup, int, NULL, 0444); | 90 | module_param_array(device_setup, int, NULL, 0444); |
90 | MODULE_PARM_DESC(device_setup, "Specific device setup (if needed)."); | 91 | MODULE_PARM_DESC(device_setup, "Specific device setup (if needed)."); |
91 | 92 | module_param(ignore_ctl_error, bool, 0444); | |
93 | MODULE_PARM_DESC(ignore_ctl_error, | ||
94 | "Ignore errors from USB controller for mixer interfaces."); | ||
92 | 95 | ||
93 | /* | 96 | /* |
94 | * debug the h/w constraints | 97 | * debug the h/w constraints |
@@ -3633,7 +3636,7 @@ static void *snd_usb_audio_probe(struct usb_device *dev, | |||
3633 | if (err > 0) { | 3636 | if (err > 0) { |
3634 | /* create normal USB audio interfaces */ | 3637 | /* create normal USB audio interfaces */ |
3635 | if (snd_usb_create_streams(chip, ifnum) < 0 || | 3638 | if (snd_usb_create_streams(chip, ifnum) < 0 || |
3636 | snd_usb_create_mixer(chip, ifnum) < 0) { | 3639 | snd_usb_create_mixer(chip, ifnum, ignore_ctl_error) < 0) { |
3637 | goto __error; | 3640 | goto __error; |
3638 | } | 3641 | } |
3639 | } | 3642 | } |
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index 140ba363414c..f3ca77f08eac 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h | |||
@@ -223,7 +223,8 @@ int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe, | |||
223 | __u8 request, __u8 requesttype, __u16 value, __u16 index, | 223 | __u8 request, __u8 requesttype, __u16 value, __u16 index, |
224 | void *data, __u16 size, int timeout); | 224 | void *data, __u16 size, int timeout); |
225 | 225 | ||
226 | int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif); | 226 | int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif, |
227 | int ignore_error); | ||
227 | void snd_usb_mixer_disconnect(struct list_head *p); | 228 | void snd_usb_mixer_disconnect(struct list_head *p); |
228 | 229 | ||
229 | int snd_usb_create_midi_interface(struct snd_usb_audio *chip, struct usb_interface *iface, | 230 | int snd_usb_create_midi_interface(struct snd_usb_audio *chip, struct usb_interface *iface, |
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c index 6621fad8c5f0..a49246113e75 100644 --- a/sound/usb/usbmixer.c +++ b/sound/usb/usbmixer.c | |||
@@ -2014,7 +2014,8 @@ static void snd_audigy2nx_proc_read(struct snd_info_entry *entry, | |||
2014 | } | 2014 | } |
2015 | } | 2015 | } |
2016 | 2016 | ||
2017 | int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif) | 2017 | int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif, |
2018 | int ignore_error) | ||
2018 | { | 2019 | { |
2019 | static struct snd_device_ops dev_ops = { | 2020 | static struct snd_device_ops dev_ops = { |
2020 | .dev_free = snd_usb_mixer_dev_free | 2021 | .dev_free = snd_usb_mixer_dev_free |
@@ -2029,9 +2030,7 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif) | |||
2029 | return -ENOMEM; | 2030 | return -ENOMEM; |
2030 | mixer->chip = chip; | 2031 | mixer->chip = chip; |
2031 | mixer->ctrlif = ctrlif; | 2032 | mixer->ctrlif = ctrlif; |
2032 | #ifdef IGNORE_CTL_ERROR | 2033 | mixer->ignore_ctl_error = ignore_error; |
2033 | mixer->ignore_ctl_error = 1; | ||
2034 | #endif | ||
2035 | mixer->id_elems = kcalloc(256, sizeof(*mixer->id_elems), GFP_KERNEL); | 2034 | mixer->id_elems = kcalloc(256, sizeof(*mixer->id_elems), GFP_KERNEL); |
2036 | if (!mixer->id_elems) { | 2035 | if (!mixer->id_elems) { |
2037 | kfree(mixer); | 2036 | kfree(mixer); |