helgoboss / helgobox

Helgobox: ReaLearn & Playtime
https://www.helgoboss.org/projects/helgobox
GNU General Public License v3.0
204 stars 20 forks source link

Installing ReaLearn on Windows might put controller to "sleep" until it's listened to as input for the first time #693

Open balintlaczko opened 1 year ago

balintlaczko commented 1 year ago

Hi there, and thanks for this amazing project! I started exploring ReaLearn on my Windows 10 system, only to see MIDI breaking completely in Reaper shortly after installing ReaLearn (via ReaPack). After I first installed ReaLearn, I couldn't immediately test it (I was on a train), but the next time I opened Reaper I noticed the issue. My controller is a Novation Launch Control XL. It wasn't just ReaLearn that would not pick up MIDI coming from it, it went silent across Reaper (whereas before it was always rock solid). It was working still perfectly in Max. Reaper saw the device, it was enabled + control, everything showed up as should, only it looked like as if the device went silent. Uninstalling ReaLearn via ReaPack and reinstalling (or resetting) Reaper didn't fix this, but completely wiping the Reaper resource folder (+ uninstalling, then reinstalling) fixed it. MIDI was back. Then I installed SWS, ReaPack, and finally ReaLearn again, restarted Reaper and finally it all seemed to work. I made my mappings and saved all my projects. The next time I opened Reaper (which was shortly before the concert, haha) I found that the same thing happened again: the MIDI input from my controller went completely silent in Reaper, while still working perfectly in Max. (I never used Reaper and Max simultaneously, I am aware that one can take MIDI exclusively preventing input in the other.) So I speed-uninstalled-wiped-reinstalled Reaper to get MIDI back and set up a quick mapping via actions for the gig. But I would still very much like to use ReaLearn and figure out what the problem might be, maybe this could also help some other future users. Do you have any tips that I should look into? Thanks a lot! :)

helgoboss commented 1 year ago

Oh man, that sounds aweful, happening before a concert.

I never had such an issue and I don't see any way in which ReaLearn could ever break MIDI ... except maybe this one: If you set control input to a certain device (not FX input), by default, ReaLearn will filter all matching events OUT of the stream and makes sure that they don't arrive on REAPER tracks. But this is a feature, not a bug. You can change this behavior using the "Let through" checkboxes. Does it maybe work again if you check "Let through matched"?

helgoboss commented 1 year ago

Another thing: Don't enable the MIDI input device "+ control", just enable it normally. Also, make sure your MIDI device isn't used elsewhere, e.g. in the "Control surface" section of the REAPER preferences or in any other software (e.g. some editor or Max). This usually doesn't work well.

balintlaczko commented 1 year ago

Thanks so much for the quick feedback! Both points are relevant, I did probably misunderstand ReaLearn and set the input from FX to Launch Control XL. And indeed the device was enabled for control as well. But even when I restarted Reaper and started a new project to test MIDI (without any instance of ReaLearn) it was still silent. It's also curious why it was necessary for the fix to wipe the Reaper resources folder. I'll test now with disabling control and only using FX input in the ReaLearn instance. I'll report back here! :))

helgoboss commented 1 year ago

Okay. Just a note: You don't need to use <FX input>. Setting "Control input" to a particular device is good and the normal way of doing things, you just need to pay attention to the "Let through" checkboxes.

helgoboss commented 1 year ago

But even when I restarted Reaper and started a new project to test MIDI (without any instance of ReaLearn) it was still silent. It's also curious why it was necessary for the fix to wipe the Reaper resources folder.

That's indeed very strange and rather indicates that ReaLearn is not the issue here. One more thing you could check: Do you have a ReaLearn instance on the monitoring FX chain? It would stay there even if you create a completely new project.

balintlaczko commented 1 year ago

Okay, so it happened again, but finally found the "solution", or to make it go away. This time after installing ReaPack, and then ReaLearn I restarted Reaper. I never even used any ReaLearn instance, but MIDI input from my controller was broken straight away (or well, silent). Then, I added a new virtual instrument track with a ReaSynth to test if the buttons are also "silent". Not only they were not, but they also somehow "woke the faders up", and after that, they worked as well. Both within ReaLearn and without, just using the normal MIDI facilities, all things work. What's more delightful, that after subsequent Reaper restarts and new test projects, the issue does not happen again, so waking the faders up once after the initial installation seems to be enough. It would look like this is an issue unrelated to ReaLearn, but then again, it never happened before I installed it, and it consistently happens every time I install it again, so it's might be worth looking into. I finally get to enjoy using this fantastic Reaper extension, thanks so much for the great work!!

helgoboss commented 1 year ago

I never even used any ReaLearn instance, but MIDI input from my controller was broken straight away (or well, silent).

Not sure I understand. How could you tell that the MIDI input is broken if you didn't put it to use yet? I mean, in order to use the MIDI controller, you need to let it control something, e.g. by adding a virtual instrument, which you then did it in the next step and then - as expected - it worked. Moving some faders on a MIDI controller initially is supposed to do nothing. You first have to put it to use somehow.

balintlaczko commented 1 year ago

Sorry, yes, I wasn't clear there. So after installing ReaLearn (but never opening an instance of it) Reaper's basic MIDI learn function (like mapping a fader to the gain slider of a ReaEQ) and the previously mapped actions (the "set track volume via MIDI CC" thing) were not working. For these you don't need to listen to MIDI input, they just work normally when the controller is enabled for control (and the mappings are set up).

helgoboss commented 1 year ago

Ah okay. To be honest, I don't know how ReaLearn could have any influence on that. Especially if it never has been opened, then that's kind of technically impossible ... although that's not completely true. Whenever a VST instrument such as ReaLearn is installed, REAPER scans it on startup and that scanning actually "opens" the plug-in in a way. So there's that. But I have no idea now how this could screw MIDI devices and I never experienced it myself. I'll keep this in mind and maybe try to reproduce this on my Windows machine (completely uninstall and reinstall).

I would rather suspect a connection issue that by coincidence occurred after you installed ReaLearn, but who knows. Sometimes, "Reset all MIDI devices" in the preferences does wonders.

balintlaczko commented 1 year ago

I would rather suspect a connection issue that by coincidence occurred after you installed ReaLearn, but who knows. Sometimes, "Reset all MIDI devices" in the preferences does wonders.

It happens consistently right after I install ReaLearn, and I haven't had this problem before. I tried earlier the Reset all MIDI devices, it didn't help. Not even resetting or reinstalling Reaper by itself, only if I also wiped the Reaper resource folder.

BUT! The very simple fix is just to listen to the MIDI controller as actual input on a track (instead of using it for control only), which somehow wakes it up and fixes the control issue for good.

Now that I could explore it a bit, I can tell that ReaLearn is absolutely amazing, and adds a huge chunk of much needed functionality to Reaper.

helgoboss commented 1 year ago

Thanks, will look into it at some point!

7enz commented 1 year ago

is it possible the USB port is being suspended, which might account for the device going to sleep? problem can occur on windows OS things to check are the USB suspend settings in the advanced setting of the power options

balintlaczko commented 1 year ago

No, USB suspend is/was turned off. And the device was working in other software (Max). So it was only "sleeping" within Reaper, until it has been listened to at least once as input.