Menu

#1681 ALSA Midi autoconnect is totally unpredictable

None
feedback
ALSA (2)
5
2024-05-20
2024-02-23
Lorenzo
No

I get this issue when working with Rosegarden and Yoshimi. Typically I will first open Rosegarden then yoshimi (if I'm woking on an existing file I will load that and then connect to Yoshimi).

Rosegarden will connect all of its midi outs including 'sync out' and 'external controller' to Yoshimi's single midi input. This also happens if I load a file where a single connection to Yoshimi was created.

In Yoshimi the side effect is that I think when rosegarden connects it sends all sorts of midi controller messages which essentially break anything which had already been set-up, so I need disconnect unwanted midi connections, leave the actual wanted one and then reload the Yoshimi state file (if I had saved it, otherwise my tweaking is trashed).

Expected behaviour:
- If a new Alsa midi application is launched do nothing (or at least provide an option to do nothing), do not assume I want to connect to it, also because rosegarden can't assume how many midi out ports I have etc.
- If I load an existing file, try to figure out what was connected when I saved that file, if the right application / ports are found connect only those, otherwise don't connect anything

In the attached screengrab you can see what happens just starting Yoshimi with Rosegarden open on a blank file

1 Attachments

Discussion

  • Philip Leishman

    Philip Leishman - 2024-02-26

    I don't believe this is a rosegarden problem.
    If you check your yoshimi settings in the alsa tab - if the connection type is "Search" (the default) the yoshimi documentation says it "will accept input from any Alsa sources it can find".
    I switched the setting to "Fixed" and set 130:2 as the midi source - this was the rosegarden port (I don't know if rosegarden will always use this port).
    After that yoshimi only connected to rosegarden on startup.

     
  • Lorenzo

    Lorenzo - 2024-02-26

    Hi Philip, thanks for testing this, and indeed you are right! I would have never found that setting in Yoshimi to be honest (and had never used it), but it seemed to be the culprit.

    I did set Yoshimi's setting to "External" and now when opening a rosegarden file which had a yoshimi connection it inded seems to work.

    Rosegarden (or Yoshimi??) still seem to 'auto-connect' the "General MIDI" output to when starting Rosegarden. I even tried to explicitly save the autoload.rg file (in $HOME/.local/share/rosegarden/autoload without the connection. But again now wondering if this is on the Rosegarden or Yoshimi side.

     
  • Philip Leishman

    Philip Leishman - 2024-02-26

    The Yoshimi documentation claims that with External setting no connections will be made.
    If I start Rosegarden and then Yoshimi no connection is made.
    If I start Yoshimi and then Rosegarden then Yoshimi is connected to the Rosegarden out port.
    I think when Rosegarden starts it somehow selects a midi port to connect to (not sure about the logic here).
    So in the second case the connection is coming from Rosegarden!
    Can you live with this behaviour ?

     
  • Lorenzo

    Lorenzo - 2024-02-29

    I guess I can, thanks for looking into this. I'll investigate the Yoshimi side of it.

     
  • Lorenzo

    Lorenzo - 2024-02-29

    It would still be nice to 'predict' what Rosegarden does in terms of auto-connection because often the connection comes with firing CC events etc. and could disrupt something like a soft synth's settings

     
  • Philip Leishman

    Philip Leishman - 2024-02-29

    I believe Rosegarden auto connects when a new document is started (load or new)
    Rosegarden then chooses the first unconnected device it finds.
    See AlsaDriver::connectSomething

     
  • Ted Felix

    Ted Felix - 2024-05-16

    @lorenzosu, have you tried replacing autoload.rg with a composition that has no MIDI tracks and no MIDI devices? That might be a better starting point for you. That should prevent anything from going out at rg startup and file > new. There's also a setting in the preferences to disable CC121 (Reset All Controllers). I think you can get to where you want to be. Let us know if there's anything else that's going out that you don't want.

     
  • Ted Felix

    Ted Felix - 2024-05-16
    • labels: --> ALSA
    • status: open --> feedback
    • assigned_to: Philip Leishman
     
  • Lorenzo

    Lorenzo - 2024-05-17

    Hi @tedfelix,
    I can't seem to remove all MIDI track (and therefore devices). When I try to remove a device I get an error that it's being used by n tracks and therefore cannot be removed; but then there seems to have to be at least one track.

    I did try to save the autoload.rg file with all connections removed. But when I do new 'something' really wants to autoconnect to whatever is there (I've tried with e.g. Yoshimi, Fluidsynth).

    I'm attaching my current autoload.rg

     
  • Ted Felix

    Ted Felix - 2024-05-20

    You'll need to delete all the MIDI tracks first, then delete the MIDI device. Save and use that as your autoload.rg. I just did this and it works fine. Nothing goes out because nothing can go out. See attached.

    You can try deleting all the audio tracks too. We should support no tracks at all. That would be a more realistic expert starting point anyway.

     

Log in to post a comment.