2017-05-03 18:02:48

by Robert Schneider

[permalink] [raw]
Subject: KORG nanoKONTROL Studio MIDI over Bluetooth problem

Hi,
I'm trying to get my KORG nanoKONTROL Studio working with the current BlueZ
stack (GIT as of May 3rd).
However, it seems the bonding fails for some reason.

May 3 19:48:30 Maui bluetoothd[32743]: src/adapter.c:bonding_attempt_complete()
hci0 bdaddr 60:F1:89:28:DA:1F type 1 status 0x5
May 3 19:48:30 Maui bluetoothd[32743]: src/device.c:device_bonding_complete()
bonding (nil) status 0x05
May 3 19:48:30 Maui bluetoothd[32743]: src/device.c:device_bonding_failed()
status 5
May 3 19:48:30 Maui bluetoothd[32743]: src/adapter.c:resume_discovery()
May 3 19:48:30 Maui bluetoothd[32743]: src/adapter.c:dev_disconnected() Device
60:F1:89:28:DA:1F disconnected, reason 2
May 3 19:48:30 Maui bluetoothd[32743]: src/adapter.c:adapter_remove_connection()
May 3 19:48:30 Maui bluetoothd[32743]: plugins/policy.c:disconnect_cb() reason 2
May 3 19:48:30 Maui bluetoothd[32743]: src/adapter.c:bonding_attempt_complete()
hci0 bdaddr 60:F1:89:28:DA:1F type 1 status 0xe
May 3 19:48:30 Maui bluetoothd[32743]: src/device.c:device_bonding_complete()
bonding (nil) status 0x0e
May 3 19:48:30 Maui bluetoothd[32743]: src/device.c:device_bonding_failed()
status 14
May 3 19:48:30 Maui bluetoothd[32743]: src/adapter.c:resume_discovery()
May 3 19:48:30 Maui bluetoothd[32743]: MIDI I/O: Failed to read initial request

I do not have any thorough bluetooth skill. Could somebody look at the attached
log and point me into some direction?
I restarted bluetoothd freshly with nothing in /var/lib/bluetooth.
Thanks in advance and best regards,
Robert


Attachments:
Korg-nanoKONTROL-Studio-bluetooth.log (56.36 kB)
Robert_Schneider.vcf (167.00 B)
Download all attachments

2017-05-04 11:51:49

by Felipe Ferreri Tonello

[permalink] [raw]
Subject: Re: KORG nanoKONTROL Studio MIDI over Bluetooth problem

Hi Dave,

On 03/05/17 19:02, Robert Schneider wrote:
> Hi,
> I'm trying to get my KORG nanoKONTROL Studio working with the current
> BlueZ stack (GIT as of May 3rd).
> However, it seems the bonding fails for some reason.
>
> May 3 19:48:30 Maui bluetoothd[32743]:
> src/adapter.c:bonding_attempt_complete() hci0 bdaddr 60:F1:89:28:DA:1F
> type 1 status 0x5
> May 3 19:48:30 Maui bluetoothd[32743]:
> src/device.c:device_bonding_complete() bonding (nil) status 0x05
> May 3 19:48:30 Maui bluetoothd[32743]:
> src/device.c:device_bonding_failed() status 5
> May 3 19:48:30 Maui bluetoothd[32743]: src/adapter.c:resume_discovery()
> May 3 19:48:30 Maui bluetoothd[32743]: src/adapter.c:dev_disconnected()
> Device 60:F1:89:28:DA:1F disconnected, reason 2
> May 3 19:48:30 Maui bluetoothd[32743]:
> src/adapter.c:adapter_remove_connection()
> May 3 19:48:30 Maui bluetoothd[32743]: plugins/policy.c:disconnect_cb()
> reason 2
> May 3 19:48:30 Maui bluetoothd[32743]:
> src/adapter.c:bonding_attempt_complete() hci0 bdaddr 60:F1:89:28:DA:1F
> type 1 status 0xe
> May 3 19:48:30 Maui bluetoothd[32743]:
> src/device.c:device_bonding_complete() bonding (nil) status 0x0e
> May 3 19:48:30 Maui bluetoothd[32743]:
> src/device.c:device_bonding_failed() status 14
> May 3 19:48:30 Maui bluetoothd[32743]: src/adapter.c:resume_discovery()
> May 3 19:48:30 Maui bluetoothd[32743]: MIDI I/O: Failed to read initial
> request
>
> I do not have any thorough bluetooth skill. Could somebody look at the
> attached log and point me into some direction?
> I restarted bluetoothd freshly with nothing in /var/lib/bluetooth.

I looked into the log, and it appears that the driver is working correctly.
It setups the profile for each device that it knows, it accepts the
connection when that happens. Then it tries to make the initial MIDI I/O
characteristic read, which returns an error.

Apparently the nanoKONTROL is not allowing the central to read the
initial value, which is defined in the specification as part of the
connection procedure.

Another problem I also noticed is that it does connect/disconnect very
often, which might indicate a connection parameter problem. I am
currently working on that at the Kernel level.

To work-around it, try doing this[1] as described in my blog post.

[1]
https://blog.felipetonello.com/2017/01/13/midi-over-bluetooth-low-energy-on-linux-finally-accepted/

--
Felipe


Attachments:
0x92698E6A.asc (7.01 kB)

2017-08-20 10:59:26

by Andreas Wettergren

[permalink] [raw]
Subject: Re: KORG nanoKONTROL Studio MIDI over Bluetooth problem

Hello,

I just got a NanoKontrol Studio and I'm experiencing the same
problems/symptoms as Robert did back in May.

I get both "MIDI I/O: Failed to read initial request" in the logs, and
frequent disconnects.

I've tried playing around with MinInterval/MaxInterval (as well as
Latency and Timeout) as suggested by Felipe, but I can't seem to get it
working properly.

However, by the logs from btmon, hcidump and bluetoothd, it seems like
the main problem is that I keep getting timeouts, and Bluez disconnects
for that reason.

The best result so far is that the midi device ports have appeared
briefly in aseqdump / Catia (not the CAD package, the one from KXStudio),
so it would seem there is a chance to get this working if I can just
prevent the timeouts/disconnections.

I've tried reading up a bit on what exactly the parameters do, and sort
of get the idea, but the details are still a bit hazy.
I'm just not sure how to proceed in the most rational way at this point.
(Blindly trying arbitrary numbers is probably not going to work well :) )

My questions are:

@Robert:

Did you get your nanoKontrol Studio to connect/work properly in the end?
If so, would you care to share which Connection Parameters you used?

@Felipe:

Is there any point in pursuing this at the moment, or do you think "MIDI
I/O: Failed to read initial request" might be a showstopper?

This is my understanding so far;
The interval values are multiplied by 1.25 to get the actual millisecond
value, thus 6 => 7.5 ms.
The latency value is the number of non-responses the stack will tolerate
before giving up on the connection.
The timeout value is in 10 ms increments, so for example 200 => 2000 ms
timeout.
Is the above correct?

Are the rules in chapter 3.6 of Apples design guidelines relevant, or
are they not applicable to the Bluez stack?
(https://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf.
I made a spreadsheet to test for legal combinations, it seems the valid
ranges are pretty narrow)

Finally, should I just try bumping MaxInterval (and maybe MinInterval)
until I see a change in behavior,
and leave Latency and Timeout at 0/200?

(I suppose I’ve changed the values a bit haphazardly up til now, a more
methodical approach might help, I’ll give that a try.)

I can see that changing timeout changes the period between disconnects,
but I can't seem to increase it enough to have them go away.

Many thanks for your work on this, and any help will be greatly appreciated.

Best regards

/Andreas

PS. I'm running Debian testing/unstable, Bluez 5.45-1, kernel is
4.11.0-2-rt-amd64, BT USB adapter is a Cambridge 0a12:0001, HCI 4.0.