Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
morph-sources-2.6.12-morph7 (realtime-preempt, updates)
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
iphitus
Apprentice
Apprentice


Joined: 03 Aug 2005
Posts: 226

PostPosted: Fri Nov 11, 2005 11:36 pm    Post subject: Reply with quote

indianiec wrote:
Quote:
There are other patchsets which provide the same things that morph does, such as archck, acid and nicus.


But i guess only morph-sources has realtime-preempt with "Complete Preemption" option that is very usefull for musicians for egzample.


Last time I checked full pre-emption was an option in the vanilla kernel. And if you really need Ingos -rt patchset, nicus and other patchsets inclue it.
Back to top
View user's profile Send private message
indianiec
Tux's lil' helper
Tux's lil' helper


Joined: 01 Feb 2005
Posts: 97
Location: Krakow

PostPosted: Mon Nov 14, 2005 9:45 am    Post subject: Reply with quote

I realy don't think vanilla-sources, gentoo-sources or any patchset i know have this options:
Code:
CONFIG_PREEMPT_RT=y
CONFIG_PREEMPT=y
CONFIG_PREEMPT_SOFTIRQS=y
CONFIG_PREEMPT_HARDIRQS=y
CONFIG_PREEMPT_BKL=y
CONFIG_PREEMPT_RCU=y


I don't know if nicus has it. But i have no idea where can i find nicus-sources; google does not know it too.
I will try ck-sources with self applied ingo's rt patch. ingo patch allow me to start jack-server without xruns (sound dropouts) at latency about 10 ms. Morph has it all, but it looks like dead project indeed.

i'm sorry for my english
Back to top
View user's profile Send private message
iphitus
Apprentice
Apprentice


Joined: 03 Aug 2005
Posts: 226

PostPosted: Mon Nov 14, 2005 9:40 pm    Post subject: Reply with quote

Give archck a shot.

It's got staircase, realtime-lsm for jackd, and should run fine with it.
Back to top
View user's profile Send private message
indianiec
Tux's lil' helper
Tux's lil' helper


Joined: 01 Feb 2005
Posts: 97
Location: Krakow

PostPosted: Tue Nov 15, 2005 12:13 pm    Post subject: Reply with quote

Staircase is in ck too, realtime-lsm is not problem because it is in portage, but archck has no molnar's RT.

I tried to patch gentoo and ck-sourses with RT but no luck. I could expext that. I didn't try to patch vanilla-sources because i had problem with running jack as normal user on it even with realtime-lsm.

Is arckck your job? :D
Back to top
View user's profile Send private message
iphitus
Apprentice
Apprentice


Joined: 03 Aug 2005
Posts: 226

PostPosted: Wed Nov 16, 2005 12:54 am    Post subject: Reply with quote

indianiec wrote:
Staircase is in ck too, realtime-lsm is not problem because it is in portage, but archck has no molnar's RT.

I tried to patch gentoo and ck-sourses with RT but no luck. I could expext that. I didn't try to patch vanilla-sources because i had problem with running jack as normal user on it even with realtime-lsm.

Is arckck your job? :D


Archck is my job. Give it a shot. Afaik, ingo's patches apply to his scheduler, O, the vanilla one. CK's is different, Con's Staircase, which I know is more than capable for what you need.
Back to top
View user's profile Send private message
Dominique_71
Veteran
Veteran


Joined: 17 Aug 2005
Posts: 1500
Location: Switzerland (Romandie)

PostPosted: Thu Nov 24, 2005 11:15 am    Post subject: Reply with quote

I have Agnula installed. http://demudi.agnula.org/ It is the best audio distributiion lying around. The kernell is a vanilla kernel with the Ingo's rt patch, the realtime-lsm modules and 2 nice scripts to define the realtime priorities at boot time. I can run jack with 128 frames, 2 periods at 48kHz with no audible xruns, latency 5.33 ms. (P4 1.8GHz and Audigy2)

I am in my way to try to adapt it to Gentoo. I have done a fresh stage 3 install, a stage 3 to stage 1 in order to get gcc 3.4.4 http://forums.gentoo.org/viewtopic-t-400576-highlight-rsync+make+conf.html . The kernel is a 2.6.14.2 with Ingo Molnar's patch. Xorg is working, and i am no in my way to install some fluxbox, some parts of gnome and sound applications to be abble to test it.

To be abble to run jack with realtime priorities, you must manage the irq. First the hardware irq in order to set the rtc with the higher irq in the system, followed by the sound card, followed by the other things, one by one. By doing this, you tell the system at the sound cannot be interrupted by another hardware process.

Second, you must instruct the system at the audio group have a higher priority as all the other groups, and you must be in the audio group. With this, you tell the system at your programs have a higher priority as the other and jack will run just fine will rt priority as user process.

To be abble to do that, you must have shedutils and use chrt. The 2 scripts in Agnula do the whole thing at boot time. But they are using the system 5 init process:
Code:
/etc/init.d/rtirq <start-restart-stop>

For now, i have just make a minor modification in one script and put 2 lines in /etc/conf.d/local.start and local.stop to start and stop those scripts. Is it some documentation telling how to adapt an init 5 process to gentoo?
_________________
[[[ To any NSA and FBI agents reading that text: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
Back to top
View user's profile Send private message
Dominique_71
Veteran
Veteran


Joined: 17 Aug 2005
Posts: 1500
Location: Switzerland (Romandie)

PostPosted: Sat Nov 26, 2005 3:36 pm    Post subject: Reply with quote

It's rocks. Actually, I am abble to use jack with either 96kHz, 256 frames, 2 periods, latency 5,33 ms, and 48kHz or 444.1 kHz, 128 frames, 2 periods, latency 5,33 or 5,8 ms without audible xruns.

It append sometime when starting a programs at iI get a few xruns and audible scratches, but no xruns or scratches when i use the programs.
That was with gnome, i have not yet configured fluxbox.
_________________
[[[ To any NSA and FBI agents reading that text: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
Back to top
View user's profile Send private message
Gabrys
Veteran
Veteran


Joined: 05 Dec 2005
Posts: 1096
Location: Toruń [PL]

PostPosted: Wed Jan 25, 2006 10:08 am    Post subject: Reply with quote

Is the project life? The website is dead :|.
_________________
Sabayon Professional 1.1 (czyli zdradziłem oryginalne Gentoo)
@ Dell Inspiron 8600 (nVidia, Realtek, Pentium M)
Back to top
View user's profile Send private message
iphitus
Apprentice
Apprentice


Joined: 03 Aug 2005
Posts: 226

PostPosted: Wed Jan 25, 2006 3:12 pm    Post subject: Reply with quote

No release for months, its well and truly dead.

if you are lookin for a patchset, theres nitro for performance and instability, and archck for performance and stability.

iphitus
Back to top
View user's profile Send private message
Dominique_71
Veteran
Veteran


Joined: 17 Aug 2005
Posts: 1500
Location: Switzerland (Romandie)

PostPosted: Wed Jan 25, 2006 6:14 pm    Post subject: Reply with quote

After reading /usr/src/linux/Documentation/sound/alsa/emu10k1-jack.txt and according my jack config as suggested, I am now able to run jack with a latency of 1.33msec at 48kHz and 0.667 msec at 96kHz. Its rock!

Here is some scripts I run at boot time:
/etc/init.d/realtime
Code:
#! /bin/sh
#
# This script loads and unloads the realtime kernel module
# Configuration can be put into /etc/default/realtime
#
# Author:   Guenter Geiger <geiger@debian.org>
#
#
# Version:   0.1
#

PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=realtime
DESC="Realtime Linux Security Module"

# Gracefully exit if the package has been removed.
if test ! -e "/lib/modules/`uname -r`/extra/realtime.ko"
then
  echo Loading $DESC: not found
  exit 0
fi

# Read config file if it is present.
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# The module has to be enabled
if test "$ENABLE" != "yes"
then
   echo Loading $DESC: disabled
   exit 0
fi


CAPLOADED=`lsmod | grep capability`

set -e

case "$1" in
  start)
        if [ "$CAPLOADED" != "" ]
   then
     echo Realtime Linux Security Module: Unloading capability LSM
     rmmod capability
        fi
   echo -n "Loading $DESC: $NAME"
   modprobe $NAME $PARAMETERS
   echo "."
   ;;
  stop)
   echo -n "Unloading $DESC: $NAME "
   modprobe -r $NAME
   echo "."
   ;;
  restart|force-reload)
   echo -n "Restarting $DESC: $NAME"
   modprobe -r $NAME
   sleep 1
   modprobe $NAME $PARAMETERS
   echo "."
   ;;
  *)
   N=/etc/init.d/$NAME
   # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
   echo "Usage: $N {start|stop|restart|force-reload}" >&2
   exit 1
   ;;
esac

exit 0

/etc/init.d/rtirq
Code:
#!/bin/sh
#
# Copyright (c) 2004-2005 rncbc aka Rui Nuno Capela.
# All rights reserved.
#
# /etc/init.d/rtirq
#
# Startup script for realtime-preempt enabled kernels.
#
# chkconfig: 35 81 19
# description: Realtime IRQ thread tunning.
#
### BEGIN INIT INFO
# Provides:          rtirq
# Required-Start:    $syslog $local_fs
# Should-Start: $time alsa alsasound hotplug
# Required-Stop:     $syslog $local_fs
# Should-Stop: $time alsa alsasound hotplug
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: Realtime IRQ thread tunning.
# Description:       Change the realtime scheduling policy
#   and priority of relevant system driver IRQ handlers.
### END INIT INFO
#


# Won't work without those binaries.
for DIR in /sbin /usr/sbin /bin /usr/bin /usr/local/bin; do
   [ -z "${RTIRQ_CHRT}"  -a -x ${DIR}/chrt  ] &&  RTIRQ_CHRT=${DIR}/chrt
   [ -z "${RTIRQ_PIDOF}" -a -x ${DIR}/pidof ] && RTIRQ_PIDOF=${DIR}/pidof
done

# Check for missing binaries (stale symlinks should not happen)
[ -n "${RTIRQ_CHRT}" -a -x ${RTIRQ_CHRT} ] || {
   echo "`basename $0`: chrt: not installed." 
   [ "$1" = "stop" ] && exit 0 || exit 5
}

[ -n "${RTIRQ_PIDOF}" -a -x ${RTIRQ_PIDOF} ] || {
   echo "`basename $0`: pidof: not installed." 
   [ "$1" = "stop" ] && exit 0 || exit 5
}

# Check for existence of needed config file and read it.
RTIRQ_CONFIG=/etc/default/rtirq
[ -r ${RTIRQ_CONFIG} ] || {
   echo "`basename $0`: ${RTIRQ_CONFIG}: not found."
   [ "${RTIRQ_ACTION}" = "stop" ] && exit 0 || exit 6
}

# Read configuration.
. ${RTIRQ_CONFIG}

# Colon delimited trail list of already assigned IRQ numbers,
# preventind lower priority override due to shared IRQs.
RTIRQ_TRAIL=":"

#
# Reset policy of all IRQ threads out there.
#
function rtirq_reset ()
{
   # PIDS=`ps -eo pid,class | egrep '(FF|RR)' | awk '{print $1}'`
   PIDS=`ps -eo pid,comm | grep IRQ | awk '{print $1}'`
   for PID in ${PIDS}
   do
      ${RTIRQ_CHRT} --pid --other 0 ${PID}
   done
}

#
# IRQ thread handler policy prioritizer by number.
#
function rtirq_exec_num ()
{
   ACTION=$1
   NAME=$2
   PRI2=$3
   IRQ=$4
   PID=`${RTIRQ_PIDOF} "IRQ ${IRQ}"`
   if [ $((${PID})) -gt 0 -a -z "`echo ${RTIRQ_TRAIL} | grep :${IRQ}:`" ]
   then
      PREPEND="Setting IRQ priorities: ${ACTION} [${NAME}] irq=${IRQ} pid=${PID}"
      case ${ACTION} in
      start)
         PREPEND="${PREPEND} prio=${PRI2}"
         if ${RTIRQ_CHRT} --pid --fifo ${PRI2} ${PID}
         then
            echo "${PREPEND}: OK."
         else
            echo "${PREPEND}: FAILED."
         fi
         ;;
      stop)
         if ${RTIRQ_CHRT} --pid --other 0 ${PID}
         then
            echo "${PREPEND}: OK."
         else
            echo "${PREPEND}: FAILED."
         fi
         ;;
      status)
         echo "${PREPEND}: " && ${RTIRQ_CHRT} --pid --verbose ${PID}
         ;;
      *)
         echo "${PREPEND}: ERROR."
         ;;
      esac
      RTIRQ_TRAIL=":${IRQ}${RTIRQ_TRAIL}"
   fi
}

#
# IRQ thread handler policy prioritizer by name.
#
function rtirq_exec_name ()
{
   ACTION=$1
   NAME=$2
   PRI1=$3
   IRQS=`grep "${NAME}" /proc/interrupts | awk -F: '{print $1}'`
   for IRQ in ${IRQS}
   do
      rtirq_exec_num ${ACTION} ${NAME} ${PRI1} ${IRQ}
      PRI1=$((${PRI1} - 1))
   done
}


#
# Main executive.
#
function rtirq_exec ()
{
   ACTION=$1
   # Check configured base priority.
   PRI0=${RTIRQ_PRIO_HIGH}
   [ $((${PRI0})) -gt 90 ] && PRI0=90
   [ $((${PRI0})) -lt 10 ] && PRI0=10
   # Check configured priority decrease step.
   DECR=${RTIRQ_PRIO_DECR}
   [ $((${DECR})) -gt 20 ] && DECR=20
   [ $((${DECR})) -lt  1 ] && DECR=1
   # Process all configured service names...
   for NAME in ${RTIRQ_NAME_LIST}
   do
      case ${NAME} in
      snd)
         PRI1=${PRI0}
         IRQS=`grep irq /proc/asound/cards | sed 's/.* irq \(.*\)/\1/'`
         for IRQ in ${IRQS}
         do
            rtirq_exec_num ${ACTION} ${NAME} ${PRI1} ${IRQ}
            PRI1=$((${PRI1} - 1))
         done
         ;;
      usb)
         rtirq_exec_name ${ACTION} "ohci_hcd" ${PRI0}
         rtirq_exec_name ${ACTION} "uhci_hcd" ${PRI0}
         rtirq_exec_name ${ACTION} "ehci_hcd" ${PRI0}
         ;;
      *)
         rtirq_exec_name ${ACTION} ${NAME} ${PRI0}
         ;; 
      esac
      [ ${PRI0} -gt ${DECR} ] && PRI0=$((${PRI0} - ${DECR}))
   done
}


#
# Main procedure line.
#
case $1 in
*start)
   if [ "${RTIRQ_RESET_ALL}" = "yes" -o "${RTIRQ_RESET_ALL}" = "1" ]
   then
      rtirq_reset
   fi
   rtirq_exec start
   ;;
stop)
   if [ "${RTIRQ_RESET_ALL}" = "yes" -o "${RTIRQ_RESET_ALL}" = "1" ]
   then
      rtirq_reset
   #else
   #  rtirq_exec stop
   fi
   ;;
reset)
   if [ "${RTIRQ_RESET_ALL}" = "yes" -o "${RTIRQ_RESET_ALL}" = "1" ]
   then
      rtirq_reset
   else
      rtirq_exec stop
   fi
   ;;
status)
   echo
   #rtirq_exec status
   ps -eo pid,class,rtprio,ni,pri,pcpu,stat,comm --sort -rtprio \
      | egrep '(^[[:blank:]]*PID|IRQ)' \
      | awk 'BEGIN {
         while (getline IRQLine < "/proc/interrupts") {
            split(IRQLine, IRQSplit, ":");
            if (match(IRQSplit[1], "^[[:blank:]]+[0-9]+$")) {
               gsub("^[[:blank:]|0-9]+|[/|0-9]+$" \
                  "|[^[:blank:]]+PIC[^[:blank:]]*[[:blank:]]+", \
                  "", IRQSplit[2]);
               IRQTable[IRQSplit[1] + 0] = IRQSplit[2];
            }
         }
      }   { print $0"\t"IRQTable[$9]; }'
   echo
   ;;
*)
   echo
   echo "  Usage: $0 {[re]start|stop|reset|status}"
   echo
   exit 1
   ;;
esac

exit 0

/etc/default/realtime
Code:
# Configuration file for the realtime LSM module
# PARAMETERS can be one or more of:
#
# gid=xx      (allow realtime capabilities for gid xx only)
# any=1|0     (allow any user and process to have realtime)
# mlock=1|0   (allow/disallow mlocking)
# allcaps=1|0 (allow setpcap functionality (dangerous!))

# enable loading of module at startup
ENABLE=yes

# parameter settings for module
PARAMETERS="gid=18"

/etc/default/rtirq
Code:
#!/bin/sh
#
# Copyright (c) 2004-2005 rncbc aka Rui Nuno Capela.
# All rights reserved.
#
# /etc/default/rtirq
#
# Configuration for IRQ thread tunning,
# for realtime-preempt enabled kernels,
#

# IRQ Thread service names
# (space separeted list, from higher to lower priority).
RTIRQ_NAME_LIST="rtc snd usb i8042"

# Highest priority.
RTIRQ_PRIO_HIGH=90

# Priority decrease step.
RTIRQ_PRIO_DECR=10

# Whether to reset all IRQ threads to SCHED_OTHER.
RTIRQ_RESET_ALL=0

_________________
[[[ To any NSA and FBI agents reading that text: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
Back to top
View user's profile Send private message
evermind
Guru
Guru


Joined: 10 Jan 2004
Posts: 322

PostPosted: Thu Feb 16, 2006 7:57 pm    Post subject: Reply with quote

Dominique_71 wrote:

/etc/init.d/rtirq

I added an ebuild to my pro_audio_music_portage_overlay for the rtirq-init-script
and adjusted it a bit to match the gentoo-init-style -- hope nothing broke

thx for the hint

original script was: mailinglist: PlanetCCRMA
Back to top
View user's profile Send private message
Dominique_71
Veteran
Veteran


Joined: 17 Aug 2005
Posts: 1500
Location: Switzerland (Romandie)

PostPosted: Sat Feb 18, 2006 3:37 pm    Post subject: Reply with quote

You are welcome.

The kernel development is going very fast, and the realtime-lsm module is now obsolete.
The future will be a PAM realtime kernel with rt-limit, but I believe at it is best to wait until the rt-limit has proved at it is as reliable as the realtime-lsm. :idea:

alsa and PAM
Rlimits-Aware PAM
_________________
[[[ To any NSA and FBI agents reading that text: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
Back to top
View user's profile Send private message
josh
Guru
Guru


Joined: 05 Feb 2003
Posts: 473
Location: Milky Way: Solar System: Earth: North America: USA: NY: Buffalo

PostPosted: Fri Mar 17, 2006 1:49 am    Post subject: Reply with quote

Just wanted to say that those init scripts are awesome!

I had to test it out of course. I did an 'emerge sync' and opened up firefox, openoffice, limewire and some other heavily hitters. The load went through the roof and the CPU usage for X went up to about 80 or 90 and the desktop became pretty unresponsive in general. But I could play a few songs and record in ardour without incident! And this is on my p3! I can't wait to see how many tracks I can stack on now.
_________________
-Josh
Back to top
View user's profile Send private message
Dominique_71
Veteran
Veteran


Joined: 17 Aug 2005
Posts: 1500
Location: Switzerland (Romandie)

PostPosted: Fri Apr 14, 2006 8:45 pm    Post subject: Reply with quote

The 2 files /etc/init.d/realtime and /etc/default/realtime are not needed on gentoo. It is enough to edit /etc/modules.autoload.d/kernel-2.6 <-- add realtime there

and /etc/modules.d/realtime
Code:
options realtime gid=18

We get no boot message, but the result is the same.

You will get the last file when emerging realtime-lsm, but not if you are installing this module with the rt-sources on evermind's audio-pro overlay. It is of course my favorite gentoo overlay and I recommand to install it.
_________________
[[[ To any NSA and FBI agents reading that text: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum