I rarely use Windows, but if I recall correctly, the default “capacity” of a named pipe on Windows is rather small. I have an unproven theory that mod-script-pipe can break if either of the pipes become full, so Python should attempt to read back from Audacity after each command that is sent so as to receive any data that Audacity may have sent.
This is not generally a problem on Linux because named pipes have a much larger default capacity.
(Name pipes are basically special kinds of “files” on Linux. They’re a bit more “magical” on Windows, and are not even part of the normal filesystem.)
No, because the pipe_test.py code was only intended as a quick and dirty test to confirm that mod-script-pipe (the module in Audacity that handles external scripting commands) is working.
The “pipeclient.py” module on the other hand illustrates a much better approach for practical use.
I’m seeing failures with zero messages going in or out of the named pipes other than whatever Audacity might be doing. So while your theory may or may not be valid, it doesn’t seem to have anything to do with the problem I’m seeing.
Let me rephrase my question: Have you tried testing the named pipe functionality on Windows 11 to see if it works reliably for you?
I’m not particular on what Python code to use to access the named pipes so long as it works. I only used the pipe_test.py since it was put out there as the example of using named pipes to Audacity.
The irony is that based on my experience, the pipe_test.py code was does not confirm that mod-script-pipe is working.
If I recall correctly, Process Explorer from sysinternals allows you to inspect named pipes on Windows. Maybe you could get some clues / insight about the problem from that.
I can’t test that script as it is Windows specific and I’m on Linux.
The last version that I tested extensively with Python scripting on Windows was Audacity 2.4.2.
If that version has the same problem for you, then the issue is probably not in Audacity.
On the other hand, if pipes work reliably for you with 2.4.2 (and not with recent versions of Audacity, then that’s a strong indication that there’s a regression bug that needs to be logged and fixed.
I’ve seen multiple reports of problems with macros in Audacity 3.4.0 and 3.4.1. (Macros and scripting share a lot of common code). Trouble shooting an issue in scripting would be near impossible when there are know bugs in the way.
Audacity 3.3.3 is a reasonably recent version of Audacity, but has been around long enough that I would have expected this issue to have been reported before it the problem was in Audacity. I haven’t heard of such bugs, but it’s a small minority of Audacity users that use the scripting feature.
Audacity 2.4.2 is the last version that I’ve tested personally on Windows, and have not seen the issue that you are describing.
As I said in my previous post, If that version has the same problem for you, then the issue is probably not in Audacity. On the other hand, if pipes work reliably for you with 2.4.2 (and not with recent versions of Audacity, then that’s a strong indication that there’s a regression bug that needs to be logged and fixed.
You can log the issue yourself on GitHub (Issues · audacity/audacity · GitHub registration required), but it’s more likely to get the developer’s attention if we could be sure that it’s a regression against a previous version.
I’ve done a clean install of Audacity 2.4.2. I modified my test code to find Audacity in “Program Files (x86)” instead of “Program Files” since that is where 2.4.2 installed into by default.
I’m seeing the same sort of results. Sometimes it take a few more loop than other times:
Opening Audacity
Waiting 5 seconds…
Loop To From
0 open open
1 open open
2 open open
3 open open
4 open open
5 open open
6 CLOSED CLOSED
Opening Audacity
Waiting 5 seconds…
Loop To From
0 open open
1 open open
2 CLOSED CLOSED
Opening Audacity
Waiting 5 seconds…
Loop To From
0 open open
1 open CLOSED
2 CLOSED CLOSED
I’m guessing that you tested Audacity 2.4.2 before Windows 11 came out and that 2.4.2 hasn’t been tested on Windows 11 and therefore this could be an issue with Audacity on Windows 11.
Sure, but we got here because something is not working the way that it “should”.
You could try asking the developers on discord if they can reproduce the problem on Windows 11.
The discord channel is here: Audacity dev (time limited link)