disable frequency scaling after jack startup

What other apps and distros do you use to round out your studio?

Moderators: MattKingUSA, khz

Post Reply
hdr
Established Member
Posts: 141
Joined: Sun Feb 03, 2019 1:47 pm
Has thanked: 1 time

disable frequency scaling after jack startup

Post by hdr »

Before starting jack I manually do:

Code: Select all

cpupower frequency-set -g performance
to disable frequency scaling and after shutdown:

Code: Select all

cpupower frequency-set -g powersave
to enable it again.

I would like to automate these commands when starting and shutting down jack.

As described here viewtopic.php?f=27&t=20776
my jack post startup script looks like:

Code: Select all

pactl set-card-profile alsa_card.pci-0000_00_1b.0 off && pactl set-card-profile alsa_card.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00 off && pactl load-module module-jack-sink
and my post shutdown script like:

Code: Select all

pactl set-card-profile alsa_card.pci-0000_00_1b.0 output:analog-stereo
If I add the cpupower commands it doesn't work because root permissions are required.

OS: Linux Mint DAW: Reaper

User avatar
bluebell
Established Member
Posts: 2065
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 159 times
Been thanked: 178 times

Re: disable frequency scaling after jack startup

Post by bluebell »

You can fix that with sudo. But you have to edit /etc/sudoers with "sudo visudo" to add a line like

Code: Select all

%sudo	ALL=(ALL:ALL) NOPASSWD:/usr/bin/cpupower
or wherever cpupower is located.

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

hdr
Established Member
Posts: 141
Joined: Sun Feb 03, 2019 1:47 pm
Has thanked: 1 time

Re: disable frequency scaling after jack startup

Post by hdr »

Thank you. Unfortunately something went wrong.
my startup and shutdown scripts in jack are:

Code: Select all

pactl set-card-profile alsa_card.pci-0000_00_1b.0 off && pactl set-card-profile alsa_card.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00 off && pactl load-module module-jack-sink && sudo cpupower frequency-set -g performance

Code: Select all

pactl set-card-profile alsa_card.pci-0000_00_1b.0 output:analog-stereo && sudo cpupower frequency-set -g powersave
I've editet /etc/sudoers with visudo:

Code: Select all

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults	env_reset
Defaults	mail_badpass
Defaults	secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root	ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo	ALL=(ALL:ALL) ALL
%sudo	ALL=(ALL:ALL) NOPASSWD:/usr/bin/cpupower

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d
But after starting jack the command

Code: Select all

cpupower frequency-info
shows that the state is still powersafe

OS: Linux Mint DAW: Reaper

User avatar
bluebell
Established Member
Posts: 2065
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 159 times
Been thanked: 178 times

Re: disable frequency scaling after jack startup

Post by bluebell »

Code: Select all

#!/bin/bash

GOVERNOR=performance
#for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
for CPUFREQ in /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
do
  [ -f $CPUFREQ ] || continue
  echo -n $GOVERNOR > $CPUFREQ
done

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

hdr
Established Member
Posts: 141
Joined: Sun Feb 03, 2019 1:47 pm
Has thanked: 1 time

Re: disable frequency scaling after jack startup

Post by hdr »

Sorry, can you help me? What is that supposed to mean?

OS: Linux Mint DAW: Reaper

Post Reply