Bug 196633

Summary: Boss Katana MIDI regression
Product: Drivers Reporter: beanow
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: RESOLVED CODE_FIX    
Severity: normal CC: beanow, tiwai
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 4.13-rc4 Subsystem:
Regression: Yes Bisected commit-id:
Attachments: select SND_SEQ_MIDI
working config
faulty config
Fix patch

Description beanow 2017-08-10 12:01:02 UTC
While still functional in 4.12, I find the Boss Katana MIDI interface broke in 4.13. Plugging in the device outputs the following in dmesg.

> [   45.095439] usb 1-12: new high-speed USB device number 4 using xhci_hcd
> [   45.239751] usb 1-12: New USB device found, idVendor=0582, idProduct=01d8
> [   45.239756] usb 1-12: New USB device strings: Mfr=1, Product=2,
> SerialNumber=0
> [   45.239759] usb 1-12: Product: KATANA
> [   45.239761] usb 1-12: Manufacturer: BOSS
> [   45.300244] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.300309] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.300362] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.300411] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.300461] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.300981] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.301032] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.301083] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.301131] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.301180] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.301714] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.301776] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.301843] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.301901] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.301966] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.302650] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.302723] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.302799] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.302864] usb 1-12: Unable to change format on ep #8e: already in use
> [   45.302939] usb 1-12: Unable to change format on ep #8e: already in use

Both aplaymidi -l and arecordmidi -l no longer list the Katana MIDI ports.

The device is very similar to other Boss/Roland devices:
- if1 = audio
- if2 = audio
- if3 = midi

I will try to find the commit causing the issue.
Comment 1 beanow 2017-08-10 15:41:59 UTC
I've narrowed down the MIDI issue to 7f8a01b77b5be996d0665d5eb7be8645f3ecb217
"Merge branch 'topic/seq-kconfig' into for-next"

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7f8a01b77b5be996d0665d5eb7be8645f3ecb217

Using the commit before that (7531d8fda27731ca188bcaa32c822b0f682cfb75) I still get the "Unable to change format" messages, but the MIDI devices show up.

Using 7f8a01b77b5be996d0665d5eb7be8645f3ecb217 the MIDI devices don't show up.
Comment 2 Takashi Iwai 2017-08-10 17:48:52 UTC
(In reply to beanow from comment #1)
> I've narrowed down the MIDI issue to 7f8a01b77b5be996d0665d5eb7be8645f3ecb217
> "Merge branch 'topic/seq-kconfig' into for-next"
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=7f8a01b77b5be996d0665d5eb7be8645f3ecb217
> 
> Using the commit before that (7531d8fda27731ca188bcaa32c822b0f682cfb75) I
> still get the "Unable to change format" messages, but the MIDI devices show
> up.
> 
> Using 7f8a01b77b5be996d0665d5eb7be8645f3ecb217 the MIDI devices don't show
> up.

If this is the culprit, it's likely the kernel config issue.  Please give your kernel config.

The kernel messages about ep 8e should be a red herring, which is likely seen in the older kernels, too.
Comment 3 beanow 2017-08-10 18:16:19 UTC
I'm suspecting CONFIG_SND_SEQ_MIDI at the moment.
Installing 4.13-rc4 with Ubuntu's config http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13-rc4/

The sound/core/seq/snd-seq-midi.ko module is missing.

> $ tree /lib/modules/4.13.0-041300rc4-generic/kernel/sound/core
> /lib/modules/4.13.0-041300rc4-generic/kernel/sound/core
> ├── oss
> │   └── snd-mixer-oss.ko
> ├── seq
> │   ├── snd-seq-dummy.ko
> │   ├── snd-seq.ko
> │   ├── snd-seq-midi-emul.ko
> │   ├── snd-seq-midi-event.ko
> │   └── snd-seq-virmidi.ko
> ├── snd-compress.ko
> ├── snd-hrtimer.ko
> ├── snd-hwdep.ko
> ├── snd.ko
> ├── snd-pcm-dmaengine.ko
> ├── snd-pcm.ko
> ├── snd-rawmidi.ko
> ├── snd-seq-device.ko
> └── snd-timer.ko

I had just started a new build with different configs so give me a second to confirm and give you a full copy of the config.
Comment 4 beanow 2017-08-10 19:06:39 UTC
Created attachment 257875 [details]
select SND_SEQ_MIDI

Yes, it's related to CONFIG_SND_SEQ_MIDI.
By default when I use make xconfig, there are no options available that will cause SND_SEQ_MIDI to also be enabled.

Running $ cat .config | grep CONFIG_SND_SEQ_MIDI=
Gives no results.

Selecting it by default (as per attached patch) fixes the issue for me.
As it adds CONFIG_SND_SEQ_MIDI=m to my config.
Comment 5 Takashi Iwai 2017-08-10 20:35:59 UTC
Could you give your kernel config please...?
Comment 6 beanow 2017-08-10 22:26:32 UTC
Created attachment 257877 [details]
working config

This is a config without the issue (applied patch).
Comment 7 beanow 2017-08-10 22:29:30 UTC
Created attachment 257879 [details]
faulty config

Config without the patch applied.
Comment 8 Takashi Iwai 2017-08-11 07:55:04 UTC
Thanks.  The fix patch is below.  Please give it a try.
Comment 9 Takashi Iwai 2017-08-11 07:55:37 UTC
Created attachment 257885 [details]
Fix patch
Comment 10 beanow 2017-08-11 09:10:54 UTC
Thank you. This patch works for me.
Comment 11 Takashi Iwai 2017-08-11 09:20:08 UTC
OK, the fix was submitted and merged now.  It'll be likely included in 4.13-rc6 (too late for rc5).