Most efficient record and play

What is the most efficient setup to accept input on the IN 1/4" plug and send to OUT 1/4" plug while recording to a file?

I have tried a couple of solutions using ALSA and SoX but as soon as I add the recording the live sounds goes fuzzy. Any pointers or suggestions would be appreciated.

Claude

Hi, use Jack backend and jack_capture utility for capturing audio to a file. To get the input directly to the output, just connect the capture and playback ports in Jack backend using jack_connect or a visual tool like Patchage.

Jack backend is pre-installed and configured on Patchbox OS image.