Opened 9 years ago

Closed 9 years ago

#5625 closed bug (fixed)

"MidiPortGlue" missing

Reported by: Pete Owned by: korli
Priority: normal Milestone: R1
Component: Kits/Midi Kit Version: R1/alpha1
Keywords: Cc: pete.goodeve@…, phoudoin
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

In BeOS, an old-style BMidiPort appears (by default) to apps which use the new MidiKit as an endpoint named "MidiPortGlue". In Haiku this doesn't happen. SqueekySynth in particular uses such a port for MIDI input, so there's no way to drive it in Haiku, though it appears to work otherwise.

I'm attaching a bare-bones test app that simply creates a MidiPort and then hangs around until dismissed. Run it under BeOS, and PatchBay immediately shows the associated Midi2 endpoints. Do the same under Haiku (either the BeOS executable or recompiled) and no endpoints are shown.

Attachments (1)

TestPort.cpp (582 bytes) - added by Pete 9 years ago.
Test app to create a BMidiPort

Download all attachments as: .zip

Change History (9)

Changed 9 years ago by Pete

Attachment: TestPort.cpp added

Test app to create a BMidiPort

comment:1 Changed 9 years ago by jackburton

I had a (very brief) look at the BMidiPort code, and it seems it correctly creates an endpoint called MidiPortGlue, so in theory it should work. I guess something goes wrong on the way.

comment:2 Changed 9 years ago by jackburton

Maybe I'm missing something but... are hardware drivers required in order to be able to open a midi port ? If so, that's the problem, I guess. We have no midi hardware drivers in haiku.

comment:3 in reply to:  2 Changed 9 years ago by korli

Replying to jackburton:

Maybe I'm missing something but... are hardware drivers required in order to be able to open a midi port ? If so, that's the problem, I guess. We have no midi hardware drivers in haiku.

I see at least usb_midi as a midi hardware driver.

comment:4 Changed 9 years ago by Pete

It looks like the reason is pretty simple: the "MidiPortGlue" endpoints are never registered!

I added the following lines in the constructor in BMidiPort.cpp, line 32:

    BMidiRoster::Register(fLocalSource);
    BMidiRoster::Register(fLocalSink);

[Easier for me than entering a patch for just two lines... Sorry about the spaces for tabs.]

Now the ports appear in PatchBay as they should, and SqueekySynth appears to be working (if only the audio on my machine wasn't being balky at the moment (:-/)

comment:5 in reply to:  2 Changed 9 years ago by Pete

Replying to jackburton:

Maybe I'm missing something but... are hardware drivers required in order to be able to open a midi port ? If so, that's the problem, I guess. We have no midi hardware drivers in haiku.

Well I'm happily using my MIDI-USB link in Haiku... (:-)) (and the Glue endpoints should appear the moment the port is created -- it doesn't have to be connected to any hardware.)

comment:6 Changed 9 years ago by Pete

Cc: pete.goodeve@… added

comment:7 Changed 9 years ago by phoudoin

Cc: phoudoin added

comment:8 Changed 9 years ago by korli

Resolution: fixed
Status: newclosed

Committed in hrev36019. I added Unregister calls.

Note: See TracTickets for help on using tickets.