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

Handling ports disconnecting #10

Open
6r1d opened this issue Mar 3, 2021 · 2 comments
Open

Handling ports disconnecting #10

6r1d opened this issue Mar 3, 2021 · 2 comments
Labels
enhancement New feature or request low priority

Comments

@6r1d
Copy link
Owner

6r1d commented Mar 3, 2021

As it is, RMR does not track ports disconnecting; I have to add some utility code for that.

I am not sure what indicators of disconnection are available.
Are connections and disconnections described by SND_SEQ_EVENT_PORT_SUBSCRIBED and SND_SEQ_EVENT_PORT_UNSUBSCRIBED events?

@6r1d 6r1d changed the title Handling port disconnecting Handling ports disconnecting Mar 3, 2021
@6r1d 6r1d added enhancement New feature or request low priority labels Mar 3, 2021
@6r1d
Copy link
Owner Author

6r1d commented Mar 7, 2021

I did a tiny test with VMPK.

When I pick a port in a dialog and enter it, I catch a SND_SEQ_EVENT_PORT_SUBSCRIBED event in alsa_MIDI_handler.
When I exit VMPK, I catch a SND_SEQ_EVENT_PORT_UNSUBSCRIBED event in alsa_MIDI_handler.
I also catch ``SND_SEQ_EVENT_PORT_SUBSCRIBED` when I reopen VMPK.

Then I repeated it with RMR (virtual input and normal output) and the result is the same. It subscribes, unsibscribes, no "SND_SEQ_EVENT_PORT_EXIT".

Trying to catch exit, I tried RMR yet again, now with virtual output and normal input modes.
When I close a virtual output port, it "unsubscribes", no "SND_SEQ_EVENT_PORT_EXIT" firing. Now that is interesting!


I think all these events are related to the port only, not to a client. Next thing to do is to try and intercept SND_SEQ_EVENT_CLIENT_START and SND_SEQ_EVENT_CLIENT_EXIT.

@6r1d
Copy link
Owner Author

6r1d commented Mar 7, 2021

I tried to catch a SND_SEQ_EVENT_CLIENT_START and SND_SEQ_EVENT_CLIENT_EXIT events with a "virtual output to input" mode. It failed.

Then I tried "output to virtual input" configuration.
It also throws port subscription / unsibscription events.

My current conclusion: I'll have to redesign the output to run in a duplex mode later so I can know if I can detect SND_SEQ_EVENT_CLIENT_START and SND_SEQ_EVENT_CLIENT_EXIT events, but I am currently not sure that has any worth. Alternatively, I can try this alsa example to see if it shows how SND_SEQ_EVENT_CLIENT_EXIT event is thrown: seq-decoder.c.

@6r1d 6r1d mentioned this issue Mar 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low priority
Projects
None yet
Development

No branches or pull requests

1 participant