REW multiple instances on Linux

giacomus

New Member
Thread Starter
Joined
Nov 13, 2024
Posts
6
More  
Preamp, Processor or Receiver
Classe CP-800
Main Amp
Classe CA-2200
Additional Amp
Classe CA-2200
DAC
Bryston BDA-2
Computer Audio
Intel NUC
Streaming Subscriptions
Qobuz
Front Speakers
B&W 801 Nautilus
Cables
Van Den Hul Supernova
Audioquest Yukon, etc..
Hello.
I think that multiple instances on Linux would be a great feature, given the necessity of analyzing and working with several measurements also for different configurations (e.g. sets of measurements for different speaker positioning).
Each instance may host tens of measurements so having multiple REW windows, distributed across different Linux virtual desktops would be an excellent option.
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Posts
8,131
The REW installer only specifies single/multiple instances on Windows, otherwise it relies on the OS behaviour.
 

giacomus

New Member
Thread Starter
Joined
Nov 13, 2024
Posts
6
More  
Preamp, Processor or Receiver
Classe CP-800
Main Amp
Classe CA-2200
Additional Amp
Classe CA-2200
DAC
Bryston BDA-2
Computer Audio
Intel NUC
Streaming Subscriptions
Qobuz
Front Speakers
B&W 801 Nautilus
Cables
Van Den Hul Supernova
Audioquest Yukon, etc..
The REW installer only specifies single/multiple instances on Windows, otherwise it relies on the OS behaviour.
Thanks John, and congratulations for Your great job with REW. It's simply amazing.
As a software developer, I know this is a programmer's choice. I understand the need of a unique instance when accessing the hardware, but for the pure analysis purpose I think multiple instances can be an option.
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Posts
8,131
There's nothing in REW that enforces single instance. It's possible the installer shell script has some content that requests that, but that isn't behaviour the installation packager (install4j) exposes. The .sh file could be edited if there's some aspect you wish to change.
 

phofman

Member
Joined
Jun 26, 2019
Posts
186
IMO there is nothing in the roomeqwizard shell script which checks for a running REW instance. However, the first REW instance checks and creates (if not found) a lock file & notify dir in /tmp

Code:
pavel@precision:~/REW$ strace -f /home/pavel/REW/jre/bin/java -Xms128m -Xmx3072m -Dsun.java2d.opengl=False -classpath /home/pavel/REW/.install4j/i4jruntime.jar:/home/pavel/REW/.install4j/launcherd9d2fef3.jar:/home/pavel/REW/./* install4j.roomeqwizard.RoomEQ_Wizard
....
[pid 1010640] openat(AT_FDCWD, "/tmp/i4j_at3lrPyykWVHrB8r-Nj_DNJMvpw=.lock", O_RDWR|O_CREAT, 0666) = 17
[pid 1010640] fstat(17, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
...
[pid 1010640] mkdir("/tmp/i4j_at3lrPyykWVHrB8r-Nj_DNJMvpw=.notify", 0777 <unfinished ...>

Indeed, these entries are created in /tmp:

Code:
pavel@precision:/tmp$ ls -l /tmp/i4j*
-rw-rw-r-- 1 pavel pavel    0 Nov 27 18:18 '/tmp/i4j_at3lrPyykWVHrB8r-Nj_DNJMvpw=.lock'

'/tmp/i4j_at3lrPyykWVHrB8r-Nj_DNJMvpw=.notify':
total 0


The next REW instance does check the lock file too (as confirmed with strace). If it finds them, it quits. If the /tmp/i4j_at3lrPyykWVHrB8r-Nj_DNJMvpw=.lock and /tmp/i4j_at3lrPyykWVHrB8r-Nj_DNJMvpw=.notify entries are manually deleted after the first instance starts up, a second instance starts up OK, creating the lock structures (with the very same name, that random-looking lock name is not random). Another manual delete -> another instance running.

So the hack/solution seems to be just adding rm -rf /tmp/i4j_* at the beginning of the launching roomeqwizard script.

IMO the install4j wrapper does make sure no other install4j->REW process gets started up.
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Posts
8,131
That must be something the install4j launcher does. REW has it's own startup file, but it's only used to detect a failure to shut down normally.
 

phofman

Member
Joined
Jun 26, 2019
Posts
186
Yes it most likely does the install4j wrapper as the lock names start with i4j. The install4j jar launches the REW startup class internally in java, the bash script roomeqwizard does not call any REW-specific jar.
 
Top Bottom