Questo è un post per addetti ai lavori.
English text at the end.
Mi sto rendendo conto che, con Ubuntu 7.xx (Feisty Faune), molti hanno difficoltà nel lanciare jackd (un server audio professionale su linux) con l’opzione realtime (-R, necessaria per avere bassa latenza) come utente normale, ma riescono invece a farlo solo come superuser (con sudo), con la rogna di dover lanciare nello stesso modo anche tutti i client.
Alcuni lamentano anche che con la versione precedente si poteva farlo (ed è vero).
La soluzione è molto semplice:
- Controllate che il vostro utente sia inserito nel gruppo audio. Se l’utente è quello creato durante l’installazione, dovrebbe già esserlo. Comunque aprite una console (terminale) e scrivete
id
che mostra user id, group id e tutti i gruppi a cui l’utente appartiene. La risposta dovrebbe essere qualcosa come
uid=1000(nome_utente) gid=1000(nome_utente)
groups=4(adm), 20(dialout), 24(cdrom), 25(floppy),
29(audio), 30(dip), 44(video), 46(plugdev), 104(scanner),
112(netdev), 113(lpadmin), 115(powerdev), 117(admin),
1000(nome_utente)
[al posto di 1000 potreste vedere un altro numero]Se c’è già il gruppo 29(audio), allora tutto ok, altrimenti aggiungete l’utente al gruppo audio.
- Editate il file /etc/security/limits.conf come superuser con il comando
sudo gedit /etc/security/limits.conf
[al posto di gedit potete mettere il vostro text editor preferito] - Alla fine del file, prima della riga
# End of file
aggiungete quanto segue:@audio - rtprio 99
@audio - nice -10
@audio - memlock 256000
[il valore 256000 è adatto a una RAM di 512K; è la memoria da bloccare e dovrebbe essere circa la metà della vostra RAM; mettete 512000 se avete 1 Gb e così via]
[il valore nella seconda linea (nice) è proprio -10 (meno 10); imposta la priorità e senza il meno avrete una proprità schifosa] - A questo punto è necessario riavviare il computer.
Ora potete anche lanciare jackd in realtime come utente con il comando
/usr/bin/jackd -R -dalsa -dhw:0 -r44100 -p1024 -n2
[ovviamente potete aggiungere anche altre opzioni]oppure con un front-end grafico come qjackctl o simili. - Naturalmente è meglio installare anche il kernel low-latency.
——————————————————————-
ENGLISH TEXT
With Ubuntu 7.xx (Feisty Faune), many people are having problems starting Jackd with realtime option (-R) as normal user. They can only launch it as superuser, so they must start all clients in the same way.
There is a very simple solution:
Edit the file /etc/security/limits.conf as superuser
sudo gedit /etc/security/limits.conf
At the end, just before the last line (that should be “# End of file”), add the following
@audio - rtprio 99
@audio - nice -10
@audio - memlock 256000
[Note: the memlock value 256000 is for a 512K RAM machine; this value should be about half of your RAM i.e. about 512000 for a 1 Gb machine.
Note: the second line value (nice) is really a negative value: -10 (minus 10)]
The first two lines set the realtime priority and the nice of processes started by users who are in the audio group.
The third line tells the system that the processes started by users who are in the audio group can lock RAM memory that can’t be swapped or moved anyway.
You can verify if your user is part of the audio group with the command “id” (write “id” on a terminal)-
Save the file and restart the system (sorry, there should be a way to reload security/limits.conf without rebooting but I don’t know)
Now you can start jackd with realtime option as normal user with the command
/usr/bin/jackd -R -dalsa -dhw:0 -r44100 -p1024 -n2
or with some front-end as qjackctl.
Of course it’s better install the low-latency kernel
Grazie molto utile
Lo leggo solo ora ma è ancora molto utile! Grazie! 😉