alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* usb: Endpoints sharing the same interface
@ 2013-03-03 17:53 Mark Hills
  2013-03-03 17:57 ` [PATCH RFC 1/4] snd-usb-audio: Playback and MIDI support for Novation Twitch DJ controller Mark Hills
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Hills @ 2013-03-03 17:53 UTC (permalink / raw)
  To: alsa-devel

Novation Twitch [1] is a USB device with audio capture and playback 
endpoints on the same bInterfaceNumber.

This has thrown up some tricky cases in the USB audio driver, and I'd 
appreciate some advice.

I'll follow up with my patches so far as an RFC.

This device has endpoints for 2 channels capture (0x01), 4 channels 
playback (0x82), both on interface #0. Interface #1 is raw MIDI.

I seem to be finding code that assumes pcm to always use the first 
endpoint on an interface. eg. problems with maxpacksize (see patch in 
thread)

Now I'm in a position where playback _or_ capture works reliably. But to 
start capture stops playback, and vice-versa (or sometimes causes hangs)

It seems like snd_pcm_prepare() concludes that need_setup_ep is required, 
but I think this may be based on something going on in 
set_sample_rate_v1() also looking to the first endpoint -- 
usb_sndctrlpipe(dev,0).

Before I do any more work on this, are there any hints where to go with 
this?

If we can overcome thse limitations then the same would likely apply to 
Saffire 6 USB and other Focusrite devices [2], and maybe some of the other 
devices with quirks that only support playback.

Many thanks

[1] http://uk.novationmusic.com/digital-dj/twitch/
[2] http://focusritedevelopmentteam.wordpress.com/category/drivers/

-- 
Mark


---
Bus 005 Device 010: ID 1235:0018 Novation EMS 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x1235 Novation EMS
  idProduct          0x0018 
  bcdDevice            1.00
  iManufacturer           1 Focusrite A.E. Ltd
  iProduct                2 Twitch
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           64
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              498mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x024c  1x 588 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0126  1x 294 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
Device Status:     0x0000
  (Bus Powered)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-03-03 17:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-03 17:53 usb: Endpoints sharing the same interface Mark Hills
2013-03-03 17:57 ` [PATCH RFC 1/4] snd-usb-audio: Playback and MIDI support for Novation Twitch DJ controller Mark Hills
2013-03-03 17:57   ` [PATCH RFC 2/4] usb: Allow us to distinguish between different returns of EMSGSIZE Mark Hills
2013-03-03 17:57   ` [PATCH RFC 3/4] snd-usb-audio: Trust fields given in the quirk Mark Hills
2013-03-03 17:57   ` [PATCH RFC 4/4] snd-usb-audio: Prototype capture support for Novation Twitch Mark Hills

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).