From: Mark Hills <mark@xwax.org>
To: alsa-devel@alsa-project.org
Subject: usb: Endpoints sharing the same interface
Date: Sun, 3 Mar 2013 17:53:53 +0000 (GMT) [thread overview]
Message-ID: <alpine.LNX.2.01.1303021621060.8986@localhost> (raw)
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)
next reply other threads:[~2013-03-03 17:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-03 17:53 Mark Hills [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LNX.2.01.1303021621060.8986@localhost \
--to=mark@xwax.org \
--cc=alsa-devel@alsa-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).