Configuration 'quickscan'

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: Configuration 'quickscan'

Post by raboof »

Code: Select all

tmpfs /dev/shm tmpfs defaults 0 0
do i have to change this?
No, having that is a good idea. However, I think it's *also* good to put a tmpfs on /tmp - but let's continue that discussion in a seperate tmpfs thread at http://www.linuxmusicians.com/viewtopic ... 6972#p6972 .
2nd: i have USB-Audio-Device, this doesn't have a irq, doesn't it?
You could specify the IRQ of the USB port the sound card is on.
User avatar
angelsguitar
Established Member
Posts: 145
Joined: Sat May 31, 2008 10:30 am
Location: Florida
Contact:

Re: Configuration 'quickscan'

Post by angelsguitar »

Hi all.

The script is really a time saver when configuring realtime performance. Great idea.

Just a short note to make a quick suggestion: It may be a good idea to include a check for /dev/hpet in the script, for the sake of the distros that are using that method. For example, in 64 Studio 3 Beta they seem to be using hpet instead of the usual rtc method. When I ran the script in 64 Studio, it reported as a problem that it couldn't find the rtc. Although it is true that rtc is not found, it really is not a problem if it's using hpet as a timer reference.

Maybe modyfing the script to check for either rtc or hpet would do it.

For your reference, I posted the output of the script in the following thread: http://www.linuxmusicians.com/viewtopic.php?f=27&t=2296
Ángel A. Candelaria Colón
Guitar Professor
https://angelsguitar.com
thorgal
Established Member
Posts: 739
Joined: Mon Apr 07, 2008 6:04 pm

Re: Configuration 'quickscan'

Post by thorgal »

if you really want to check this, existence of /dev/hpet is not enough. jackd can use it directly but ALSA needs its module that can make use of the hr-timer code in the kernel (that is, if you use ALSA):

Code: Select all

# is ALSA using hr-timer ?
lsmod | grep hrtimer

# output (note: 1 means in use, typically when I fire up jackd using the alsa backend)
snd_hrtimer             2148  1

# timers usable by ALSA
~$ cat /proc/asound/timers

# output
G0: system timer : 1000.000us (10000000 ticks)
G3: HR timer : 0.001us (1000000000 ticks)
  Client sequencer queue 0 : running ## <- due to jackd running
P1-0-0: PCM playback 1-0-0 : SLAVE
P1-0-1: PCM capture 1-0-1 : SLAVE
Note that something is broken in the hr-timer code in the kernel and I hope kernel gurus will do something about it.

Final warning: if you use rosegarden or openoctave, don't configure RG or OO to use the hr-timer (in the MIDI settings), you will get a complete system freeze ...
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: Configuration 'quickscan'

Post by raboof »

angelsguitar wrote:The script is really a time saver when configuring realtime performance. Great idea.
Thanks!
modyfing the script to check for either rtc or hpet
Hmm, perhaps we should check for both, as some applications might still be using rtc even when hpet is available?
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: Configuration 'quickscan'

Post by raboof »

thorgal wrote:if you really want to check this, existence of /dev/hpet is not enough. jackd can use it directly but ALSA needs its module that can make use of the hr-timer code in the kernel (that is, if you use ALSA)
I guess I should look in /proc/asound/timers, as it might be compiled-in rather than added as a module.
User avatar
angelsguitar
Established Member
Posts: 145
Joined: Sat May 31, 2008 10:30 am
Location: Florida
Contact:

Re: Configuration 'quickscan'

Post by angelsguitar »

raboof wrote:Hmm, perhaps we should check for both, as some applications might still be using rtc even when hpet is available?
:idea: Good idea :idea:
Ángel A. Candelaria Colón
Guitar Professor
https://angelsguitar.com
User avatar
GarryO
Established Member
Posts: 167
Joined: Mon Apr 06, 2009 7:30 pm
Location: UK
Contact:

Re: Configuration 'quickscan'

Post by GarryO »

Good idea
+1.
I found your script to be a real help, Raboof, thanks, I learnt a couple of tweaks I didn't know before.
Example: my /dev/rtc was not a member of the audio group.
Picking up on the thread on linux.audio.users on the hpet timer, I discovered that my mobo doesn't support this ( it's not that old though!).

Another tweak I (re)discovered recently: I found I was getting xruns when the system paged to the swap partition. so I put this in my /etc/rc.local:

Code: Select all

sysctl -w  vm.swappiness=10
the default was 60 and the OS would page to swap long before all the free RAM was used. Set to 10 this does not happen. Given that most of us have a lot of RAM this only gives a performance improvement if you are doing a lot of memory intensive stuff at the same time: big hydrogen drumkits, and huge soundfonts and Ardour sessions etc.
What do you think about this? Has anyone else had this problem?
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: Configuration 'quickscan'

Post by raboof »

Thanks a lot for the encouragement and suggestions!

I added a simple check to see if /dev/hpet exists and is readable. To keep track of your suggestions better, i added issues to http://code.google.com/p/realtimeconfig ... ssues/list for checking whether ALSA is using the HPET if available, and the 'swappiness' thing. Feel free to add more suggestions, both here, there and on the wiki ;).
User avatar
lucapette
Established Member
Posts: 4
Joined: Sat Nov 21, 2009 11:15 pm
Location: Naples

Re: Configuration 'quickscan'

Post by lucapette »

This script is such a great idea... I consider it my starting point for my first real time configuration. Really, really useful.
“If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas.”
studio32

Re: Configuration 'quickscan'

Post by studio32 »

I read on LAU mailinglist and also heard it from others, that Paul Davis says the nice value in limits.conf is a myth. I suggest to remove the nice value from the script and from the wiki.

for example: http://linuxaudio.org/mailarchive/lau/2009/7/20/156902
plexi45
Established Member
Posts: 8
Joined: Tue Feb 23, 2010 8:52 pm

Re: Configuration 'quickscan'

Post by plexi45 »

Code: Select all

Checking if you are root... no - good.
Finding current kernel config... found /boot/config-2.6.31-9-rt
Checking for Ingo Molnar's Real-Time Preemption... found - good.
Checking for high-resolution timers... found - good.
Checking for 1000hz clock... found - good.
Checking for High Resolution Timers... found - good.
Checking filesystem types... ok.
Checking tmpfs mounted on /tmp..  ok.
Checking filesystem 'noatime' parameter... 
** Warning: / does not have the 'noatime' parameter set
   For more information, see http://wiki.linuxmusicians.com/doku.php?id=system_configuration#filesystems
** Set $SOUND_CARD_IRQ to the IRQ of your soundcard to enable more checks.
   Find your sound card's IRQ by looking at '/proc/interrupts' and lspci.
Checking the ability to prioritize processes with (re)nice... yes - good.
Checking the ability to prioritize processes with rtprio... yes - good.
Checking whether you're in the 'audio' group... yes - good.
Checking for multiple 'audio' groups... no - good.
Checking access to the real-time clock... readable - good.
Checking access to the high precision event timer... not readable.
** Warning: /dev/hpet found, but not readable.
** make /dev/hpet readable by the 'audio' group
   For more information, see http://wiki.linuxmusicians.com/doku.php?id=system_configuration#hpet
Checking sysctl settings:
- checking inotify max_user_watches... >= 524288 - good.
Checking for resource-intensive background processes... none found - good.
jack will still not run rt. What am I missing?
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: Configuration 'quickscan'

Post by raboof »

plexi45 wrote:

Code: Select all

Checking the ability to prioritize processes with rtprio... yes - good.
jack will still not run rt. What am I missing?
Perhaps you're asking for a priority higher than the one allowed to you? How do you start jackd? What error message do you get?
plexi45
Established Member
Posts: 8
Joined: Tue Feb 23, 2010 8:52 pm

Re: Configuration 'quickscan'

Post by plexi45 »

Code: Select all

16:23:39.684 Patchbay deactivated.
16:23:39.703 Statistics reset.
16:23:39.797 ALSA connection graph change.
16:23:40.505 ALSA connection change.
16:23:56.588 Startup script...
16:23:56.589 artsshell -q terminate
sh: artsshell: not found
16:23:56.991 Startup script terminated with exit status=32512.
16:23:56.992 JACK is starting...
16:23:56.992 /usr/bin/jackd -R -dalsa -dhw:0 -r48000 -p128 -n3
16:23:57.165 JACK was started with PID=2631.
no message buffer overruns
jackd 0.116.1
Copyright 2001-2005 Paul Davis and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK compiled with System V SHM support.
loading driver ..
apparent rate = 48000
creating alsa driver ... hw:0|hw:0|128|3|48000|0|0|nomon|swmeter|-|32bit
control device hw:0
16:23:59.155 JACK was stopped successfully.
16:23:59.156 Post-shutdown script...
16:23:59.156 killall jackd
16:23:59.157 JACK has crashed.
16:23:59.309 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
jackd: no process found
16:24:08.955 Post-shutdown script terminated with exit status=256.
This is the entire output from msg.
User avatar
Capoeira
Established Member
Posts: 1321
Joined: Tue May 12, 2009 1:01 pm
Location: Brazil
Has thanked: 3 times
Been thanked: 2 times

Re: Configuration 'quickscan'

Post by Capoeira »

"** Set $SOUND_CARD_IRQ to the IRQ of your soundcard to enable more checks.
Find your sound card's IRQ by looking at '/proc/interrupts' and lspci."

where? at line 179?
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: Configuration 'quickscan'

Post by raboof »

Capoeira wrote:"** Set $SOUND_CARD_IRQ to the IRQ of your soundcard to enable more checks.
Find your sound card's IRQ by looking at '/proc/interrupts' and lspci."

where? at line 179?
No - 'export SOUND_CARD_IRQ=5'. This doesn't do much yet though. Contributions welcome :)
Post Reply