* Re: snd-usb-audio: quirk for Edirol UA-5 in Advanced Mode [not found] <Pine.LNX.4.44.0306102307170.26166-200000@kani-keli.alnet.home> @ 2003-06-12 3:50 ` Stephane Alnet 2003-06-12 8:18 ` Clemens Ladisch 0 siblings, 1 reply; 5+ messages in thread From: Stephane Alnet @ 2003-06-12 3:50 UTC (permalink / raw) To: alsa-devel The error is as follows; I've tried to move a couple locks around but I can't figure it out. ------------------------------------------>8 bad: scheduling while atomic! Call Trace: [<c0116c26>] schedule+0x3a6/0x3b0 [<c0121eda>] schedule_timeout+0x5a/0xb0 [<c0121e70>] process_timeout+0x0/0x10 [<d08afaff>] usb_start_wait_urb+0xaf/0x190 [usbcore] [<c0116c80>] default_wake_function+0x0/0x30 [<d08af72f>] usb_alloc_urb+0x2f/0x50 [usbcore] [<d08afc47>] usb_internal_control_msg+0x67/0x80 [usbcore] [<d08afcee>] usb_control_msg+0x8e/0xb0 [usbcore] [<d08b088d>] usb_set_interface+0xbd/0x220 [usbcore] [<d08af2a0>] hcd_endpoint_disable+0x0/0x1c0 [usbcore] [<d0960591>] set_format+0xd1/0x3a0 [snd_usb_audio] [<d09608c4>] snd_usb_pcm_prepare+0x34/0x50 [snd_usb_audio] [<d0948f25>] snd_pcm_do_prepare+0x15/0x40 [snd_pcm] [<c013ecc2>] handle_mm_fault+0xe2/0x180 [<d09483a4>] snd_pcm_action_single+0x34/0x60 [snd_pcm] [<d095cbe8>] snd_pcm_action_prepare+0x0/0x18 [snd_pcm] [<d09484e6>] snd_pcm_action_lock_irq+0x96/0xa0 [snd_pcm] [<d095cbe8>] snd_pcm_action_prepare+0x0/0x18 [snd_pcm] [<d0948ff4>] snd_pcm_prepare+0x74/0x90 [snd_pcm] [<d095cbe8>] snd_pcm_action_prepare+0x0/0x18 [snd_pcm] [<d094bd00>] snd_pcm_playback_ioctl1+0x70/0x430 [snd_pcm] [<c0121bc0>] run_timer_softirq+0x100/0x1a0 [<c015e280>] sys_ioctl+0x100/0x290 [<c010930b>] syscall_call+0x7/0xb ------------------------------------------>8 Stephane On Tue, 10 Jun 2003, Stephane Alnet wrote: > Hi, > > (Hopefully this is the right place to post this!) > > Attached is a diff file for the Edirol UA-5 Advanced Mode against kernel > 2.5.70-bk14 sound/usb. > > I added a new QUIRK mode (QUIRK_AUDIOSTREAM_INTERFACE) which basically > forces an interface (and its altsettings) into Audio/AudioStream. When in > Advanced Mode, the UA-5 exposes all its interfaces in class 255/255 > (Vendor/Vendor), but actually besides this all the descriptors are valid > USB Audio control/interfaces/endpoints/... So this quirk simply overwrites > the streaming interfaces class/subclass with the proper values. (My > understanding is that we don't need to care about the audiocontrol > interface.) > > Recording is working properly (tested with "arecord -c 2 -f S24_3LE -r > 96000" on x86, for example); playback is crashing due to a "bad: > scheduling while atomic!" problem I haven't looked at yet. > > (Note: this change only applies to Advanced Mode, which provides access to > 24bits samples and the 96kHz sampling rates. The non-Advanced Mode of the > UA-5 works just fine with the default driver at 44.1 and 48kHz, giving > 16bits samples, as far as I can tell.) > > Feel free to integrate the diff into the current distribution/kernel as > needed. > > I'd be interested in feedback on whether this is working for other people, > and also help in troubleshooting the playback crash. > > Thank you, > Stephane ------------------------------------------------------- This SF.NET email is sponsored by: eBay Great deals on office technology -- on eBay now! Click here: http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: snd-usb-audio: quirk for Edirol UA-5 in Advanced Mode 2003-06-12 3:50 ` snd-usb-audio: quirk for Edirol UA-5 in Advanced Mode Stephane Alnet @ 2003-06-12 8:18 ` Clemens Ladisch 2003-06-12 19:13 ` Stephane Alnet 0 siblings, 1 reply; 5+ messages in thread From: Clemens Ladisch @ 2003-06-12 8:18 UTC (permalink / raw) To: Stephane Alnet; +Cc: alsa-devel Stephane Alnet wrote: > On Tue, 10 Jun 2003, Stephane Alnet wrote: > > (Hopefully this is the right place to post this!) > > > > Attached is a diff file for the Edirol UA-5 Advanced Mode against kernel > > 2.5.70-bk14 sound/usb. I didn't see your first post (maybe because the current list moderator is Dave Null), so I'm only guessing what your diff did. > > I added a new QUIRK mode (QUIRK_AUDIOSTREAM_INTERFACE) which basically > > forces an interface (and its altsettings) into Audio/AudioStream. When in > > Advanced Mode, the UA-5 exposes all its interfaces in class 255/255 > > (Vendor/Vendor), but actually besides this all the descriptors are valid > > USB Audio control/interfaces/endpoints/... So this quirk simply overwrites > > the streaming interfaces class/subclass with the proper values. (My > > understanding is that we don't need to care about the audiocontrol > > interface.) There already is a quirk type for this, QUIRK_STANDARD_INTERFACE. See the quirk entry for the UA-20, which behaves in the same way (the UA-20's interface #3 is for the MIDI ports). Regards, Clemens ------------------------------------------------------- This SF.NET email is sponsored by: eBay Great deals on office technology -- on eBay now! Click here: http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: snd-usb-audio: quirk for Edirol UA-5 in Advanced Mode 2003-06-12 8:18 ` Clemens Ladisch @ 2003-06-12 19:13 ` Stephane Alnet 2003-06-17 9:28 ` [PATCH] " Clemens Ladisch 0 siblings, 1 reply; 5+ messages in thread From: Stephane Alnet @ 2003-06-12 19:13 UTC (permalink / raw) To: Clemens Ladisch; +Cc: alsa-devel [-- Attachment #1: Type: TEXT/PLAIN, Size: 1526 bytes --] On Thu, 12 Jun 2003, Clemens Ladisch wrote: > I didn't see your first post (maybe because the current list moderator > is Dave Null), OK, so I won't feel bad sending the diff a second time, then. :) > so I'm only guessing what your diff did. > [...] > > > When in Advanced Mode, the UA-5 exposes all its interfaces in class > > > 255/255 (Vendor/Vendor), but actually besides this all the > > > descriptors are valid USB Audio control/interfaces/endpoints/... [...] > There already is a quirk type for this, QUIRK_STANDARD_INTERFACE. See > the quirk entry for the UA-20, which behaves in the same way (the > UA-20's interface #3 is for the MIDI ports). That's what I hoped too (didn't want to have to change usbaudio.c if at all possible) but it didn't seem to work. (My understanding is that STANDARD_INTERFACE needs at least the bInterfaceSubClass info to be valid. This isn't the case on the UA-5.) Here's the interesting part of the quirk I proposed (mostly a rewrite of STANDARD_INTERFACE that goes blindly trusting what usbquirks.h says): for( i = 0; i < iface->num_altsetting; i++ ) { alts = &iface->altsetting[i]; altsd = get_iface_desc(alts); altsd->bInterfaceClass = USB_CLASS_AUDIO; altsd->bInterfaceSubClass = USB_SUBCLASS_AUDIO_STREAMING; } [I'm not sure the overwrite of Vendor with USB_CLASS_AUDIO is strictly required, but it didn't hurt and is consistent with changing the subclass.] Of course since it's my first time looking at alsa/kernel, I may just be plain off-track. :) S. [-- Attachment #2: Type: APPLICATION/octet-stream, Size: 1360 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] snd-usb-audio: quirk for Edirol UA-5 in Advanced Mode 2003-06-12 19:13 ` Stephane Alnet @ 2003-06-17 9:28 ` Clemens Ladisch 2003-06-18 12:56 ` Takashi Iwai 0 siblings, 1 reply; 5+ messages in thread From: Clemens Ladisch @ 2003-06-17 9:28 UTC (permalink / raw) To: Stephane Alnet; +Cc: alsa-devel (Jaroslav/Takashi: please apply the patch below) Stephane Alnet wrote: > On Thu, 12 Jun 2003, Clemens Ladisch wrote: > > There already is a quirk type for this, QUIRK_STANDARD_INTERFACE. See > > the quirk entry for the UA-20, which behaves in the same way (the > > UA-20's interface #3 is for the MIDI ports). > > That's what I hoped too (didn't want to have to change usbaudio.c if at > all possible) but it didn't seem to work. (My understanding is that > STANDARD_INTERFACE needs at least the bInterfaceSubClass info to be valid. > This isn't the case on the UA-5.) Yes, the UA-20 does has valid subclass info, so the driver uses it. > Here's the interesting part of the quirk I proposed (mostly a rewrite of > STANDARD_INTERFACE that goes blindly trusting what usbquirks.h says): > ... > altsd->bInterfaceClass = USB_CLASS_AUDIO; > altsd->bInterfaceSubClass = USB_SUBCLASS_AUDIO_STREAMING; The _STANDARD_INTERFACE quirk type did almost the same as your _AUDIOSTREAM_INTERFACE, but was just a special case for the UA-20, so I've split it into two types to to allow specifying the interface type (audio or MIDI) without reading the subclass from the descriptors. So now we have a more generic solution for both the UA-5 and the UA-20. Regards, Clemens -- - split QUIRK_STANDARD_INTERFACE into QUIRK_AUDIO_STANDARD_INTERFACE and QUIRK_MIDI_STANDARD_INTERFACE - add quirk for Edirol UA-20 Index: alsa-kernel/usb/usbaudio.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/usb/usbaudio.c,v retrieving revision 1.56 diff -u -r1.56 usbaudio.c --- alsa-kernel/usb/usbaudio.c 4 Jun 2003 12:43:55 -0000 1.56 +++ alsa-kernel/usb/usbaudio.c 17 Jun 2003 06:56:16 -0000 @@ -2381,7 +2381,8 @@ * create a stream for an interface with proper descriptors */ static int create_standard_interface_quirk(snd_usb_audio_t *chip, - struct usb_interface *iface) + struct usb_interface *iface, + const snd_usb_audio_quirk_t *quirk) { struct usb_host_interface *alts; struct usb_interface_descriptor *altsd; @@ -2389,19 +2390,18 @@ alts = &iface->altsetting[0]; altsd = get_iface_desc(alts); - switch (altsd->bInterfaceSubClass) { - case USB_SUBCLASS_AUDIO_STREAMING: + switch (quirk->type) { + case QUIRK_AUDIO_STANDARD_INTERFACE: err = parse_audio_endpoints(chip, altsd->bInterfaceNumber); if (!err) usb_set_interface(chip->dev, altsd->bInterfaceNumber, 0); /* reset the current interface */ break; - case USB_SUBCLASS_MIDI_STREAMING: + case QUIRK_MIDI_STANDARD_INTERFACE: err = snd_usb_create_midi_interface(chip, iface, NULL); break; default: - snd_printk(KERN_ERR "if %d: non-supported subclass %d\n", - altsd->bInterfaceNumber, altsd->bInterfaceSubClass); - return -ENODEV; + snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type); + return -ENXIO; } if (err < 0) { snd_printk(KERN_ERR "cannot setup if %d: error %d\n", @@ -2495,8 +2495,9 @@ return create_composite_quirk(chip, iface, quirk); case QUIRK_AUDIO_FIXED_ENDPOINT: return create_fixed_stream_quirk(chip, iface, quirk); - case QUIRK_STANDARD_INTERFACE: - return create_standard_interface_quirk(chip, iface); + case QUIRK_AUDIO_STANDARD_INTERFACE: + case QUIRK_MIDI_STANDARD_INTERFACE: + return create_standard_interface_quirk(chip, iface, quirk); default: snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type); return -ENXIO; Index: alsa-kernel/usb/usbaudio.h =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/usb/usbaudio.h,v retrieving revision 1.17 diff -u -r1.17 usbaudio.h --- alsa-kernel/usb/usbaudio.h 13 May 2003 10:44:09 -0000 1.17 +++ alsa-kernel/usb/usbaudio.h 17 Jun 2003 06:56:16 -0000 @@ -154,7 +154,8 @@ #define QUIRK_MIDI_MIDIMAN 2 #define QUIRK_COMPOSITE 3 #define QUIRK_AUDIO_FIXED_ENDPOINT 4 -#define QUIRK_STANDARD_INTERFACE 5 +#define QUIRK_AUDIO_STANDARD_INTERFACE 5 +#define QUIRK_MIDI_STANDARD_INTERFACE 6 typedef struct snd_usb_audio_quirk snd_usb_audio_quirk_t; typedef struct snd_usb_midi_endpoint_info snd_usb_midi_endpoint_info_t; @@ -184,7 +185,7 @@ /* for QUIRK_AUDIO_FIXED_ENDPOINT, data points to an audioformat structure */ -/* for QUIRK_STANDARD_INTERFACE, data is NULL */ +/* for QUIRK_AUDIO/MIDI_STANDARD_INTERFACE, data is NULL */ /* */ Index: alsa-kernel/usb/usbquirks.h =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/usb/usbquirks.h,v retrieving revision 1.20 diff -u -r1.20 usbquirks.h --- alsa-kernel/usb/usbquirks.h 13 May 2003 10:44:09 -0000 1.20 +++ alsa-kernel/usb/usbquirks.h 17 Jun 2003 06:56:16 -0000 @@ -453,6 +453,36 @@ } } }, +{ /* + * This quirk is for the "Advanced Driver" mode of the Edirol UA-5. + * If the advanced mode switch at the back of the unit is off, the + * UA-5 has ID 0x0582/0x0011 and is standard compliant (no quirks), + * but offers only 16-bit PCM. + * In advanced mode, the UA-5 will output S24_3LE samples (two + * channels) at the rate indicated on the front switch, including + * the 96kHz sample rate. + */ + USB_DEVICE(0x0582, 0x0010), + .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { + .vendor_name = "EDIROL", + .product_name = "UA-5", + .ifnum = QUIRK_ANY_INTERFACE, + .type = QUIRK_COMPOSITE, + .data = & (const snd_usb_audio_quirk_t[]) { + { + .ifnum = 1, + .type = QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum = 2, + .type = QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum = -1 + } + } + } +}, { USB_DEVICE(0x0582, 0x0012), .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) { @@ -520,15 +550,15 @@ .data = & (const snd_usb_audio_quirk_t[]) { { .ifnum = 1, - .type = QUIRK_STANDARD_INTERFACE + .type = QUIRK_AUDIO_STANDARD_INTERFACE }, { .ifnum = 2, - .type = QUIRK_STANDARD_INTERFACE + .type = QUIRK_AUDIO_STANDARD_INTERFACE }, { .ifnum = 3, - .type = QUIRK_STANDARD_INTERFACE + .type = QUIRK_MIDI_STANDARD_INTERFACE }, { .ifnum = -1 ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] snd-usb-audio: quirk for Edirol UA-5 in Advanced Mode 2003-06-17 9:28 ` [PATCH] " Clemens Ladisch @ 2003-06-18 12:56 ` Takashi Iwai 0 siblings, 0 replies; 5+ messages in thread From: Takashi Iwai @ 2003-06-18 12:56 UTC (permalink / raw) To: Clemens Ladisch; +Cc: Stephane Alnet, alsa-devel At Tue, 17 Jun 2003 11:28:25 +0200 (METDST), Clemens Ladisch wrote: > > (Jaroslav/Takashi: please apply the patch below) applied now. thanks. Takashi ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-06-18 12:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <Pine.LNX.4.44.0306102307170.26166-200000@kani-keli.alnet.home>
2003-06-12 3:50 ` snd-usb-audio: quirk for Edirol UA-5 in Advanced Mode Stephane Alnet
2003-06-12 8:18 ` Clemens Ladisch
2003-06-12 19:13 ` Stephane Alnet
2003-06-17 9:28 ` [PATCH] " Clemens Ladisch
2003-06-18 12:56 ` Takashi Iwai
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.