[alsa-devel] [PATCH] ALSA: usb: Add support for Zoom R16/24 capture and midi interfaces
This makes the midi interface and capture work out of the box with R16 (and presumably R24 too but untested). Playback stream would also seem to function fine except for one caveat: no sound is produced, so it is disabled for now.
Signed-off-by: Panu Matilainen pmatilai@laiskiainen.org --- sound/usb/quirks-table.h | 34 ++++++++++++++++++++++++++++++++++ sound/usb/quirks.c | 8 ++++++++ 2 files changed, 42 insertions(+)
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index c657752..73621c9 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -3202,6 +3202,40 @@ YAMAHA_DEVICE(0x7010, "UB99"), },
{ + /* ZOOM R16/24 in audio interface 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[]) { + { + /* Control */ + .ifnum = 0, + .type = QUIRK_IGNORE_INTERFACE, + }, + { + /* Playback, sound is missing atm */ + .ifnum = 1, + .type = QUIRK_IGNORE_INTERFACE, + }, + { + /* Capture */ + .ifnum = 2, + .type = QUIRK_AUDIO_STANDARD_INTERFACE, + }, + { + /* Midi */ + .ifnum = 3, + .type = QUIRK_MIDI_STANDARD_INTERFACE + }, + { + .ifnum = -1 + }, + } + } +}, + +{ /* * Some USB MIDI devices don't have an audio control interface, * so we have to grab MIDI streaming interfaces here. diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index a5941f8..2e49193 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1160,6 +1160,14 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe, break; } } + + /* Zoom R16/24 needs a tiny delay here, otherwise requests like + * get/set frequency return as failed despite actually succeeding. + */ + if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1686) && + (le16_to_cpu(dev->descriptor.idProduct) == 0x00dd) && + (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) + mdelay(1); }
/*
At Sat, 29 Nov 2014 21:35:04 +0200, Panu Matilainen wrote:
This makes the midi interface and capture work out of the box with R16 (and presumably R24 too but untested). Playback stream would also seem to function fine except for one caveat: no sound is produced, so it is disabled for now.
Could you give more comments in the playback iface why it's disabled? Ditto for ifnum=0.
thanks,
Takashi
Signed-off-by: Panu Matilainen pmatilai@laiskiainen.org
sound/usb/quirks-table.h | 34 ++++++++++++++++++++++++++++++++++ sound/usb/quirks.c | 8 ++++++++ 2 files changed, 42 insertions(+)
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index c657752..73621c9 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -3202,6 +3202,40 @@ YAMAHA_DEVICE(0x7010, "UB99"), },
{
- /* ZOOM R16/24 in audio interface 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[]) {
{
/* Control */
.ifnum = 0,
.type = QUIRK_IGNORE_INTERFACE,
},
{
/* Playback, sound is missing atm */
.ifnum = 1,
.type = QUIRK_IGNORE_INTERFACE,
},
{
/* Capture */
.ifnum = 2,
.type = QUIRK_AUDIO_STANDARD_INTERFACE,
},
{
/* Midi */
.ifnum = 3,
.type = QUIRK_MIDI_STANDARD_INTERFACE
},
{
.ifnum = -1
},
}
- }
+},
+{ /* * Some USB MIDI devices don't have an audio control interface, * so we have to grab MIDI streaming interfaces here. diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index a5941f8..2e49193 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1160,6 +1160,14 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe, break; } }
- /* Zoom R16/24 needs a tiny delay here, otherwise requests like
* get/set frequency return as failed despite actually succeeding.
*/
- if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1686) &&
(le16_to_cpu(dev->descriptor.idProduct) == 0x00dd) &&
(requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
mdelay(1);
}
/*
1.9.3
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
On 11/29/2014 09:39 PM, Takashi Iwai wrote:
At Sat, 29 Nov 2014 21:35:04 +0200, Panu Matilainen wrote:
This makes the midi interface and capture work out of the box with R16 (and presumably R24 too but untested). Playback stream would also seem to function fine except for one caveat: no sound is produced, so it is disabled for now.
Could you give more comments in the playback iface why it's disabled? Ditto for ifnum=0.
Sure, I'll post an updated patch with added comments.
In the meanwhile I started looking at the mixer - this is just guessing but maybe its starting with outputs muted which could explain the playback stream running but without sound.
The descriptors for interface 0 are garbage but what is there would seem to map to logical elements by subtype and terminaltype, after those the data doesn't seem to add up (eg number of input/output channels missing/wrongly placed etc):
** UNRECOGNIZED: 0b 24 01 00 01 35 00 03 01 02 03 -> Header? ** UNRECOGNIZED: 0c 24 02 05 01 01 00 02 03 00 00 00 -> USB streaming input terminal? ** UNRECOGNIZED: 09 24 03 08 01 03 00 05 00 -> Speaker output terminal? ** UNRECOGNIZED: 0c 24 02 09 01 02 00 08 00 00 00 00 -> Microphone input terminal? ** UNRECOGNIZED: 09 24 03 0c 01 01 00 09 00 -> USB streaming output terminal?
Anything there that might ring a bell, or other ideas where to start poking at this thing?
FWIW there are other unrecognized descriptors too but those are associated with the other interfaces, which I guess I can ignore for now...
- Panu -
At Sun, 30 Nov 2014 12:08:38 +0200, Panu Matilainen wrote:
On 11/29/2014 09:39 PM, Takashi Iwai wrote:
At Sat, 29 Nov 2014 21:35:04 +0200, Panu Matilainen wrote:
This makes the midi interface and capture work out of the box with R16 (and presumably R24 too but untested). Playback stream would also seem to function fine except for one caveat: no sound is produced, so it is disabled for now.
Could you give more comments in the playback iface why it's disabled? Ditto for ifnum=0.
Sure, I'll post an updated patch with added comments.
In the meanwhile I started looking at the mixer - this is just guessing but maybe its starting with outputs muted which could explain the playback stream running but without sound.
The descriptors for interface 0 are garbage but what is there would seem to map to logical elements by subtype and terminaltype, after those the data doesn't seem to add up (eg number of input/output channels missing/wrongly placed etc):
** UNRECOGNIZED: 0b 24 01 00 01 35 00 03 01 02 03 -> Header? ** UNRECOGNIZED: 0c 24 02 05 01 01 00 02 03 00 00 00 -> USB streaming input terminal? ** UNRECOGNIZED: 09 24 03 08 01 03 00 05 00 -> Speaker output terminal? ** UNRECOGNIZED: 0c 24 02 09 01 02 00 08 00 00 00 00 -> Microphone input terminal? ** UNRECOGNIZED: 09 24 03 0c 01 01 00 09 00 -> USB streaming output terminal?
Anything there that might ring a bell, or other ideas where to start poking at this thing?
Yeah, most of these look almost sane, so any off-by-one firmware issue?
Takashi
participants (2)
-
Panu Matilainen
-
Takashi Iwai