Question about CPU (SOLVED)

Post fully complete "how to" guides and tutorials here. This is a great place to get feedback on stuff you might put in the wiki.

Moderators: MattKingUSA, khz

Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: Question about CPU

Post by Pablo »

I found the "login" file you suggested.
And the line: session required pam_limits.so was already inserted.

Now, from what I read in this file, it appears that pam reverts to what is written in the limits.conf file.
Yes, but it doesn't. This is the default in ubuntu 12.04 after adding the user to the audio group:

Code: Select all

$ ulimit -r -l
real-time priority              (-r) 95
max locked memory       (kbytes, -l) unlimited
and:

Code: Select all

$ cat /etc/security/limits.d/audio.conf
# Provided by the jackd package.
#
# Changes to this file will be preserved.
#
# If you want to enable/disable realtime permissions, run
#
#    dpkg-reconfigure -p high jackd

@audio   -  rtprio     95
@audio   -  memlock    unlimited
#@audio   -  nice      -19

There must be some other file for your login manager, not just "login", but similar, which makes limits conf invalid for you. Autostatic asked what login manager are you using? What files do you have under /etc/pam.d? Or maybe /etc/pam.conf is to blame?

I never had this problem so I am bit hesitant but something over there must be wrong.
User avatar
briandc
Established Member
Posts: 1442
Joined: Sun Apr 29, 2012 3:17 pm
Location: Italy
Has thanked: 58 times
Been thanked: 28 times
Contact:

Re: Question about CPU

Post by briandc »

AutoStatic wrote:
briandc wrote:Perhaps I should activate it?
No, that's not necessary:
You could also allow the audio group to renice processes with the help of the limits.conf file, but since nice uses SCHED_OTHER it basically does nothing to increase the performance of a low-latency real-time audio environment that relies on SCHED_FIFO/SCHED_RR. Consult the sched_setscheduler manpage for more info on this subject.
From: http://wiki.linuxmusicians.com/doku.php ... audio.conf

In other words: using renice improves nothing.

And since you're using IceWM that rules out the desktop environment as a possible troublemaker. I've used IceWM for quite a while too, very light-weight and easy to configure with flat-file, ini-style configuration files. Good choice for doing audio stuff. But what kind of display/login manager are you using?

Regarding Audacity:
  • Start JACK
  • Start Audacity
  • Tick View - Toolbars - Device Toolbar
  • In the Device Toolbar select 'JACK Audio Connection Kit' with the 'Audio Host' combo box (default is ALSA)
briandc wrote:How can I know what prios are already set?

Code: Select all

ps -eLo pid,cls,rtprio,cmd
Also in the WIki: http://wiki.linuxmusicians.com/doku.php ... tion#rtirq
Thanks for your reply, AutoStatic. You and Pablo are really great! :)

It's "nice" to know that renice isn't necessary.
I do notice, however, that the MemLock has always remained unchanged. I have a feeling that it's a different file that needs to be modified to make it "unlimited."

As per Audacity, it is already set to Jack rather than Alsa when it opens. I did a rescan of audio devices, but no luck.
I'll try changing some setting in the mixer tonight, and see if the signal comes in.

I don't know what login manager I'm using. How do I find that?

brian
Have your PC your way: use linux!
My sound synthesis biome: http://www.linuxsynths.com
User avatar
briandc
Established Member
Posts: 1442
Joined: Sun Apr 29, 2012 3:17 pm
Location: Italy
Has thanked: 58 times
Been thanked: 28 times
Contact:

Re: Question about CPU

Post by briandc »

Pablo wrote:
I found the "login" file you suggested.
And the line: session required pam_limits.so was already inserted.

Now, from what I read in this file, it appears that pam reverts to what is written in the limits.conf file.
Yes, but it doesn't. This is the default in ubuntu 12.04 after adding the user to the audio group:

Code: Select all

$ ulimit -r -l
real-time priority              (-r) 95
max locked memory       (kbytes, -l) unlimited
and:

Code: Select all

$ cat /etc/security/limits.d/audio.conf
# Provided by the jackd package.
#
# Changes to this file will be preserved.
#
# If you want to enable/disable realtime permissions, run
#
#    dpkg-reconfigure -p high jackd

@audio   -  rtprio     95
@audio   -  memlock    unlimited
#@audio   -  nice      -19

There must be some other file for your login manager, not just "login", but similar, which makes limits conf invalid for you. Autostatic asked what login manager are you using? What files do you have under /etc/pam.d? Or maybe /etc/pam.conf is to blame?

I never had this problem so I am bit hesitant but something over there must be wrong.
Yes, it is strange. My pam file gives everything you mention above, but when I run ulimit -r -l, I get different results.
Also, I'm using AntiX 12 (debian based) rather than Ubuntu. I am already part of the audio group (when I ran adduser brian audio it told me that I was already there).

When I get home tonight (8 hours from now), I'll post the files that are listed in the pam.d.
Also, I don't know how to find my login manager..

brian
Have your PC your way: use linux!
My sound synthesis biome: http://www.linuxsynths.com
User avatar
autostatic
Established Member
Posts: 1994
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Has thanked: 32 times
Been thanked: 104 times
Contact:

Re: Question about CPU

Post by autostatic »

briandc wrote:I don't know what login manager I'm using. How do I find that?brian

Code: Select all

cat /etc/X11/default-display-manager 
User avatar
briandc
Established Member
Posts: 1442
Joined: Sun Apr 29, 2012 3:17 pm
Location: Italy
Has thanked: 58 times
Been thanked: 28 times
Contact:

Re: Question about CPU

Post by briandc »

Login manager: slim

Files in pam.d:
chfn common-auth cron other samba xlock
chpasswd common-password cups passwd sshd
chsh common-session login polkit-1 su
common-account common-session-noninteractive newusers ppp sudo


brian
Have your PC your way: use linux!
My sound synthesis biome: http://www.linuxsynths.com
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: Question about CPU

Post by Pablo »

OK,

I suggest you create "slim" file:

gksudo gedit /etc/pam.d/slim

with this content


Code: Select all

#
# The PAM configuration file for the SLiM graphical login manager
#

# Disallows other than root logins when /etc/nologin exists
# (Replaces the `NOLOGINS_FILE' option from login.defs)
auth       requisite  pam_nologin.so

# This module parses environment configuration file(s)
# and also allows you to use an extended config
# file /etc/security/pam_env.conf.
# 
# parsing /etc/environment needs "readenv=1"
session       required   pam_env.so readenv=1
# locale variables are also kept into /etc/default/locale in etch
# reading this file *in addition to /etc/environment* does not hurt
session       required   pam_env.so readenv=1 envfile=/etc/default/locale

# Standard Un*x authentication.
@include common-auth

# This allows certain extra groups to be granted to a user
# based on things like time of day, tty, service, and user.
# Please edit /etc/security/group.conf to fit your needs
# (Replaces the `CONSOLE_GROUPS' option in login.defs)
auth       optional   pam_group.so

# Uncomment and edit /etc/security/time.conf if you need to set
# time restrainst on logins.
# (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs
# as well as /etc/porttime)
# account    requisite  pam_time.so

# Uncomment and edit /etc/security/access.conf if you need to
# set access limits.
# (Replaces /etc/login.access file)
# account  required       pam_access.so

# Sets up user limits according to /etc/security/limits.conf
# (Replaces the use of /etc/limits in old login)
session    required   pam_limits.so

# SELinux needs to intervene at login time to ensure that the process
# starts in the proper default security context.
# Uncomment the following line to enable SELinux
# session required pam_selinux.so multiple

# Standard Un*x account and session
@include common-account
@include common-session
@include common-password
See:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=476248
User avatar
briandc
Established Member
Posts: 1442
Joined: Sun Apr 29, 2012 3:17 pm
Location: Italy
Has thanked: 58 times
Been thanked: 28 times
Contact:

Re: Question about CPU

Post by briandc »

Pablo wrote:OK,

I suggest you create "slim" file:

gksudo gedit /etc/pam.d/slim

with this content


Code: Select all

#
# The PAM configuration file for the SLiM graphical login manager
#

# Disallows other than root logins when /etc/nologin exists
# (Replaces the `NOLOGINS_FILE' option from login.defs)
auth       requisite  pam_nologin.so

# This module parses environment configuration file(s)
# and also allows you to use an extended config
# file /etc/security/pam_env.conf.
# 
# parsing /etc/environment needs "readenv=1"
session       required   pam_env.so readenv=1
# locale variables are also kept into /etc/default/locale in etch
# reading this file *in addition to /etc/environment* does not hurt
session       required   pam_env.so readenv=1 envfile=/etc/default/locale

# Standard Un*x authentication.
@include common-auth

# This allows certain extra groups to be granted to a user
# based on things like time of day, tty, service, and user.
# Please edit /etc/security/group.conf to fit your needs
# (Replaces the `CONSOLE_GROUPS' option in login.defs)
auth       optional   pam_group.so

# Uncomment and edit /etc/security/time.conf if you need to set
# time restrainst on logins.
# (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs
# as well as /etc/porttime)
# account    requisite  pam_time.so

# Uncomment and edit /etc/security/access.conf if you need to
# set access limits.
# (Replaces /etc/login.access file)
# account  required       pam_access.so

# Sets up user limits according to /etc/security/limits.conf
# (Replaces the use of /etc/limits in old login)
session    required   pam_limits.so

# SELinux needs to intervene at login time to ensure that the process
# starts in the proper default security context.
# Uncomment the following line to enable SELinux
# session required pam_selinux.so multiple

# Standard Un*x account and session
@include common-account
@include common-session
@include common-password
See:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=476248
Sounds good. I'll do it as soon as I get home, in about 7 hours.. :)

Once it's done, I'll reboot. What should I expect to see then?

brian
Have your PC your way: use linux!
My sound synthesis biome: http://www.linuxsynths.com
User avatar
briandc
Established Member
Posts: 1442
Joined: Sun Apr 29, 2012 3:17 pm
Location: Italy
Has thanked: 58 times
Been thanked: 28 times
Contact:

Re: Question about CPU

Post by briandc »

Done!
I ran ulimit -r -l and got:

Code: Select all

real-time priority              (-r) 95
max locked memory       (kbytes, -l) unlimited
:D

I also didn't get that memlock warning in Ardour.

:D

Anything else I should do?

brian
Have your PC your way: use linux!
My sound synthesis biome: http://www.linuxsynths.com
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: Question about CPU

Post by Pablo »

rtprio and memlock privileges are very important and at last, you have that part right. Now, unless you see problems, just don't worry anymore. You know you can tweak your linux endlessly, but time is scarce, isn't it.

Of course, if you enjoy the learning process associated to linux audio tweaking see the linuxmusicians wiki and read Autostatic!

So I would say that...
Anything else I should do?
Learn ardour and enjoy the music! :)
User avatar
briandc
Established Member
Posts: 1442
Joined: Sun Apr 29, 2012 3:17 pm
Location: Italy
Has thanked: 58 times
Been thanked: 28 times
Contact:

Re: Question about CPU

Post by briandc »

Pablo wrote:rtprio and memlock privileges are very important and at last, you have that part right. Now, unless you see problems, just don't worry anymore. You know you can tweak your linux endlessly, but time is scarce, isn't it.

Of course, if you enjoy the learning process associated to linux audio tweaking see the linuxmusicians wiki and read Autostatic!

So I would say that...
Anything else I should do?
Learn ardour and enjoy the music! :)
Thanks so much, Pablo (and Auto Static)!
Xruns appear to be at a low now. However, new problems await me. Audacity doesn't want to cooperate with Jack for some reason, and it seems like every synth has to be connected to the external keyboard differently. (I'm now exploring QSynth, but so far have had no luck. I'd also like to use the plug-in instruments available for Qtracktor, but that's still to be seen..)

Time for a new thread....

brian
Have your PC your way: use linux!
My sound synthesis biome: http://www.linuxsynths.com
Post Reply