git-moss / DrivenByMoss

Bitwig Studio extensions for many controllers: Ableton Push I/II, Akai APC40mkI/mkII/mini, Fire, Arturia Beatstep, Novation Launchpads / Remote SLs, NI Maschine / Komplete, Open Sound Control (OSC) and many more.
https://www.mossgrabers.de/Software/Bitwig/Bitwig.html
GNU Lesser General Public License v3.0
585 stars 142 forks source link

Reaper freezes after opening the editor #407

Closed domha91 closed 2 months ago

domha91 commented 3 months ago

Not sure if this is the right place to post, happy to be directed elsewhere. I am running Pop OS! 22.04 LTS with Pipewire and I use Qjackctl with JACK 1.9.20, I have a Launchpad mini mk3 with latest firmware and the latest DrivenByMoss 4 Reaper.

When using REAPER 7.15, when I edit the DrivenByMoss4Reaper control surface, it brings up the control surface configuration, and I detect the Novation Launchkey Mini Mk3, however it says by default that "MK3 [hw 1,0,1]" is not present. I can select Mk3 [hw:2,0,1] and Mk3 [hw:2,0,0] but it does not make a difference, all of the windows of REAPER basically become either extremely slow or completely unresponsive and I have to restart my PC. I cannot use the Launchpad as a control surface but it does work as a normal midi controller, i.e. I can enter midi notes fine.

Any idea what could be causing this conflict? I have not found anything about it online.

git-moss commented 3 months ago

Did you deactivate the MIDI in-/outputs of the Launchpad in Reaper? Also maybe JACK did grab the MIDI ports?

domha91 commented 3 months ago

Yes as far as I can see, they are not connected to anything, most of the time I don't bridge JACK and ALSA MIDI but even when I do, they do not show any connections. I have gone through the instructions and connected the control surface and this is what I see. Here is the drivenByMossConfig settings: drivenByMossConfig Here is what I see in qjackctl:

qjackctl

And here I have ignored the midi inputs/ outputs from the Launchpad in the REAPER MIDI settings. REAPERMIDI

This is what I see when I run the JACK and ALSA MIDI bridge and check the connections, I can't see any there jackoutput.txt

git-moss commented 3 months ago

In the MIDI Output list in DrivenByMoss. Are there any Launchpad ports at all?

domha91 commented 3 months ago

Yes, so I tried it again after enabling a2jmidi and JACK before opening REAPER and was able to get to a different screen, both Midi Input 1 and Midi Output 1 have MK3 [hw:5,0,0] and MK3[hw:5.0.1] available.

This is what I see now:

Screenshot from 2024-07-05 12-32-47

This is what JACK is showing for connections:

qjackctl2

However it still crashes REAPER, where I can't close any of the dialog windows or REAPER itself

This is output in the logging section:

Loading device INI files from /home/domha91/.config/REAPER ... DrivenByMoss4Reaper-ParameterMaps.ini not present (this is not an error!). Novation Launchpad Mini MkIII: MIDI output device not configured. Novation Launchpad Mini MkIII: MIDI output device not configured. Novation Launchpad Mini MkIII: Starting... Midi not available. javax.sound.midi.MidiUnavailableException: Device or resource busy at java.desktop/com.sun.media.sound.MidiOutDevice.nOpen(Native Method) at java.desktop/com.sun.media.sound.MidiOutDevice.implOpen(Unknown Source) at java.desktop/com.sun.media.sound.AbstractMidiDevice.doOpen(Unknown Source) at java.desktop/com.sun.media.sound.AbstractMidiDevice.open(Unknown Source) at de.mossgrabers.reaper.framework.midi.MidiConnection.setOutput(MidiConnection.java:77) at de.mossgrabers.reaper.framework.midi.MidiAccessImpl.createOutput(MidiAccessImpl.java:76) at de.mossgrabers.reaper.framework.midi.MidiAccessImpl.createOutput(MidiAccessImpl.java:68) at de.mossgrabers.controller.novation.launchpad.LaunchpadControllerSetup.createSurface(LaunchpadControllerSetup.java:200) at de.mossgrabers.framework.controller.AbstractControllerSetup.init(AbstractControllerSetup.java:138) at de.mossgrabers.reaper.controller.AbstractControllerInstance.delayedStart(AbstractControllerInstance.java:366) at de.mossgrabers.reaper.ui.utils.SafeRunLater.lambda$execute$0(SafeRunLater.java:37) at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.desktop/java.awt.EventQueue$4.run(Unknown Source) at java.desktop/java.awt.EventQueue$4.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

Midi not available. javax.sound.midi.MidiUnavailableException: Device or resource busy at java.desktop/com.sun.media.sound.MidiInDevice.nOpen(Native Method) at java.desktop/com.sun.media.sound.MidiInDevice.implOpen(Unknown Source) at java.desktop/com.sun.media.sound.AbstractMidiDevice.doOpen(Unknown Source) at java.desktop/com.sun.media.sound.AbstractMidiDevice.open(Unknown Source) at de.mossgrabers.reaper.framework.midi.MidiConnection.setInput(MidiConnection.java:116) at de.mossgrabers.reaper.framework.midi.MidiInputImpl.(MidiInputImpl.java:82) at de.mossgrabers.reaper.framework.midi.MidiAccessImpl.createInput(MidiAccessImpl.java:93) at de.mossgrabers.reaper.framework.midi.MidiAccessImpl.createInput(MidiAccessImpl.java:85) at de.mossgrabers.controller.novation.launchpad.LaunchpadControllerSetup.createSurface(LaunchpadControllerSetup.java:201) at de.mossgrabers.framework.controller.AbstractControllerSetup.init(AbstractControllerSetup.java:138) at de.mossgrabers.reaper.controller.AbstractControllerInstance.delayedStart(AbstractControllerInstance.java:366) at de.mossgrabers.reaper.ui.utils.SafeRunLater.lambda$execute$0(SafeRunLater.java:37) at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.desktop/java.awt.EventQueue$4.run(Unknown Source) at java.desktop/java.awt.EventQueue$4.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

Novation Launchpad Mini MkIII: Running. Storing configuration... Closing controller... Exited. Release resources... Closing MIDI connections...

git-moss commented 3 months ago

Looks to me as if JACK is grabbing the MIDI ports but I am not Linux expert enough to give you any advice with that.

hoergen commented 3 months ago

It is not clear for me why you are using jack, when you have a running pipewire session. Because pipewire is ABI and API compatible to jack .. and in 99,99% the better choice, especially because jack often do exclusive locks on devices.

If you need a patchbay other than qjackctl then use qpwgraph. It is also available as flatpak. BTW as far as I remember, you don't have to run jack to be able to use qjackctl. So if there is no specific reason to use jack, don't use it anymore. It is outdated.

Two Questions:

  1. Which version of pipewire are you using?
  2. Didi you use a2jmidid with the "-e" option?
    [-e | --export-hw](https://man.archlinux.org/man/a2jmidid.1.en#e)
    forces a2jmidid to bridge hardware ports as well as software ports

I don't know reaper and how it handles access to your audio device and midi ports, but normally you can use ALSA or Jack aka Pipewire for audio and midi. So I only can assume what is happening here. But your screenshots look like, that you want to use ALSA Midi Ports that are locked by a2jmidid (jack) . Because it shows the hardware addresses.

In QJackctl you don't see hardware addresses. Instead you see generated node names.

So to sum it up.

  1. ALSA is serving your hardware
  2. You setup jack to run on ALSA
  3. Pipewire is ready configured and will suspend itself, as soon as you start a jack server
  4. In Reaper you want to use ALSA Midi Ports that are exclusively locked to the jack server configuration

That wont work, as you experienced it.

It should look like

  1. ALSA running
  2. Pipewire running
  3. Reaper using Midi Ports from pipewire (jack ABI)

If you don't see Midi Ports in Reaper, then check your pipewire version. I don't know PopOS 22.04 but I am sure that such an important package like pipewire will have backports available for that version.

If all that fails ...

I am sure Reaper is cabable of using ALSA directly. That would use exclusively your audio and midi hardware, so you can't watch youtube, music with e.g. vlc or other media trying to output sound. But you are able to make some funky music :)

domha91 commented 3 months ago

Hi thank you both for taking a look.

To answer your questions, when I run pipewire --version, it says "pipewire Compiled with libpipewire 1.0.2 Linked with libpipewire 1.0.2", and yes i did use use a2jmidid with the "-e" option.

This system is about 4 years old and outdated, originally I was just routing supercollider into REAPER but I don't use that much any more, and I cannot seem to find any guide for switching over to use Pipewire with the JACK ABI. I don't really want to reinstall the OS and start from scratch, but yes it looks to be a "me problem" :))

Either when i run pw-jack reaper with JACK enabled in the audio devices in REAPER or when I use ALSA and use the Launchpad as the control surface, i get one step further but not all the way. It does not detect the Launchpad but I can add it and then I can see the pads on the Launchpad change, and there are no errors in the logging section, but it still crashes REAPER when I try to exit out of the control surfaces window. I have even tried running Pulseaudio but I get the same result.

qpwgraph looks good and I am using that currently. I appreciate this is completely beyond your support now but do you think maybe removing JACK entirely and using ALSA would be a solution? I have made a restore point so I can try anything. If not, I will probably just buy a new computer and start again when I have completed some projects on this one, haha.