hydrogen-music / hydrogen

The advanced drum machine for Linux, macOS, and Windows
http://www.hydrogen-music.org
GNU General Public License v2.0
1.04k stars 173 forks source link

JACK MIDI ports not added to application #422

Open simonvanderveldt opened 7 years ago

simonvanderveldt commented 7 years ago

I'm running Hydrogen 0.9.7-beta2 and seeing some strange behavior with the JACK MIDI ports. When I start Hydrogen I get a separate hydrogen-midi application in JACK/ladish next to the regular Hydrogen application. The hydrogen-midi application contains the MIDI ports whereas the Hydrogen application contains the JACK audio ports. See screenshot below from gladish image The same is visible in QjackCtl.

This should obviously not be the case :)

Also, because of this if I start Hydrogen as part of a ladish project it will only show the Hydrogen application and don't show the hydrogen-midi application at all, which means it's impossible to route MIDI signals to it.

xjjx commented 7 years ago

That's because in H2 audio driver and midi driver are independent. You can for example use Jack audio driver with ALSA MIDI. Unfortunatelly hydrogen-midi driver is not a JackSession client, at least because JackSession require command to "resurrect" client, but in this case application is already started i.e. JackSession idea do not include applications with multiple clients ( one client = one application ). To change this we would somehow "combine" Audio/MIDI in H2. IMHO we can assume that when use choose Jack as audio driver it want use JackMIDI. OTOH JackMIDI driver should require JackAudio and it should have "handle" to it's object ( I'm not sure if in currect design AudioDriver is passed to MIDI driver , but I doubt ). This is conceptual question and I believe that @mauser will be best person to answer / reject or propose better solution.

simonvanderveldt commented 7 years ago

@xjjx thanks for the quick response. I think it makes sense to use JACK audio when you choose the use JACK MIDI, the other way around might not always be the case since some people use ALSA MIDI combined with JACK audio. Let's see what @mauser thinks about it.

xjjx commented 7 years ago

Please give me one reasonable example when one need to use ALSA MIDI when it use Jack Audio.

simonvanderveldt commented 7 years ago

Please give me one reasonable example when one need to use ALSA MIDI when it use Jack Audio.

It's just something I have read multiple times, people using ALSA for MIDI and JACK for audio. It's something that QjackCtl enables you to do, and since that's still the default/starting point for a lot of people, maybe that's what gets them to use it? I have no clue why, I very much prefer to have everything in JACK.

trebmuh commented 7 years ago

On a linux system, one shouldn't have to care too much about that since one can use a bridge between MIDI-ALSA and MIDI-JACK (such as a2jmidid). Isn't?

xjjx commented 7 years ago

Exactly ;-) Also in current jack1 ( don't know about jack2 status ) - a2jmidid has been merged as midi driver - so pure jack server is enough to cover all midi needs. Maybe with small exception for big SysEx messages, but this is not the case in H2.

mauser commented 7 years ago

Hi everyone!

Pawel has already explained much of the topic in a very good manner. Thanks for that! I have to admit that i'm not a user of any session management magic (not a big user of hydrogen at all lately..) so i have never noticed this kind of problem.

It should be technically possible to re-use the jack audio client if jack midi is beeing used. I have to check if the locking works and how we're accessing the clients..

mauser commented 7 years ago

I've got that working locally, as you can see in the attached screenshot. I have to read up some things in the jack documentation until i can create a "stable" first attempt :)

jackmidiclient

simonvanderveldt commented 7 years ago

That's awesome! Thanks for the update.

aleeusgr commented 6 years ago

Hey, guys, dunno if it helps anyone, but I got it to work by marking "Run in Terminal" checkbox in gladish and adding --verbose option.

trebmuh commented 6 years ago

(quick testing update with a fresh build from git master https://github.com/hydrogen-music/hydrogen/commit/5556c8dbc2a2c58f1441281739eab444273861d0)

If I'm to select the JackMIDI driver, I've got 2 different boxes for H2: one for audio and one for jackmidi as following

hydrogen-jackmidi

When selecting alsamidi, I've got everything in the same box as following:

hydrogen-alsamidi

Hope that it (somehow) helps.