Boss MS-3 - MIDI over USB Sysex Reverse Engineering

Started by MrHaroldA, August 29, 2017, 12:13:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MrHaroldA

#75
I've updated  effect_state example to keep trying to gather all data. The initial check is quite high, but I guess my queue overloads severely ;) Fixed in the latest revision.

All checks after that average around 150 tries to get 13 effect states ...

Ready!


Found all 13 effect states in 19560 tries.
FX1:  OFF
MOD1: OFF
L1:   OFF
L2:   OFF
L3:   OFF
FX2:  ON
MOD2: OFF
DLY:  OFF
REV:  OFF
NS:   ON
SOLO: OFF
CTL1: OFF
CTL2: OFF

Loaded patch 1. Checking all effect states.

Found all 13 effect states in 143 tries.
FX1:  ON
MOD1: ON
L1:   ON
L2:   ON
L3:   ON
FX2:  ON
MOD2: ON
DLY:  ON
REV:  ON
NS:   ON
SOLO: OFF
CTL1: OFF
CTL2: OFF

Loaded patch 2. Checking all effect states.

Found all 13 effect states in 143 tries.
FX1:  OFF
MOD1: OFF
L1:   OFF
L2:   OFF
L3:   OFF
FX2:  OFF
MOD2: OFF
DLY:  OFF
REV:  OFF
NS:   OFF
SOLO: OFF
CTL1: OFF
CTL2: OFF

Loaded patch 3. Checking all effect states.

Found all 13 effect states in 189 tries.
FX1:  OFF
MOD1: OFF
L1:   OFF
L2:   OFF
L3:   OFF
FX2:  OFF
MOD2: OFF
DLY:  OFF
REV:  OFF
NS:   OFF
SOLO: OFF
CTL1: OFF
CTL2: OFF


This now is quite a good test for measuring how much incoming data my implementation, or even the midi host library loses.
Boss MS-3 and Katana library for Arduino: https://github.com/MrHaroldA/MS3

MrHaroldA

Found it! I was adding double items to the queue before the queue was empty, and I was picking up items from the queue before the timeout was over ...  ::)


Ready!

Loaded patch 0. Found all 13 effect states in 13 tries.
FX1:  OFF
MOD1: OFF
L1:   OFF
L2:   OFF
L3:   OFF
FX2:  ON
MOD2: OFF
DLY:  OFF
REV:  OFF
NS:   ON
SOLO: OFF
CTL1: OFF
CTL2: OFF

Loaded patch 1. Found all 13 effect states in 13 tries.
FX1:  ON
MOD1: ON
L1:   ON
L2:   ON
L3:   ON
FX2:  ON
MOD2: ON
DLY:  ON
REV:  ON
NS:   ON
SOLO: OFF
CTL1: OFF
CTL2: OFF

Loaded patch 2. Found all 13 effect states in 13 tries.
FX1:  OFF
MOD1: OFF
L1:   OFF
L2:   OFF
L3:   OFF
FX2:  OFF
MOD2: OFF
DLY:  OFF
REV:  OFF
NS:   OFF
SOLO: OFF
CTL1: OFF
CTL2: OFF

Loaded patch 3. Found all 13 effect states in 13 tries.
FX1:  OFF
MOD1: OFF
L1:   OFF
L2:   OFF
L3:   OFF
FX2:  OFF
MOD2: OFF
DLY:  OFF
REV:  OFF
NS:   OFF
SOLO: OFF
CTL1: OFF
CTL2: OFF


Is anybody reading along my monolog? You all seem awfully quiet ...
Boss MS-3 and Katana library for Arduino: https://github.com/MrHaroldA/MS3

Elantric

I read each and every post

( click here:  and bookmark)

Show All Recent Posts
https://www.vguitarforums.com/smf/index.php?action=recent


glad to hear you located your problem

gumtown

Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

MrHaroldA

Well, I think i'm kinda done with the library ;) I even made some sort of Wiki for it!

Receiving bulk data is still an issue, but debugging and improving the USB Host library is out-of-scope for now.

I'll try to focus on implementing the library and actually using my MS-3 now  ;)


Anybody looked at, or tried my library yet?
Boss MS-3 and Katana library for Arduino: https://github.com/MrHaroldA/MS3

MrHaroldA

Quote from: sixeight on October 21, 2017, 11:20:06 AM
The same thing may happen that also happens with the Arduino midi library. There is only one buffer used for midi in messages. The buffer is filled through an interrupt routine triggered by receiving midi data. So it could be that the code is reading a message, but while it is processing the data it is written over by the next message through the interrupt routine.

I have seen this happen with the VController when it is reading Zoom devices. I am considering changing the midi library to support multiple midi buffers. But I am still investigating the issue.

@sixeight, can you please log an issue on the USB_Host_Shield_2.0 issue queue for this? I think I run into this regularly, but I have no idea how to fix this nicely.


And @vit3k, your input is requested here: https://github.com/felis/USB_Host_Shield_2.0/issues/313#issuecomment-340712691
Boss MS-3 and Katana library for Arduino: https://github.com/MrHaroldA/MS3

sixeight

Quote from: MrHaroldA on November 10, 2017, 01:15:19 AM
@sixeight, can you please log an issue on the USB_Host_Shield_2.0 issue queue for this? I think I run into this regularly, but I have no idea how to fix this nicely.

I don't have a USB host shield, so it is not a good idea to post an issue or fix if I am unable to test any of it.

It may be a better idea to post your problem and your code on the Arduino or Teensy forum.

I have not changed the serial midi sysex queue in the midi library after all. I was able to solve my problems by improving the loop time and do a check on expected length of sysex answers. In some cases the VController will ask for the same data twice now on serial3, but at least things are running ok again.