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

Under NSM, midi port contains nsm client id, but sometimes not #407

Open
grammoboy2 opened this issue Dec 8, 2024 · 9 comments
Open

Under NSM, midi port contains nsm client id, but sometimes not #407

grammoboy2 opened this issue Dec 8, 2024 · 9 comments

Comments

@grammoboy2
Copy link

grammoboy2 commented Dec 8, 2024

Using
jackd 2
a2jmidid -eu
Zyn 3.0.7

Most of the time the midi port of Zyn fusion contains the nsm client id, but sometimes not, which make reconnecting unreliable.

The last one has no nsm id, see below. I've encountered this several times.

I could not replicate this with drumkv1_jack or non-sequencer.
jack_lsp:

ZynAddSubFX.nAJHP:out_1
ZynAddSubFX.nAJHP:out_2
ZynAddSubFX.nAJHP:osc
a2j:ZynAddSubFX nAJHP (playback): ZynAddSubFX
ZynAddSubFX.nGMOB:out_1
ZynAddSubFX.nGMOB:out_2
ZynAddSubFX.nGMOB:osc
a2j:ZynAddSubFX nGMOB (playback): ZynAddSubFX
ZynAddSubFX.nRWTL:out_1
ZynAddSubFX.nRWTL:out_2
ZynAddSubFX.nRWTL:osc
a2j:ZynAddSubFX (playback): ZynAddSubFX

also

port_name "a2j:ZynAddSubFX (playback): ZynAddSubFX" already exists
ERROR: a2j_port_create: jack_port_register() failed for 'ZynAddSubFX (playback): ZynAddSubFX'
@grammoboy2
Copy link
Author

grammoboy2 commented Dec 8, 2024

Ok, I just could replicate it with drumkv1_jack after a few launches.

a2j:drumkv1 nMXER (playback): in
... 
... 
a2j:drumkv1 (playback): in

@grammoboy2 grammoboy2 reopened this Dec 9, 2024
@grammoboy2
Copy link
Author

probably a bug in https://github.com/jackaudio/a2jmidid

@grammoboy2
Copy link
Author

Still trying to debug this, maybe it is cause by the application: is Zynaddsubfx maybe changing it's ALSA port name, when it find the NSM_URL? I see the port name change in njconnect. The same for drumkv1.

@grammoboy2 grammoboy2 reopened this Dec 12, 2024
@grammoboy2
Copy link
Author

grammoboy2 commented Dec 13, 2024

I think the bug is in zynaddsubfx and drumkv1

client name: 'ZynAddSubFX'
port name: 'ZynAddSubFX'
port created: ZynAddSubFX (playback): ZynAddSubFX
port deleted: ZynAddSubFX (playback): ZynAddSubFX
client name: 'ZynAddSubFX.nLTOJ'
port name: 'ZynAddSubFX'
port created: ZynAddSubFX.nLTOJ (playback): ZynAddSubFX

This is the output of a2jmidid. It looks there is one port deleted just before a other is created. I don't see this when using seq192 or qmidiarp and I can't reproduce the issue with those applications.

@grammoboy2
Copy link
Author

So, when it gets the open message from the NSM server, it renames or recreates the ALSA MIDI port? @fundamental

Is it possible to build zynaddsubfx/ zyn-fusion with JACK MIDI only by the way? How?

@grammoboy2
Copy link
Author

Is it possible to build zynaddsubfx/ zyn-fusion with JACK MIDI only by the way? How?

It looks like ALSA midi is set to default here:

https://github.com/zynaddsubfx/zynaddsubfx/blob/master/src/CMakeLists.txt#L83
https://github.com/zynaddsubfx/zynaddsubfx/blob/master/src/CMakeLists.txt#L146

cmake option -D AlsaEnable=OFF

@fundamental
Copy link
Member

Is it possible to build zynaddsubfx/ zyn-fusion with JACK MIDI only by the way? How?

You can as per today's message disable other MIDI backends, though there will always be the NULL MIDI fallback backend. Just in case you were asking about jack MIDI without jack audio, that specifically wouldn't be possible, but I suspect that wasn't the original question.

@grammoboy2
Copy link
Author

I've enjoyed Zynaddsubfx with JACK MIDI today. Nice that it's available (shouldn't JACK MIDI be the default?).

What about my diagnosis: the ALSA MIDI port name of Zynaddsubfx changes when the it handles the NSM open message? (Fix: It shouldn't already set the ALSA MIDI client / port name when it finds NSM_URL in the environment? )

What do you think is happening here?

@fundamental
Copy link
Member

shouldn't JACK MIDI be the default?

General impressions from users is that the primary users were for quite some time physical MIDI device users where JACK complicated things, but you'd want to target JACK for a more reliable audio backend and then users who were typically going to want to use the plugin version. So, the defaults are optimized mostly for those to use cases.

What about my diagnosis: the ALSA MIDI port name of Zynaddsubfx changes when the it handles the NSM open message?

I see in NSM.C that on the open command the audio+midi interfaces are stopped and then restarted after changing 'instance_name'. 'instance_name' is used in AlsaEngine.cpp and is fed into 'snd_seq_set_client_name'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants