Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Single MIDI streaming interface shows up as multiple UMP endpoints. #305

Closed
m-komo opened this issue Apr 2, 2024 · 15 comments
Closed
Assignees
Labels
area-service-or-api 🖥️ Related to the Windows Service, core API, abstractions, etc. dp8-fixed Fixed in developer preview 8 feature request 💡 New feature request or proposal

Comments

@m-komo
Copy link
Collaborator

m-komo commented Apr 2, 2024

Describe the bug
Roland OCTA-CAPTURE is a vendor specific USB MIDI 1.0 device, and it has two MIDI ports named "MIDI" and "CTRL".
The device consists of two MIDI port objects as below:
image

If I enumerate UMP endpoints, two "OCTA-CAPTURE" endpoints show up.
image

However, since the device only has a single USB MIDI stream, it should be configured as a single UMP endpoint.

And also, if I run the "send-message" command on both UMP endpoints, no message was sent out to the USB stream.

This issue may occur not only on the OCTA-CAPTURE but also other devices which have similar topology.

To Reproduce

  1. Attach the Roland OCTA-CAPTURE to the PC and wait for a while for the driver to be installed automatically.
  2. With any MIDI 1.0 app, make sure that two MIDI ports named "MIDI" and "CTRL" exist.
  3. Run 'midi enum ump' to enumerate UMP endpoints for the OCTA-CAPTURE.
  4. Run 'midi endpoint send-message' on any of OCTA-CAPTURE's UMP endpoint.

Expected behavior
Only a single UMP endpoint shows up for OCTA-CAPTURE.
Sent messages are sent out to the USB stream.

Screenshots
Device Properties.zip
Attached file contains two files:

  • Devices on MIDI settings.png: Screenshot of the MIDI settings app.
  • Endpoint Properties.txt: Output of 'midi endpoint properties' command.

Installer Name or Version

  • Service: Windows.MIDI.Services.Developer.Preview.5.x64.1.0.24066.2126.exe
  • Driver: Updated_USBMIDI2_10.0.1.4.zip

Desktop (please complete the following information):

  • OS: Windows 11
  • OS Build: 26090.1

Device information, if this is with an external MIDI device:

@m-komo m-komo added the bug 🐞 Something isn't working label Apr 2, 2024
@m-komo
Copy link
Collaborator Author

m-komo commented Apr 2, 2024

And also, if I run the "send-message" command on both UMP endpoints, no message was sent out to the USB stream.

This was my misunderstanding.
Messages were sent out to the USB stream correctly.

So now, the question is why two UMP endpoints show up? Is this related to the Issue#184?

@Psychlist1972
Copy link
Contributor

@m-komo I assume this shows up as two separate devices under "Sound, video and game controllers" in Device Manager? If so, then it has two separate MIDI streaming interfaces, and we'll see it as two distinct MIDI devices. (Our naming for those devices is not currently correct. I'll need to see the descriptors for this device to see where the names are set).

What I believe is happening here is the device exposes two separate MIDI interfaces, and each has separate pins (pin 0 and 1 from each). It really depends on what the driver is surfacing to us, though.

I don't have one of these devices. Do you have any info on the descriptors it exposes?

@m-komo
Copy link
Collaborator Author

m-komo commented Apr 2, 2024

@Psychlist1972

The device has a single MIDI interface with two endpoints for input and output and it shows up as a single device under "Sound, video and game controllers" in Device Manager.
As you can see in the screenshot of KSStudio, our driver instantiates two port objects to name each port.

I noticed we can reproduce this with the A-88mkII running in the vendor specific mode.

image

Could you try with it?

You can download A-88 mkII driver for Windows from below:
https://www.roland.com/global/support/by_product/a-88mk2/updates_drivers/0de54026-b31b-45ae-9d2c-975247eb01e4/

Please see Owners Manuals to switch the A-88 mkII to the vendor specific mode.
https://www.roland.com/global/products/a-88mk2/support/

@m-komo m-komo changed the title [BUG] Roland OCTA-CAPTURE cannot be used on the new MIDI Service. [BUG] Single MIDI streaming interface shows up as multiple UMP endpoints. Apr 2, 2024
@Psychlist1972
Copy link
Contributor

I'll try this with the A-88mk2. However, Gary explained the logic here. If there are multiple filters, it will show up as multiple endpoints. That's how it works with MIDI 1.0 and the classic APIs.

We can consider different logic here, but it wasn't in our plans to date.

Going to leave this one open not because it's actually a bug (it works today like it did in the past), but it's a behavioral change we can consider implementing.

@Psychlist1972 Psychlist1972 added area-service-or-api 🖥️ Related to the Windows Service, core API, abstractions, etc. under consideration 🤔 Features under consideration needs-investigation 🔍 Needs to be investigated before considering or solving. feature request 💡 New feature request or proposal and removed bug 🐞 Something isn't working labels Apr 6, 2024
@Psychlist1972 Psychlist1972 added this to the 99.99 - Future milestone Apr 6, 2024
@m-komo
Copy link
Collaborator Author

m-komo commented Apr 9, 2024

Implementing multiple filters is common way to name each MIDI port.
In fact, there are same cases with several third-party vendor products.

As you pointed, it should work fine with applications which use the classic APIs (MIDI 1.0 APIs).
However, there are some concerns when using the MIDI 2.0 APIs.

  • Since all filters are configured as UMP endpoints with the same name, it is impossible to distinguish which MIDI port each UMP endpoint connects to.

  • It is not possible to sort-out and manage messages by group number when playing and recording UMP messages to/from multiple UMP endpoints.

Followings are possible examples of what happens if a single MIDI 1.0 streaming interface is divided to multiple UMP endpoints:

  • It is not possible to play back a data which contains UMP messages with multiple group numbers, such as a MIDI Clip file, on a single UMP endpoint.

  • When recording UMP messages from multiple UMP endpoints, all UMP messages are received with a same group number (group index 0). Recorded UMP messages cannot be merged and saved without re-setting group number.

These will be an obstacle and a limitation to using existing MIDI 1.0 devices from applications that use MIDI 2.0 APIs.
I don't know how to do it, but we need to find some kind of solution.

@dmiura
Copy link
Collaborator

dmiura commented Apr 11, 2024

Yamaha also check it with our product Montage(not Montage M) which use vendor USB MIDI 1.0 driver.
Montage has 3 ports.
Vendor Driver: https://usa.yamaha.com/support/updates/yamaha_steinberg_usb_driver_for_win.html

Result: midi.exe shows 3 UMP Endpoint with same name.
Unknown

Also we checked using ksstudio, it shows three separated name, like MONTAGE-1, MONTAGE-2 and MONTAGE-3.
Unknown

@Psychlist1972
Copy link
Contributor

Naming is not yet finalized because Gary and Julia are re-doing the MIDI 1.0 enumeration code (main issue right now is devices only show up if they have a single in and a single out). But it's good to know that you use the filters for naming, instead of iJack. So many ways to provide names for devices, unfortunately.

@Psychlist1972
Copy link
Contributor

I'm bringing the filter thing back to Gary and Julia for consideration. I don't know if this can work within the Windows USB structure, and what will happen if other devices use filters in other ways, but they will know.

@MusicMaker
Copy link

MusicMaker commented Apr 15, 2024

@m-komo do you have a USB device & config descriptor(s) descriptor dump ? Would like to experiment with that.

@m-komo
Copy link
Collaborator Author

m-komo commented Apr 15, 2024

Hi @MusicMaker,
I have attached the descriptor dump file.
Since it is the vendor specific class, it may not be helpful for you.
A-88MK2.txt

@Psychlist1972
Copy link
Contributor

This has been implemented in DP8. See details in #456

@MusicMaker
Copy link

Question, Shouldn't vendor specific devices still use their legacy driver and then be handled by the service instead of the class compliant MIDI 2.0 driver ?

@Psychlist1972
Copy link
Contributor

Question, Shouldn't vendor specific devices still use their legacy driver and then be handled by the service instead of the class compliant MIDI 2.0 driver ?

A vendor-specific device that is not class-compliant cannot use the UMP USB MIDI 2.0 class driver

The KS (Kernel Streaming) transport handles anything which is attached to the new UMP driver, both MIDI 1.0 Class-compliant and MIDI 2.0 Class-compliant devices.

The KSA (Kernel Streaming Aggregate) transport handles anything which is a kernel streaming driver that exposes one or more MIDI 1.0 byte format pins. That includes vendor-specific MIDI 1.0 devices as well as the older MIDI 1.0 class driver.

We don't automatically repoint, at least for now, MIDI 1.0 class-compliant devices to the new UMP class driver, even though the new driver is faster and can support them. We may do that in a future release once we're sure about compatibility, but there can be cases with older MIDI devices where they make assumptions about being part of the USB Audio Class 1 driver, which would break some or all functionality if they are assigned to the new separated UMP driver. Technical users are able to repoint their class-compliant MIDI 1.0 devices to the new driver manually if they want to.

@garydan42
Copy link
Collaborator

garydan42 commented Dec 8, 2024 via email

@Psychlist1972 Psychlist1972 removed under consideration 🤔 Features under consideration needs-investigation 🔍 Needs to be investigated before considering or solving. labels Dec 9, 2024
@Psychlist1972
Copy link
Contributor

DP8 now shows a single physical device with multiple KS filters/endpoints as a single device when using vendor or class MIDI 1.0 drivers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-service-or-api 🖥️ Related to the Windows Service, core API, abstractions, etc. dp8-fixed Fixed in developer preview 8 feature request 💡 New feature request or proposal
Projects
Status: No status
Development

No branches or pull requests

5 participants