diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2015-11-16 00:38:29 +0300 |
---|---|---|
committer | Luis Henriques <luis.henriques@canonical.com> | 2015-12-18 19:06:26 +0300 |
commit | 88a851469c11995d05049655a4bb0e1ffd127463 (patch) | |
tree | aa1de5fe640f878c92544aed6df8c53e75aa129a /sound/usb/midi.c | |
parent | 0726f2ef15e3bc6dd92772796c3cc3227406966d (diff) | |
download | linux-88a851469c11995d05049655a4bb0e1ffd127463.tar.xz |
ALSA: usb-audio: prevent CH345 multiport output SysEx corruption
commit 1ca8b201309d842642f221db7f02f71c0af5be2d upstream.
The CH345 USB MIDI chip has two output ports. However, they are
multiplexed through one pin, and the number of ports cannot be reduced
even for hardware that implements only one connector, so for those
devices, data sent to either port ends up on the same hardware output.
This becomes a problem when both ports are used at the same time, as
longer MIDI commands (such as SysEx messages) are likely to be
interrupted by messages from the other port, and thus to get lost.
It would not be possible for the driver to detect how many ports the
device actually has, except that in practice, _all_ devices built with
the CH345 have only one port. So we can just ignore the device's
descriptors, and hardcode one output port.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Diffstat (limited to 'sound/usb/midi.c')
-rw-r--r-- | sound/usb/midi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/usb/midi.c b/sound/usb/midi.c index d09088727e5f..3f1838732b95 100644 --- a/sound/usb/midi.c +++ b/sound/usb/midi.c @@ -2294,6 +2294,9 @@ int snd_usbmidi_create(struct snd_card *card, err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); break; + case QUIRK_MIDI_CH345: + err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); + break; default: dev_err(&umidi->dev->dev, "invalid quirk type %d\n", quirk->type); err = -ENXIO; |