How can I create two bi-directional audio pipes in PulseAudio or JACK?

CONTEXT:
I want to test a software that normally communicates over radio but without actually involving the radio communication. The program has audio input and output normally connected to the radio. I want to run two instances and let them communicate only using their audio inputs and outputs.

SETUP:

[Instance 1]: output --> virtual sink 1 --> virtual source 1 --> input: [Instance 2] 
            : input <--- virtual source 2 <-- virtual sink 2 <-- output:

QUESTION:

What has to be done to create the virtual audio devices?

NOTE for Pipewire fans: I am NOT asking about Pipewire.

Read more here: Source link