Hmm, I have been compiling my kernel for a couple of days now and no joy. I have the information from lsusb -vv, cat /proc/asound/R16/stream0 / 1, etc but I'm a little confused about the terminology of quirks-table.h.
What is the difference between .ifnum and .iface? is the first (ifnum) a reference to the usb bus?
When I put the working zoom-quirks.h through, I get capture on interface 1 and playback on interface 2 listed under one stream in cat /proc/asound/R16/stream0 , when I try the zoom-quirks.h that I include below, I get two playback streams, one listed at /proc/asound/R16/stream0 and the other at /proc/asound/R16/stream1
Notice that I have put a bunch of sample formats so that the correct one can be selected. I don't think that this covers the problem though if you read in my excerpt from kern.log, it complains that ep 3 can set freq.
here is the zoom-quirks.h quirks table.
{
/* ZOOM R16 in USB 2.0 mode */
USB_DEVICE(0x1686, 0x00dd),
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
.ifnum = QUIRK_ANY_INTERFACE,
.type = QUIRK_COMPOSITE,
.data = (const struct snd_usb_audio_quirk[]) {
{
.ifnum = 0,
.type = QUIRK_IGNORE_INTERFACE
},
{
.ifnum = 1,
.type = QUIRK_AUDIO_STANDARD_INTERFACE
},
{
.ifnum = 2,
.type = QUIRK_AUDIO_FIXED_ENDPOINT,
.data = & (const struct audioformat) {
.formats = (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 |
SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_U16_BE | SNDRV_PCM_FMTBIT_S16_BE |
SNDRV_PCM_FMTBIT_U24_LE | SNDRV_PCM_FMTBIT_S24_LE |
SNDRV_PCM_FMTBIT_U24_BE | SNDRV_PCM_FMTBIT_S24_BE |
SNDRV_PCM_FMTBIT_U24_3LE | SNDRV_PCM_FMTBIT_S24_3LE |
SNDRV_PCM_FMTBIT_U24_3BE | SNDRV_PCM_FMTBIT_S24_3BE |
SNDRV_PCM_FMTBIT_U32_LE | SNDRV_PCM_FMTBIT_S32_LE |
SNDRV_PCM_FMTBIT_U32_BE | SNDRV_PCM_FMTBIT_S32_BE),
.channels = 2,
.iface = 2,
.altsetting = 1,
.altset_idx = 1,
.attributes = 0,
.endpoint = 0x03, /*PLAYBACK*/
.ep_attr = USB_ENDPOINT_XFER_ISOC,
.rates = (SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000 |
SNDRV_PCM_RATE_88200 |
SNDRV_PCM_RATE_96000),
.rate_min = 44100,
.rate_max = 96000,
.nr_rates = 4,
.rate_table = (unsigned int[]) {
44100, 48000, 88200, 96000
}
}
},
{
.ifnum = 3,
.type = QUIRK_MIDI_STANDARD_INTERFACE
},
{
.ifnum = 4,
.type = QUIRK_AUDIO_FIXED_ENDPOINT,
.data = & (const struct audioformat) {
.formats = (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 |
SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_U16_BE | SNDRV_PCM_FMTBIT_S16_BE |
SNDRV_PCM_FMTBIT_U24_LE | SNDRV_PCM_FMTBIT_S24_LE |
SNDRV_PCM_FMTBIT_U24_BE | SNDRV_PCM_FMTBIT_S24_BE |
SNDRV_PCM_FMTBIT_U24_3LE | SNDRV_PCM_FMTBIT_S24_3LE |
SNDRV_PCM_FMTBIT_U24_3BE | SNDRV_PCM_FMTBIT_S24_3BE |
SNDRV_PCM_FMTBIT_U32_LE | SNDRV_PCM_FMTBIT_S32_LE |
SNDRV_PCM_FMTBIT_U32_BE | SNDRV_PCM_FMTBIT_S32_BE),
.channels = 8,
.iface = 1,
.altsetting = 1,
.altset_idx = 1,
.attributes = 0,
.endpoint = 0x84, /*CAPTURE*/
.ep_attr = USB_ENDPOINT_XFER_ISOC,
.rates = (SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000 |
SNDRV_PCM_RATE_88200 |
SNDRV_PCM_RATE_96000),
.rate_min = 44100,
.rate_max = 96000,
.nr_rates = 4,
.rate_table = (unsigned int[]) {
44100, 48000, 88200, 96000
}
}
},
{
.ifnum = .1
},
}
}
},
here is the excerpt from kern.log
Mar 10 09:35:17 super-R720 kernel: [ 98.846039] usb 1-1: new high-speed USB device number 4 using ehci-pci
Mar 10 09:35:17 super-R720 kernel: [ 98.974688] usb 1-1: config 1 interface 3 altsetting 0 bulk endpoint 0x1 has invalid maxpacket 64
Mar 10 09:35:17 super-R720 kernel: [ 98.974693] usb 1-1: config 1 interface 3 altsetting 0 bulk endpoint 0x82 has invalid maxpacket 64
Mar 10 09:35:17 super-R720 kernel: [ 98.975307] usb 1-1: New USB device found, idVendor=1686, idProduct=00dd
Mar 10 09:35:17 super-R720 kernel: [ 98.975310] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar 10 09:35:17 super-R720 kernel: [ 98.975312] usb 1-1: Product: R16
Mar 10 09:35:17 super-R720 kernel: [ 98.975314] usb 1-1: Manufacturer: ZOOM Corporation
Mar 10 09:35:17 super-R720 kernel: [ 98.975316] usb 1-1: SerialNumber: 0
Mar 10 09:35:22 super-R720 kernel: [ 104.032341] 4:1:1: cannot get freq at ep 0x3
Mar 10 09:35:27 super-R720 kernel: [ 109.033070] usbcore: registered new interface driver snd-usb-audio
I'm fairly certain that I've got the wrong interface number but I have found it virtually impossible to find any documentation on the nomenclature used in quirks-table.h. For instance what is the difference between ifnum and iface?
Also, I notice that several source code files, like stream.c for instance, have quirks built in to them, so perhaps I could explicitly set the sample rate format for the playback stream when the stream is created in the source code.
I'm guessing that where a bit rate descriptor has the letter S it stands for signed and the one with U stands for unsigned, I don't know if that would make a difference. My brief foray into the source code so far leaves me with the impression that I should be able to create both capture and playback on the same interface, using the alt setting, but how the format works for that is beyond me at the moment, although I plan to spend tomorrow morning reading through the source code!.