RomeoDespres/reapy

ConnectionResetError when calling reapy.Project() for a second time.

colin-vandervort opened this issue · 2 comments

Hey there,

I'm trying to automate a VO/Dialog processing workflow. The automated workflow uses three render passes.

For the first pass, I'm launching reaper from a python script, grabbing the active project (via reapy.Project(), and kicking off the first few rendering steps.

For the second pass, in the same python script, I'm kicking off a reaper Headless render (normalization pass).

In the third pass (again, from the same python script), I'm opening a new reaper session, and attempting to capture this active project, again via reapy.Project(). This pass just handles some trimming & top/tail fades.

Each individual render pass executes as desired, in isolation, but when I try and run each function sequentially, I run into the aforementioned ConnectionResetError, when reapy tries to grab the second active session via reapy.Project().

Has anyone encountered this, or have any suggestions for work arounds?
Thanks!

[Windows 11, Python 3.10.7, Reapy 0.10.0]

MicrosoftTeams-image

I can say, what is the reason, but I cannot say right now, how to avoid it.
I think, the reason is — the socket is being still opened for a while after reaper going down. So when the second instance raised up — it can not open web interface for reapy.

I've managed this once with local development of more than one machine connection script, so I've had also a portable copy of reaper with the different port for reapy.

Anyway, for the beginning, you can try to use:

from time import wait
import reapy

[code above]

wait(2)
reapy.reconnect()

project = reapy.Project()

But I'm not sure this will fix your issue.

Doesn't solve the issue in this case, but I did find a work-around for my specific instance.

Appreciate the suggestion!