Hey, your script could just terminate the old recording process and start a new one, to the new file. That can be done by either keeping the PID of the recording process in a temporary file in /tmp, or simply doing killall jack_capture, but it could interfere if you’re or something is running jack_capture manually while the button is being triggered.
Feel free to show what you have so far in your script, so we can provide accurate suggestions.
Basically does what I want, but wonder if its as easy to specify the pisound button config in the py script above, or will this likely conflict with the pisound button functionality built into patchbox os?
Then the other important thing in the linked project are the ‘start’ and ‘stop’ messages. It’s possible to send them using a shell command too:
sudo apt install liblo-tools # First get the 'oscsend' utility installed
oscsend localhost 7777 /jack_capture/tm/start
oscsend localhost 7777 /jack_capture/tm/stop
So having these pieces, what’s remaining is to get jack_capture started in the background, possibly, and then writing 2 simple scripts to start and stop recording using oscsend and map the scripts to Pisound’s button.
Thanks @Giedrius will give that all a try, was having permissions issues when starting jack _capture with anything other than root before but will try the above. Assume 7777 after Jack _capture will resolve this though…
I’m really interested to see what can be done with this.
I’m currently planning out a tiny pedalboard with a Pi4 equipped with a Pisound and a second Pi with 7" touchscreen to run Reaper or another DAW to give me a portable recording platform with effects.
It’ll be awesome if I can also capture audio reliably on the Pisound, then I can perhaps adjust the setup to allow transferring those sound files to DAW.
I could also perhaps change my audio signal chain too.
OK so that all works, broadly speaking. I’ve tested from the the command line
jack_capture works using the command about and it was easy to get the button working to start/stop recording.
However, for some reason jack is starting on boot, so had to manually start from the command line would you suggest?
This seems to start jack_capture but just fills my recordings folders with hundreds of tiny. Wav files until I kill the jack_capture process. Jack_capture (the process) is owned by root though. When I launch from the CLI it is owned as user: patch. Not quite sure, what I’m doing wrong here. Can I launch my script as patch from the button or will it alwways launch as root?
The button mappings to start/ stop recording so work already, if I launch jack _capture manually from the command line. It runs in the terminal, starting with time_machine and waiting until I got the button to start recording.
I’m not really sure how to start jack_capture in the background, run from a script at startup?
Then recording can be started & stopped using the OSC messages.
Btw, looks like jack_capture creates a place holder .wav file for the next recording session, I was a little
surprised to see 01.wav there as soon as it’s started, but it gets data inserted only during recording.
@Giedrius as ever thanks, nearly there I think! jack_capture now starts automatically via systemd. I can see jack _capture process is running but for some reason the OSC commands don’t start the recorder now - not using the button script not from the command line.
No. Wav file being created in my recordings directory either. Weird as I followed instructions exactly as above. Any thoughts?
jack_capture.service: Main process exited, code=exited, status=255/EXCEPTION
jack_capture.service: Failed with result ‘exit-code’
So it seems to start and then fail, and try and restart again.
I’ve checked the .service field and its s=exactly the same as yours below, any ideas what might be going wrong here, or are there any logs to see in more detail whats happening? I’ve looked at journal systemctl jack_captutre.service but tells me nothing more than the exit code message above…
hi @Giedrius , ok so it does work from the terminal. Just looking again at the jack_capture.service file, After/BindsTo= jack.service - I don’t have jack.service. I have a jackd.service (which I created). Is this an issue?