Clemens Ladisch | 27 Jun 22:16 2013
Picon

[git pull] [PATCH 0/7] add support for many Roland and Yamaha devices

The following changes since commit f722406faae2d073cc1d01063d1123c35425939e:

  Linux 3.10-rc1 (2013-05-11 17:14:08 -0700)

are available in the git repository at:

  git://git.alsa-project.org/alsa-kprivate.git full-roland-support

for you to fetch changes up to b7f33917bcd993ff81f3f80b9dc1890fb7410c6d:

  ALSA: usb-audio: add quirks for Roland QUAD/OCTO-CAPTURE (2013-06-27 21:59:50 +0200)

----------------------------------------------------------------
Clemens Ladisch (7):
      ALSA: usb-audio: store protocol version in struct audioformat
      ALSA: usb-audio: detect implicit feedback on Roland devices
      ALSA: usb-audio: add support for many Roland/Yamaha devices
      ALSA: usb-audio: add MIDI port names for some Roland devices
      ALSA: usb-audio: remove superfluous Roland quirks
      ALSA: usb-audio: claim autodetected PCM interfaces all at once
      ALSA: usb-audio: add quirks for Roland QUAD/OCTO-CAPTURE

 sound/usb/card.h         |   1 +
 sound/usb/clock.c        |   4 +-
 sound/usb/format.c       |  34 +---
 sound/usb/format.h       |   2 +-
 sound/usb/midi.c         |  74 +++++++
 sound/usb/pcm.c          |  45 ++++-
 sound/usb/quirks-table.h | 497 +++++++++--------------------------------------
 sound/usb/quirks.c       | 209 ++++++++++++++++++++
(Continue reading)

Clemens Ladisch | 27 Jun 22:18 2013
Picon

[PATCH 1/7] ALSA: usb-audio: store protocol version in struct audioformat

Instead of reading bInterfaceProtocol from the descriptor whenever it's
needed, store this value in the audioformat structure.  Besides
simplifying some code, this will allow us to correctly handle vendor-
specific devices where the descriptors are marked with other values.

Signed-off-by: Clemens Ladisch <clemens <at> ladisch.de>
---
 sound/usb/card.h   |  1 +
 sound/usb/clock.c  |  4 +---
 sound/usb/format.c | 34 ++++++++++------------------------
 sound/usb/format.h |  2 +-
 sound/usb/pcm.c    |  4 +---
 sound/usb/stream.c |  3 ++-
 6 files changed, 16 insertions(+), 32 deletions(-)

diff --git a/sound/usb/card.h b/sound/usb/card.h
index bf2889a..5ecacaa 100644
--- a/sound/usb/card.h
+++ b/sound/usb/card.h
 <at>  <at>  -21,6 +21,7  <at>  <at>  struct audioformat {
 	unsigned char endpoint;		/* endpoint */
 	unsigned char ep_attr;		/* endpoint attributes */
 	unsigned char datainterval;	/* log_2 of data packet interval */
+	unsigned char protocol;		/* UAC_VERSION_1/2 */
 	unsigned int maxpacksize;	/* max. packet size */
 	unsigned int rates;		/* rate bitmasks */
 	unsigned int rate_min, rate_max;	/* min/max rates */
diff --git a/sound/usb/clock.c b/sound/usb/clock.c
index 3a2ce39..86f80c6 100644
--- a/sound/usb/clock.c
(Continue reading)

Eldad Zack | 9 Jul 20:34 2013

Re: [PATCH 1/7] ALSA: usb-audio: store protocol version in struct audioformat


Hi Clemens,

On Thu, 27 Jun 2013, Clemens Ladisch wrote:

> Instead of reading bInterfaceProtocol from the descriptor whenever it's
> needed, store this value in the audioformat structure.  Besides
> simplifying some code, this will allow us to correctly handle vendor-
> specific devices where the descriptors are marked with other values.

This change introduced a regression for fixed stream quirks, since
fp->protocol is not set in the respective initializer.

It's a trivial fix, I'll send a patch shortly.

Cheers,
Eldad

> 
> Signed-off-by: Clemens Ladisch <clemens <at> ladisch.de>
> ---
>  sound/usb/card.h   |  1 +
>  sound/usb/clock.c  |  4 +---
>  sound/usb/format.c | 34 ++++++++++------------------------
>  sound/usb/format.h |  2 +-
>  sound/usb/pcm.c    |  4 +---
>  sound/usb/stream.c |  3 ++-
>  6 files changed, 16 insertions(+), 32 deletions(-)
> 
> diff --git a/sound/usb/card.h b/sound/usb/card.h
(Continue reading)

Clemens Ladisch | 27 Jun 22:18 2013
Picon

[PATCH 2/7] ALSA: usb-audio: detect implicit feedback on Roland devices

All the Roland/Edirol/BOSS USB audio devices that need implicit feedback
show this unambiguously in their descriptors, so it might be a good idea
to let the driver detect this.

This should make playback work correctly (at least with Jack) with the
following devices:
- BOSS GT-100
- BOSS JS-8 Jam Station
- Edirol M-16DX
- Roland GAIA SH-01

Signed-off-by: Clemens Ladisch <clemens <at> ladisch.de>
---
 sound/usb/pcm.c | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index 776c58c..15b151e 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
 <at>  <at>  -298,6 +298,35  <at>  <at>  static int deactivate_endpoints(struct snd_usb_substream *subs)
 	return 0;
 }

+static int search_roland_implicit_fb(struct usb_device *dev, int ifnum,
+				     unsigned int altsetting,
+				     struct usb_host_interface **alts,
+				     unsigned int *ep)
+{
+	struct usb_interface *iface;
(Continue reading)

Clemens Ladisch | 27 Jun 22:19 2013
Picon

[PATCH 3/7] ALSA: usb-audio: add support for many Roland/Yamaha devices

Add quirks to detect the various vendor-specific descriptors used by
Roland and Yamaha in most of their recent USB audio and MIDI devices.

Together with the previous patch, this should add audio/MIDI support for
the following USB devices:
- Edirol motion dive .tokyo performance package
- Roland MC-808 Synthesizer
- Roland BK-7m Synthesizer
- Roland VIMA JM-5/8 Synthesizer
- Roland SP-555 Sequencer
- Roland V-Synth GT Synthesizer
- Roland Music Atelier AT-75/100/300/350C/500/800/900/900C Organ
- Edirol V-Mixer M-200i/300/380/400/480/R-1000
- BOSS GT-10B Effects Processor
- Roland Fantom G6/G7/G8 Keyboard
- Cakewalk Sonar V-Studio 20/100/700 Audio Interface
- Roland GW-8 Keyboard
- Roland AX-Synth Keyboard
- Roland JUNO-Di/STAGE/Gi Keyboard
- Roland VB-99 Effects Processor
- Cakewalk UM-2G MIDI Interface
- Roland A-500S Keyboard
- Roland SD-50 Synthesizer
- Roland OCTAPAD SPD-30 Controller
- Roland Lucina AX-09 Synthesizer
- BOSS BR-800 Digital Recorder
- Roland DUO/TRI-CAPTURE (EX) Audio Interface
- BOSS RC-300 Loop Station
- Roland JUPITER-50/80 Keyboard
- Roland R-26 Recorder
(Continue reading)

Clemens Ladisch | 27 Jun 22:19 2013
Picon

[PATCH 4/7] ALSA: usb-audio: add MIDI port names for some Roland devices

Signed-off-by: Clemens Ladisch <clemens <at> ladisch.de>
---
 sound/usb/midi.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index 63dd054..b901f46 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
 <at>  <at>  -1575,8 +1575,41  <at>  <at>  static struct port_info {
 	EXTERNAL_PORT(0x0582, 0x004d, 0, "%s MIDI"),
 	EXTERNAL_PORT(0x0582, 0x004d, 1, "%s 1"),
 	EXTERNAL_PORT(0x0582, 0x004d, 2, "%s 2"),
+	/* BOSS GT-PRO */
+	CONTROL_PORT(0x0582, 0x0089, 0, "%s Control"),
 	/* Edirol UM-3EX */
 	CONTROL_PORT(0x0582, 0x009a, 3, "%s Control"),
+	/* Roland VG-99 */
+	CONTROL_PORT(0x0582, 0x00b2, 0, "%s Control"),
+	EXTERNAL_PORT(0x0582, 0x00b2, 1, "%s MIDI"),
+	/* Cakewalk Sonar V-Studio 100 */
+	EXTERNAL_PORT(0x0582, 0x00eb, 0, "%s MIDI"),
+	CONTROL_PORT(0x0582, 0x00eb, 1, "%s Control"),
+	/* Roland VB-99 */
+	CONTROL_PORT(0x0582, 0x0102, 0, "%s Control"),
+	EXTERNAL_PORT(0x0582, 0x0102, 1, "%s MIDI"),
+	/* Roland A-PRO */
+	EXTERNAL_PORT(0x0582, 0x010f, 0, "%s MIDI"),
+	CONTROL_PORT(0x0582, 0x010f, 1, "%s 1"),
+	CONTROL_PORT(0x0582, 0x010f, 2, "%s 2"),
(Continue reading)

Clemens Ladisch | 27 Jun 22:20 2013
Picon

[PATCH 6/7] ALSA: usb-audio: claim autodetected PCM interfaces all at once

snd_card_register() registers all devices newly added since the last
call.  However, the playback/capture streams are handled as one ALSA
device, so the second /dev device will not be registered if the PCM
streams are added in two steps.

QUIRK_AUTODETECT caused the probe callback to be called once for each
interface, which triggered this problem.  Work around this by handling
this like the composite quirk, i.e., autodetecting all other interfaces
that might be used for PCM or MIDI.

Signed-off-by: Clemens Ladisch <clemens <at> ladisch.de>
---
 sound/usb/quirks.c | 40 +++++++++++++++++++++++++++++++++++++---
 1 file changed, 37 insertions(+), 3 deletions(-)

diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 5363bcc..5b01330 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
 <at>  <at>  -337,8 +337,7  <at>  <at>  static int create_auto_midi_quirk(struct snd_usb_audio *chip,

 static int create_autodetect_quirk(struct snd_usb_audio *chip,
 				   struct usb_interface *iface,
-				   struct usb_driver *driver,
-				   const struct snd_usb_audio_quirk *quirk)
+				   struct usb_driver *driver)
 {
 	int err;

 <at>  <at>  -348,6 +347,41  <at>  <at>  static int create_autodetect_quirk(struct snd_usb_audio *chip,
(Continue reading)

Clemens Ladisch | 27 Jun 22:19 2013
Picon

[PATCH 5/7] ALSA: usb-audio: remove superfluous Roland quirks

Remove all quirks that are no longer needed now that the generic Roland
quirks can handle the vendor-specific descriptors correctly.

Signed-off-by: Clemens Ladisch <clemens <at> ladisch.de>
---
 sound/usb/quirks-table.h | 471 -----------------------------------------------
 1 file changed, 471 deletions(-)

diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index f1c73fb..da4d87f 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
 <at>  <at>  -1147,7 +1147,6  <at>  <at>  YAMAHA_DEVICE(0x7010, "UB99"),
 		}
 	}
 },
-	/* TODO: add Roland M-1000 support */
 {
 	/*
 	 * Has ID 0x0038 when not in "Advanced Driver" mode;
 <at>  <at>  -1262,7 +1261,6  <at>  <at>  YAMAHA_DEVICE(0x7010, "UB99"),
 		}
 	}
 },
-	/* TODO: add Edirol M-100FX support */
 {
 	/* has ID 0x004e when not in "Advanced Driver" mode */
 	USB_DEVICE(0x0582, 0x004c),
 <at>  <at>  -1382,20 +1380,6  <at>  <at>  YAMAHA_DEVICE(0x7010, "UB99"),
 	}
(Continue reading)

Clemens Ladisch | 27 Jun 22:20 2013
Picon

[PATCH 7/7] ALSA: usb-audio: add quirks for Roland QUAD/OCTO-CAPTURE

The Roland Quad/Octo-Capture devices use some unknown vendor-specific
mechanism to switch sample rates (and to manage other controls).  To
prevent the driver from attempting to use any other than the default
44.1 kHz sample rate, use quirks to hide the other alternate settings.

Signed-off-by: Clemens Ladisch <clemens <at> ladisch.de>
---
 sound/usb/quirks-table.h | 134 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 134 insertions(+)

diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index da4d87f..9c636c2 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
 <at>  <at>  -1581,6 +1581,140  <at>  <at>  YAMAHA_DEVICE(0x7010, "UB99"),
 		}
 	}
 },
+{
+	/* only 44.1 kHz works at the moment */
+	USB_DEVICE(0x0582, 0x0120),
+	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+		/* .vendor_name = "Roland", */
+		/* .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,
(Continue reading)

Takashi Iwai | 28 Jun 12:17 2013
Picon

Re: [git pull] [PATCH 0/7] add support for many Roland and Yamaha devices

At Thu, 27 Jun 2013 22:16:11 +0200,
Clemens Ladisch wrote:
> 
> The following changes since commit f722406faae2d073cc1d01063d1123c35425939e:
> 
>   Linux 3.10-rc1 (2013-05-11 17:14:08 -0700)
> 
> are available in the git repository at:
> 
>   git://git.alsa-project.org/alsa-kprivate.git full-roland-support
> 
> for you to fetch changes up to b7f33917bcd993ff81f3f80b9dc1890fb7410c6d:
> 
>   ALSA: usb-audio: add quirks for Roland QUAD/OCTO-CAPTURE (2013-06-27 21:59:50 +0200)
> 
> ----------------------------------------------------------------
> Clemens Ladisch (7):
>       ALSA: usb-audio: store protocol version in struct audioformat
>       ALSA: usb-audio: detect implicit feedback on Roland devices
>       ALSA: usb-audio: add support for many Roland/Yamaha devices
>       ALSA: usb-audio: add MIDI port names for some Roland devices
>       ALSA: usb-audio: remove superfluous Roland quirks
>       ALSA: usb-audio: claim autodetected PCM interfaces all at once
>       ALSA: usb-audio: add quirks for Roland QUAD/OCTO-CAPTURE

Thanks, pulled now.

Takashi

>  sound/usb/card.h         |   1 +
(Continue reading)

Keith A. Milner | 9 Aug 12:52 2013

Re: [git pull] [PATCH 0/7] add support for many Roland and Yamaha devices

On Thursday 27 Jun 2013 22:16:11 Clemens Ladisch wrote:

> Clemens Ladisch (7):
>       ALSA: usb-audio: store protocol version in struct audioformat
>       ALSA: usb-audio: detect implicit feedback on Roland devices
>       ALSA: usb-audio: add support for many Roland/Yamaha devices
>       ALSA: usb-audio: add MIDI port names for some Roland devices
>       ALSA: usb-audio: remove superfluous Roland quirks
>       ALSA: usb-audio: claim autodetected PCM interfaces all at once
>       ALSA: usb-audio: add quirks for Roland QUAD/OCTO-CAPTURE

As one of the contributors of the original quirks (for the JS-8) , I thought I 
should test this on my device. I can report it appears to work well with no 
obvious regression.

I will mention, if it is of any importance, that I get the following when the 
driver is loaded:

[ 3339.994922] usb 1-6.2: new high-speed USB device number 8 using ehci-pci
[ 3340.089613] snd-usb-audio: probe of 1-6.2:1.2 failed with error -5
[ 3340.118610] Unable to change format on ep #84: already in use
[ 3340.118628] Unable to change format on ep #84: already in use
[ 3340.118719] Unable to change format on ep #84: already in use
[ 3340.118860] Unable to change format on ep #84: already in use
....

This appears to relate to EP 4 IN for Implicit feedback data. However, for all 
practical purposes the device seems to work beautifully for both recording and 
playback.

(Continue reading)

Clemens Ladisch | 9 Aug 15:17 2013
Picon

Re: [git pull] [PATCH 0/7] add support for many Roland and Yamaha devices

Keith A. Milner wrote:
> I will mention, if it is of any importance, that I get the following when the
> driver is loaded:
>
> [ 3340.089613] snd-usb-audio: probe of 1-6.2:1.2 failed with error -5

That looks like the MIDI interface.
Do you have the MIDI ports (see "amidi -l")?
Is there any error message in the system log?

Regards,
Clemens
Keith A. Milner | 9 Aug 17:02 2013

Re: [git pull] [PATCH 0/7] add support for many Roland and Yamaha devices

On Friday 09 Aug 2013 15:17:08 Clemens Ladisch wrote:
> Keith A. Milner wrote:
> > I will mention, if it is of any importance, that I get the following when
> > the driver is loaded:
> > 
> > [ 3340.089613] snd-usb-audio: probe of 1-6.2:1.2 failed with error -5
> 
> That looks like the MIDI interface.
> Do you have the MIDI ports (see "amidi -l")?

No MIDI ports show up. Nor are there any on the device or any that I'm aware 
of that are "internal" to the device.

I will note that on the Boss BR-80 there is an "internal" MIDI port which can 
be used as a drum synth. There appears to be nothing similar on the JS-8.

My original quirk actually had an bug as it included a MIDI endpoint 
definition. This originally worked without error, but in later versions it 
started to error in a similar way, I believe because of later changes to snd-
usb.

From what I can tell, the JS-8 announces a MIDI-like interface, but doesn't 
actually have one.

> Is there any error message in the system log?

Not really. It's pretty uch the same as in dmesg:

Aug  9 15:52:18 KAMDesktop kernel: [ 6374.238016] usb 1-6.2: new high-speed 
USB device number 7 using ehci-pci
(Continue reading)

Clemens Ladisch | 9 Aug 20:18 2013
Picon

Re: [git pull] [PATCH 0/7] add support for many Roland and Yamaha devices

Keith A. Milner wrote:
> On Friday 09 Aug 2013 15:17:08 Clemens Ladisch wrote:
>> Keith A. Milner wrote:
>>> I will mention, if it is of any importance, that I get the following when
>>> the driver is loaded:
>>>
>>> [ 3340.089613] snd-usb-audio: probe of 1-6.2:1.2 failed with error -5
>>
>> That looks like the MIDI interface.
>> Do you have the MIDI ports (see "amidi -l")?
>
> No MIDI ports show up. Nor are there any on the device or any that I'm aware
> of that are "internal" to the device.

The descriptors says there are two ports, and the driver should be able
to detect them.

>> Is there any error message in the system log?
>
> Not really.

Please recompile the kernel with the option "More verbose debug"
(CONFIG_SND_DEBUG_VERBOSE) enabled and try again.

Regards,
Clemens
Keith A. Milner | 10 Aug 14:35 2013

Re: [git pull] [PATCH 0/7] add support for many Roland and Yamaha devices

On Friday 09 Aug 2013 20:18:17 Clemens Ladisch wrote:
> Keith A. Milner wrote:
> > On Friday 09 Aug 2013 15:17:08 Clemens Ladisch wrote:
> >> Keith A. Milner wrote:
> >>> I will mention, if it is of any importance, that I get the following
> >>> when
> >>> the driver is loaded:
> >>> 
> >>> [ 3340.089613] snd-usb-audio: probe of 1-6.2:1.2 failed with error -5
> >> 
> >> That looks like the MIDI interface.
> >> Do you have the MIDI ports (see "amidi -l")?
> > 
> > No MIDI ports show up. Nor are there any on the device or any that I'm
> > aware of that are "internal" to the device.
> 
> The descriptors says there are two ports, and the driver should be able
> to detect them.
> 
> >> Is there any error message in the system log?
> > 
> > Not really.
> 
> Please recompile the kernel with the option "More verbose debug"
> (CONFIG_SND_DEBUG_VERBOSE) enabled and try again.

Done:

Aug 10 13:27:44 KAMDesktop kernel: [  178.594760] usb 1-6.2: new high-speed 
USB device number 7 using ehci-pci
(Continue reading)

Keith A. Milner | 11 Aug 02:10 2013

Re: [git pull] [PATCH 0/7] add support for many Roland and Yamaha devices

I thought I would test the other Roland device I have, the BR-80. FYI I have 
pasted the debug log further down. I will add that this used to work before 
the refactoring.

The device shows up in aplay and arecord:

card 3: BR80AUDIO [BR-80(AUDIO)], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

It does NOT show up in amidi. In this case it should show a MIDI output which 
represents the drum sequencer which it used to.

Also, I cannot get any input or output from the device. If I try to record, I 
get nothing:

$ arecord -Dhw:3 -fS32_LE -c2 -r44100
Recording WAVE 'stdin' : Signed 32 bit Little Endian, Rate 44100 Hz, Stereo
RIFF$�WAVEfmt D�  data�arecord: pcm_read:1801: read error: Input/output error

If I play I get this:

$ aplay -Dhw:3 -fS16_LE -c2 -r44100 Test.wav
Playing WAVE 'Test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
aplay: set_params:1081: Sample format not available
Available formats:
- S32_LE

$ aplay -Dhw:3 -fS32_LE -c2 -r44100 Test.wav
Warning: format has changed to S16_LE
(Continue reading)

Clemens Ladisch | 11 Aug 14:13 2013
Picon

[PATCH] ALSA: usb-audio: fix automatic Roland/Yamaha MIDI detection

Commit aafe77cc45a5 (ALSA: usb-audio: add support for many Roland/Yamaha
devices) had several logic errors that prevented create_auto_midi_quirk
from enumerating any MIDI ports.

Reported-by: Keith A. Milner <maillist <at> superlative.org>
Signed-off-by: Clemens Ladisch <clemens <at> ladisch.de>
---
 sound/usb/quirks.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
 <at>  <at>  -319,19 +319,19  <at>  <at>  static int create_auto_midi_quirk(struct snd_usb_audio *chip,
 	if (altsd->bNumEndpoints < 1)
 		return -ENODEV;
 	epd = get_endpoint(alts, 0);
-	if (!usb_endpoint_xfer_bulk(epd) ||
+	if (!usb_endpoint_xfer_bulk(epd) &&
 	    !usb_endpoint_xfer_int(epd))
 		return -ENODEV;

 	switch (USB_ID_VENDOR(chip->usb_id)) {
 	case 0x0499: /* Yamaha */
 		err = create_yamaha_midi_quirk(chip, iface, driver, alts);
-		if (err < 0 && err != -ENODEV)
+		if (err != -ENODEV)
 			return err;
 		break;
 	case 0x0582: /* Roland */
 		err = create_roland_midi_quirk(chip, iface, driver, alts);
(Continue reading)

Takashi Iwai | 12 Aug 11:41 2013
Picon

Re: [PATCH] ALSA: usb-audio: fix automatic Roland/Yamaha MIDI detection

At Sun, 11 Aug 2013 14:13:13 +0200,
Clemens Ladisch wrote:
> 
> Commit aafe77cc45a5 (ALSA: usb-audio: add support for many Roland/Yamaha
> devices) had several logic errors that prevented create_auto_midi_quirk
> from enumerating any MIDI ports.
> 
> Reported-by: Keith A. Milner <maillist <at> superlative.org>
> Signed-off-by: Clemens Ladisch <clemens <at> ladisch.de>

Thanks, applied.

Takashi

> ---
>  sound/usb/quirks.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> --- a/sound/usb/quirks.c
> +++ b/sound/usb/quirks.c
>  <at>  <at>  -319,19 +319,19  <at>  <at>  static int create_auto_midi_quirk(struct snd_usb_audio *chip,
>  	if (altsd->bNumEndpoints < 1)
>  		return -ENODEV;
>  	epd = get_endpoint(alts, 0);
> -	if (!usb_endpoint_xfer_bulk(epd) ||
> +	if (!usb_endpoint_xfer_bulk(epd) &&
>  	    !usb_endpoint_xfer_int(epd))
>  		return -ENODEV;
> 
>  	switch (USB_ID_VENDOR(chip->usb_id)) {
(Continue reading)

Keith A. Milner | 13 Aug 00:00 2013

Re: [PATCH] ALSA: usb-audio: fix automatic Roland/Yamaha MIDI detection

On Sunday 11 Aug 2013 14:13:13 Clemens Ladisch wrote:
> Commit aafe77cc45a5 (ALSA: usb-audio: add support for many Roland/Yamaha
> devices) had several logic errors that prevented create_auto_midi_quirk
> from enumerating any MIDI ports.
> 
> Reported-by: Keith A. Milner <maillist <at> superlative.org>
> Signed-off-by: Clemens Ladisch <clemens <at> ladisch.de>

I've just got around for testing this. Debug logfile at the bottom.

Playback and record interfaces are correctly listed:

$ aplay -l
...
card 3: JS8 [JS-8], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

$ arecord -l
...
card 3: JS8 [JS-8], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

This time, the MIDI interfaces are also listed:

$ amidi -l
Dir Device    Name
IO  hw:3,0,0  JS-8 MIDI 1
IO  hw:3,0,1  JS-8 MIDI 2
(Continue reading)

Keith A. Milner | 13 Aug 00:38 2013

Re: [PATCH] ALSA: usb-audio: fix automatic Roland/Yamaha MIDI detection

On Sunday 11 Aug 2013 14:13:13 Clemens Ladisch wrote:
> Commit aafe77cc45a5 (ALSA: usb-audio: add support for many Roland/Yamaha
> devices) had several logic errors that prevented create_auto_midi_quirk
> from enumerating any MIDI ports.
> 
> Reported-by: Keith A. Milner <maillist <at> superlative.org>
> Signed-off-by: Clemens Ladisch <clemens <at> ladisch.de>
> ---

I tested this with the BR-80. Logfile at the end.

It lists the devices OK:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
...
card 3: BR80AUDIO [BR-80(AUDIO)], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

$ arecord -l
**** List of CAPTURE Hardware Devices ****
...
card 3: BR80AUDIO [BR-80(AUDIO)], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

$ amidi -l
Dir Device    Name
IO  hw:3,0,0  BR-80(AUDIO) MIDI 1
(Continue reading)

Keith A. Milner | 13 Aug 00:42 2013

Re: [PATCH] ALSA: usb-audio: fix automatic Roland/Yamaha MIDI detection

On Monday 12 Aug 2013 23:38:22 Keith A. Milner wrote:
> On Sunday 11 Aug 2013 14:13:13 Clemens Ladisch wrote:
> > Commit aafe77cc45a5 (ALSA: usb-audio: add support for many Roland/Yamaha
> > devices) had several logic errors that prevented create_auto_midi_quirk
> > from enumerating any MIDI ports.
> > 
> > Reported-by: Keith A. Milner <maillist <at> superlative.org>
> > Signed-off-by: Clemens Ladisch <clemens <at> ladisch.de>
> > ---
> 
> I tested this with the BR-80. Logfile at the end.

I forgot to mention MIDI works well on this device. Sending notes to Ch 10 
plays the onboard drum synth.

Cheers,

Keith
Keith A. Milner | 16 Aug 14:06 2013

Re: [PATCH] ALSA: usb-audio: fix automatic Roland/Yamaha MIDI detection

On Monday 12 Aug 2013 23:38:22 Keith A. Milner wrote:
> On Sunday 11 Aug 2013 14:13:13 Clemens Ladisch wrote:
> > Commit aafe77cc45a5 (ALSA: usb-audio: add support for many Roland/Yamaha
> > devices) had several logic errors that prevented create_auto_midi_quirk
> > from enumerating any MIDI ports.
> > 
> > Reported-by: Keith A. Milner <maillist <at> superlative.org>
> > Signed-off-by: Clemens Ladisch <clemens <at> ladisch.de>
> > ---
> 
> I tested this with the BR-80. Logfile at the end.
> 

<SNIP>

> I do wonder whether a quirk is still needed for this device. It seems to be
> reporting as a 32-bit interface when it's actually only 16-bit, and I
> suspect this might be upsetting things.

With this in mind, I with a kernel where I had inserted the original BR-80 
quirk back into quirks-table.h.

This still didn't work, so there seems to be some other problem, unrelated to 
this patch.

Cheers,

Keith

(Continue reading)

Clemens Ladisch | 11 Aug 14:15 2013
Picon

Re: [git pull] [PATCH 0/7] add support for many Roland and Yamaha devices

Keith A. Milner wrote:
> $ aplay -Dhw:3 -fS16_LE -c2 -r44100 Test.wav

aplay reads the format/channels/rate settings from the .wav file and
ignores your parameters.

> Playing WAVE 'Test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
> aplay: set_params:1081: Sample format not available

Use "plughw" instead of "hw" to get automatic format conversion.

Regards,
Clemens

Gmane