[alsa-devel] [PATCH 2/5] ALSA: snd-usb: switch over to new endpoint streaming logic
Takashi Iwai
tiwai at suse.de
Wed Nov 2 16:58:50 CET 2011
At Tue, 01 Nov 2011 21:57:30 +0100,
Clemens Ladisch wrote:
>
> On 10/31/2011 01:10 PM, Daniel Mack wrote:
> > @@ -276,6 +312,15 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt)
> > if (((is_playback && attr == USB_ENDPOINT_SYNC_ASYNC) ||
> > (! is_playback && attr == USB_ENDPOINT_SYNC_ADAPTIVE)) &&
> > altsd->bNumEndpoints >= 2) {
> > + switch (subs->stream->chip->usb_id) {
> > + case USB_ID(0x0763, 0x2080): /* M-Audio FastTrack Ultra */
> > + case USB_ID(0x0763, 0x2081):
> > + ep = 0x81;
> > + iface = usb_ifnum_to_if(dev, 2);
> > + alts = &iface->altsetting[1];
>
> Better check that the device actually has these descriptors.
>
> > +int snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream, int cmd)
> > +{
> > + case SNDRV_PCM_TRIGGER_START:
> > + err = start_endpoints(subs);
>
> The trigger callback should execute very quickly; the initial URB
> submission should be handled in the prepare callback.
Indeed this is a PITA since long time ago... In general, it's wrong
to do it in prepare callback. But we had to do just as a workaround.
Clemens, I thought you wanted to implement some framework for such
devices?
thanks,
Takashi
More information about the Alsa-devel
mailing list