Real time but not as root

Hi there,
I’m trying to run qtractor (a digital audio workstation) with real-time scheduling priority. The rtprio command won’t work without sudo, but that causes it to run qtractor as root also. This is the command I’m using:

sudo rtprio 0 qtractor &

If I try to set the rtprio after the fact, like this:
qtractor &
sudo rtprio 0 -pid

qtractor is already complaining of lacking rt functionality before the second command has a chance to grant it the permission.
I’ve always been led to believe that we shouldn’t run GUI programs as root (or anything really if avoidable). I just want to run qtractor as a normal user but with rt.
I think I recall on Linux there was a real-time group you could add your user to, but I couldn’t find the FreeBSD equivalent??
Thanks for any suggestions.
 
Code:
 $!      Expands to the process ID of the most recent background command
             executed from the current shell.  For a pipeline, the process ID
             is that of the last command in the pipeline.  If this parameter
             is referenced, the shell will remember the process ID and its
             exit status until the wait built-in command reports completion of
             the process.
 
Hi covacat,
I’ve tried that also, in a script I wrote, but qtractor, as I said, launches too quickly and spits out an error long before it gets awarded the right priority.
I have no idea if it can later recover from that error?
 
If I try to set the rtprio after the fact, like this:
qtractor &
sudo rtprio 0 -pid

qtractor is already complaining of lacking rt functionality before the second command has a chance to grant it the permission.
One option is to exec qtractor from a shell script like so:
Code:
cat >qf <<'EOF'
#!/bin/sh
sleep 5 # this gives rtprio 5 seconds to do its thing.
exec qtractor # this runs qtractor under the same pid as the shell script
EOF
chmod +x qf
qf & 
sudo rtprio 0 -pid
 
Hi there, thanks everyone for your help.
In the end I needed to use the port sysutils/mac_rtprio (thanks Styrsven!) to give my group the realtime priority.
bakul's script does work (raises the priority) but this alone isn't enough to satisfy qtractor.
Apologies for taking more than a week to reply, I've been ill and so didn't feel much like recording music.
 
Back
Top