linux/sound/usb
Clemens Ladisch a91e627e3f ALSA: usb-audio: work around CH345 input SysEx corruption
One of the many faults of the QinHeng CH345 USB MIDI interface chip is
that it does not handle received SysEx messages correctly -- every second
event packet has a wrong code index number, which is the one from the last
seen message, instead of 4.  For example, the two messages "FE F0 01 02 03
04 05 06 07 08 09 0A 0B 0C 0D 0E F7" result in the following event
packets:

correct:       CH345:
0F FE 00 00    0F FE 00 00
04 F0 01 02    04 F0 01 02
04 03 04 05    0F 03 04 05
04 06 07 08    04 06 07 08
04 09 0A 0B    0F 09 0A 0B
04 0C 0D 0E    04 0C 0D 0E
05 F7 00 00    05 F7 00 00

A class-compliant driver must interpret an event packet with CIN 15 as
having a single data byte, so the other two bytes would be ignored.  The
message received by the host would then be missing two bytes out of six;
in this example, "F0 01 02 03 06 07 08 09 0C 0D 0E F7".

These corrupted SysEx event packages contain only data bytes, while the
CH345 uses event packets with a correct CIN value only for messages with
a status byte, so it is possible to distinguish between these two cases by
checking for the presence of this status byte.

(Other bugs in the CH345's input handling, such as the corruption resulting
from running status, cannot be worked around.)

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: stable@vger.kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-11-16 08:59:29 +01:00
..
6fire
bcd2000 ALSA: bcd2000: Make local data static 2015-05-26 13:00:01 +02:00
caiaq ALSA: snd-usb-caiaq: fix stream count check 2015-01-05 08:56:19 +01:00
hiface
line6 ALSA: line6: Fix -EBUSY error during active monitoring 2015-07-14 15:19:37 +02:00
misc
usx2y ALSA: usx2y: Move UAPI definition into include/uapi/sound/usb_stream.h 2015-01-28 17:33:49 +01:00
card.c ALSA: usb-audio: Handle normal and auto-suspend equally 2015-08-26 16:12:25 +02:00
card.h ALSA: USB-audio: Add quirk for Zoom R16/24 playback 2015-10-19 12:38:09 +02:00
clock.c ALSA: usb-audio: Don't attempt to get Lifecam HD-5000 sample rate 2015-02-17 07:20:04 +01:00
clock.h
debug.h
endpoint.c ALSA: USB-audio: Adjust max packet size calculation for tx_length_quirk 2015-10-19 12:38:10 +02:00
endpoint.h
format.c ALSA: usb-audio: Fix audio output on Roland SC-D70 sound module 2015-04-21 07:59:10 +02:00
format.h
helper.c
helper.h
Kconfig ALSA: move line6 usb driver into sound/usb 2015-01-12 22:29:57 +01:00
Makefile ALSA: line6: Split to each driver 2015-01-20 08:14:17 +01:00
midi.c ALSA: usb-audio: work around CH345 input SysEx corruption 2015-11-16 08:59:29 +01:00
midi.h
mixer_maps.c ALSA: usb-audio: add dB range mapping for some devices 2015-07-29 09:28:02 +02:00
mixer_quirks.c ALSA: usb-audio: harmless underflow in snd_audigy2nx_led_put() 2015-09-28 14:33:03 +02:00
mixer_quirks.h
mixer_scarlett.c ALSA: usb-audio: Fix Scarlett 6i6 initialization typo 2014-12-18 08:39:17 +01:00
mixer_scarlett.h
mixer.c ALSA: usb-audio: correct the value cache check. 2015-08-28 10:38:25 +02:00
mixer.h ALSA: usb-audio: Fix parameter block size for UAC2 control requests 2015-08-14 16:26:50 +02:00
pcm.c ALSA: USB-audio: Add quirk for Zoom R16/24 playback 2015-10-19 12:38:09 +02:00
pcm.h
power.h
proc.c ALSA: usb-audio: Avoid nested autoresume calls 2015-08-26 15:38:25 +02:00
proc.h
quirks-table.h ALSA: usb-audio: prevent CH345 multiport output SysEx corruption 2015-11-16 08:59:24 +01:00
quirks.c ALSA: usb-audio: prevent CH345 multiport output SysEx corruption 2015-11-16 08:59:24 +01:00
quirks.h ALSA: usb-audio: Don't attempt to get Lifecam HD-5000 sample rate 2015-02-17 07:20:04 +01:00
stream.c ALSA: USB-audio: Add quirk for Zoom R16/24 playback 2015-10-19 12:38:09 +02:00
stream.h
usbaudio.h ALSA: usb-audio: prevent CH345 multiport output SysEx corruption 2015-11-16 08:59:24 +01:00