Pioneer DDJ-SX3 usb audio quirks
diff mbox series

Message ID 20190109155848.GQ12622@kwaak.net
State New
Headers show
Series
  • Pioneer DDJ-SX3 usb audio quirks
Related show

Commit Message

ard Jan. 9, 2019, 3:58 p.m. UTC
Hi Guys,

I am trying to get my pioneer to work. Everything works except
for the PCM, which seems to be nothing more than an
isosynchronous stream of 12 channels S32_LE output and 10
channels of S32_LE input. (Determined by usbpcap data patterns and mixxx
channel selection).
I tried to make a quirk out of it, but I got puzzled by the
ifnum.
The PCM channels are both endpoints of a single interface, so I
wonder how I should write that down.

This is the lsusb -v:

Bus 001 Device 005: ID 2b73:0023  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x2b73 
  idProduct          0x0023 
  bcdDevice            1.02
  iManufacturer           1 Pioneer DJ Corporation
  iProduct                2 PIONEER DJ DDJ-SX3
  iSerial                 3 201706
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          137
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower                0mA
    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                 9
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x86  EP 6 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0 
      iInterface              0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength            9
        bInCollection           1
        baInterfaceNr( 0)       2
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         1 Audio
      bInterfaceSubClass      3 MIDI Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      MIDIStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength           65
      MIDIStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (MIDI_IN_JACK)
        bJackType               1 Embedded
        bJackID                 3
        iJack                   0 
      MIDIStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (MIDI_IN_JACK)
        bJackType               2 External
        bJackID                 1
        iJack                   0 
      MIDIStreaming Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (MIDI_OUT_JACK)
        bJackType               2 External
        bJackID                 4
        bNrInputPins            1
        baSourceID( 0)          3
        BaSourcePin( 0)         1
        iJack                   0 
      MIDIStreaming Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (MIDI_OUT_JACK)
        bJackType               1 Embedded
        bJackID                 2
        bNrInputPins            1
        baSourceID( 0)          1
        BaSourcePin( 0)         1
        iJack                   0 
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
        bRefresh                0
        bSynchAddress           0
        MIDIStreaming Endpoint Descriptor:
          bLength                 5
          bDescriptorType        37
          bDescriptorSubtype      1 (GENERAL)
          bNumEmbMIDIJack         1
          baAssocJackID( 0)       2
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
        bRefresh                0
        bSynchAddress           0
        MIDIStreaming Endpoint Descriptor:
          bLength                 5
          bDescriptorType        37
          bDescriptorSubtype      1 (GENERAL)
          bNumEmbMIDIJack         1
          baAssocJackID( 0)       3
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x5f70
  (Bus Powered)
  Debug Mode

And here is my preliminary quirk (yes, I need to remove the octo capture ;-) )
commit 55a009f7e77acf6d75a297e0a01839fdeb580e65
Author: Ard van Breemen <ard@kwaak.net>
Date:   Wed Jan 9 15:36:46 2019 +0100

    try 1 SX3


----
Since this is a copy paste of the roland octo capture with fixes for the numbers I know, I am still wondering about this:
Should I use .ifnum=1 for every snd_usb_audio_quirk?
And in eacht audioformat should I use .iface = 0? 

I also wonder what the .altset_idx means.

Regards,

Ard van Breemen

Comments

Takashi Iwai Jan. 10, 2019, 11:58 a.m. UTC | #1
On Wed, 09 Jan 2019 16:58:48 +0100,
ard wrote:
> 
> Since this is a copy paste of the roland octo capture with fixes for the numbers I know, I am still wondering about this:
> Should I use .ifnum=1 for every snd_usb_audio_quirk?
> And in eacht audioformat should I use .iface = 0? 

Just put the value you take for .ifnum to .iface field.  They must be
same.

> I also wonder what the .altset_idx means.

When you look at lsusb output, you find bAlternateSetting field.
That's the value of altsetting field.  altset_idx is the array index
(zero-based) of the corresponding entry.


HTH,

Takashi
ard Jan. 10, 2019, 3:07 p.m. UTC | #2
Hi,

On Thu, Jan 10, 2019 at 12:58:35PM +0100, Takashi Iwai wrote:
> On Wed, 09 Jan 2019 16:58:48 +0100,
> ard wrote:
> > 
> > Since this is a copy paste of the roland octo capture with fixes for the numbers I know, I am still wondering about this:
> > Should I use .ifnum=1 for every snd_usb_audio_quirk?
> > And in eacht audioformat should I use .iface = 0? 
> 
> Just put the value you take for .ifnum to .iface field.  They must be
> same.

Thanks! I figured as much. You know it's now on to the next
problem :-).

[   14.576174] usb 3-1.1.3: 0:1 : invalid sync pipe. is_playback 1, ep 86, bSynchAddress 00

The timing is done by implicit feedback. As in: there is no other
traffic than 5MB/s of 10 channels iso in and 12 channels iso out
for playing a single channel.

I assume I have to add a case to: set_sync_ep_implicit_fb_quirk
in sound/usb/pcm.c, as I fail to see a construction that automagically
connects a 12 channel output to a 10 channel input with the
USB_ENDPOINT_USAGE_IMPLICIT_FB flag added to the ep_attr field.

I will try just the flag added to the iso in endpoint for now.

Regards,
Ard van Breemen

Patch
diff mbox series

diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 15cbe2565703..8493dbe536bd 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -3324,5 +3324,60 @@  AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"),
 		}
 	}
 },
+{
+	/*
+	 * PIONEER DJ DDJ-SX3
+	 * PCM is 12 channels out, 10 channels in @ 44.1 fixed
+	 * interface 0, vendor class alt setting 1 for endpoints 5 and 0x86
+	 */
+	USB_DEVICE_VENDOR_SPEC(0x2b73, 0x0023),
+	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+		/* .vendor_name = "", */
+		/* .product_name = "OCTO-CAPTURE", */
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = (const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 0,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = & (const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S32_LE,
+					.channels = 12,
+					.iface = 0,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.endpoint = 0x05,
+					.ep_attr = 0x05,
+					.rates = SNDRV_PCM_RATE_44100,
+					.rate_min = 44100,
+					.rate_max = 44100,
+					.nr_rates = 1,
+					.rate_table = (unsigned int[]) { 44100 }
+				}
+			},
+			{
+				.ifnum = 1,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = & (const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S32_LE,
+					.channels = 10,
+					.iface = 1,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.endpoint = 0x86,
+					.ep_attr = 0x05,
+					.rates = SNDRV_PCM_RATE_44100,
+					.rate_min = 44100,
+					.rate_max = 44100,
+					.nr_rates = 1,
+					.rate_table = (unsigned int[]) { 44100 }
+				}
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},
 
 #undef USB_DEVICE_VENDOR_SPEC