# speedfreq alternative?

## sepp

seems like speedfreq got removed from portage. it actually always did a very good job without the hassle to do much configuring. so what package is out there that can just do my dynamic switching?

----------

## agentblue

use cpufreqd it is an excellent demon for controlling a cpu with speedstep technology built in.

----------

## toralf

Use the kernel governor 'ondemand' it fits nearly all needs, I would say.

----------

## sepp

 *toralf wrote:*   

> Use the kernel governor 'ondemand' it fits nearly all needs, I would say.

 

but it seems like you can't set the ondemand governor as the default one  :Sad: 

----------

## toralf

 *sepp wrote:*   

>  *toralf wrote:*   Use the kernel governor 'ondemand' it fits nearly all needs, I would say. 
> 
> but it seems like you can't set the ondemand governor as the default one 

 

At least you have to do a

```

echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

```

in your local.start or so. My solution:

```

#!/bin/sh

#

# author:

#               toralf foerster

#               hamburg

#               germany

#

cd /sys/devices/system/cpu/cpu0/cpufreq || exit 1

OLD_GOV=`cat scaling_governor`

OLD_FRQ=`cat scaling_max_freq`

NEW_GOV=""

NEW_FRQ=""

#   change only values if they differ from old

#

function ChangeIt()

{

   NEW_GOV=${1:-""}

   NEW_FRQ=${2:-""}

   if [[ ! -z "${NEW_GOV}" && "${NEW_GOV}" != "${OLD_GOV}" ]]; then

      

      # module already loaded ?

      #

      /bin/grep -q cpufreq_${NEW_GOV} /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

      [[ $? -ne 0 ]] && /sbin/modprobe cpufreq_${NEW_GOV}

      

      echo "${NEW_GOV}" > scaling_governor

   fi

   

   [[ ! -z "${NEW_FRQ}" && "${NEW_FRQ}" != "${OLD_FRQ}" ]] &&  echo "${NEW_FRQ}" > scaling_max_freq

}

#   if a parameter is given do the appropriate action

#

if [[ ! -z "$1" ]]; then

   case "$1" in

      'hi')   ChangeIt ondemand    1700000

         ;;

      'me')   ChangeIt ondemand    1200000

         ;;

      'lo')   ChangeIt ondemand     600000

         ;;

      'max')   ChangeIt performance 1700000

         ;;

      'min')   ChangeIt powersave    600000

         ;;

      'con')   ChangeIt conservative

         ;;

      *)   

         echo "$0 lo|me|hi|min|max|con"

         exit 2

         ;;

   esac

fi

#   in every case print out these information

#

echo -n "governor : ${OLD_GOV}"; [[ -n "${NEW_GOV}" && "${NEW_GOV}" != "${OLD_GOV}" ]] && echo " -> `cat scaling_governor`" || echo

echo -n "max_freq : ${OLD_FRQ}"; [[ -n "${NEW_FRQ}" && "${NEW_FRQ}" != "${OLD_FRQ}" ]] && echo " -> `cat scaling_max_freq`" || echo

#   without sleep the cpu would be at 100% b/c of executing this script

#

sleep 1

echo    "cur_freq : `cat scaling_cur_freq` /`grep 'cpu MHz' /proc/cpuinfo | cut -f2 -d:`"

exit 0

#end of script

```

----------

## sepp

 *toralf wrote:*   

> 
> 
> At least you have to do a
> 
> ```
> ...

 

I know. I tried it but I've been very dissapointed with it. So I decided to use the old speedfreq again. I found some old ebuild changed it a bit and put it on the internet: http://koto.mynetix.de/gentoo/

----------

## tam

 *sepp wrote:*   

> 
> 
> I know. I tried it but I've been very dissapointed with it. So I decided to use the old speedfreq again. I found some old ebuild changed it a bit and put it on the internet: http://koto.mynetix.de/gentoo/

 

Cool, thanks.

----------

## ihtruelsen

Thanks a bunch sepp. Now I can sync without losing my speed stepping.

BTW, anyone know why speedfreq was removed from the tree?

----------

## Earthwings

 *https://bugs.gentoo.org/show_bug.cgi?id=70163#c17 wrote:*   

> sys-power/speedfreq is deprecated in favor of sys-power/cpufreqd due to unresolved bugs and lack of upstream activity.
> 
> If you would like to see this fixed, please contact upstream.

 

----------

## pjv

here here

----------

