Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
wiki:scripts_and_tools [2012/04/30 18:07] – sfz to hydrogen emrum | wiki:scripts_and_tools [2012/05/09 23:54] – save and restore irq process priorities emrum | ||
---|---|---|---|
Line 397: | Line 397: | ||
* ardour3 + video patch | * ardour3 + video patch | ||
+ | \\ | ||
\\ | \\ | ||
+ | ==== save and restore irq process priorities ==== | ||
\\ | \\ | ||
+ | <code bash> | ||
+ | |||
+ | #!/bin/bash | ||
+ | # | ||
+ | # rtirq_power: | ||
+ | # | ||
+ | # This script is called when a change in power status happens, when | ||
+ | # suspending it saves a list of all irq process priorities, when | ||
+ | # resuming it changes the priorities of the proper irq processes | ||
+ | # to the saved values | ||
+ | # | ||
+ | # Copyright (c) 2012 Fernando Lopez-Lezcano | ||
+ | # | ||
+ | # This program is free software; you can redistribute it and/or | ||
+ | # | ||
+ | # as published by the Free Software Foundation; either version 2 | ||
+ | # of the License, or (at your option) any later version. | ||
+ | # | ||
+ | # This program is distributed in the hope that it will be useful, | ||
+ | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
+ | # | ||
+ | # GNU General Public License for more details. | ||
+ | # | ||
+ | # You should have received a copy of the GNU General Public License along | ||
+ | # with this program; if not, write to the Free Software Foundation, Inc., | ||
+ | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
+ | |||
+ | . " | ||
+ | |||
+ | case $1 in | ||
+ | hibernate|suspend) | ||
+ | /bin/ps -eo rtprio=, | ||
+ | ;; | ||
+ | thaw|resume) | ||
+ | restorestate rtirq | while read IRQPRIO IRQCOMM ; do | ||
+ | if [ -n " | ||
+ | IRQPID=`/ | ||
+ | if [ -n " | ||
+ | PRIO=`/ | ||
+ | if [ ${PRIO} -ne ${IRQPRIO} ] ; then | ||
+ | / | ||
+ | fi | ||
+ | fi | ||
+ | fi | ||
+ | done | ||
+ | ;; | ||
+ | *) exit $NA | ||
+ | ;; | ||
+ | esac | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | < | ||
+ | |||
+ | A first try at using a pm-utils script. This script saves the priority state of all irq* processes and restores them after a resume. It only restores the priority for processes that still exist after the resume, and will do nothing for new processes (ie: you plugin a usb card while the computer is sleeping). That would be taken care by my previously posted udev script which would change priority of newly inserted soundcards. I put 05rtirq it in / | ||
+ | |||
+ | </ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | |||