-
Notifications
You must be signed in to change notification settings - Fork 61
/
orion_optimize.sh
executable file
·145 lines (129 loc) · 4.36 KB
/
orion_optimize.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/bin/bash
#
# PlayerUI Copyright (C) 2013 Andrea Coiutti & Simone De Gregori
# Tsunamp Team
# http://www.tsunamp.com
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, 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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with RaspyFi; see the file COPYING. If not, see
# <http://www.gnu.org/licenses/>.
#
#
# UI-design/JS code by: Andrea Coiutti (aka ACX)
# PHP/JS code by: Simone De Gregori (aka Orion)
#
# file: player_wdog.sh
# version: 1.0
#
#
######################################
# Orion Tsunamp Optimize script v0.9 #
######################################
ver="0.9"
if [ "$2" == "startup" ]; then
## kill useless system processes
#killall -9 avahi-daemon
#killall -9 dbus-daemon
killall -9 exim4
killall -9 ntpd
#killall -9 rpc.idmapd
#killall -9 rpc.statd
#killall -9 rpcbind
killall -9 thd
#killall -9 udevd
#killall -9 automount
killall -9 cron
killall -9 atd
#killall -9 dhclient
killall -9 startpar
#Automatic unmuting
sh /home/volumio/unmute.sh
echo "flush startup settings"
fi
##################
# sound profiles #
##################
# default
if [ "$1" == "default" ]; then
echo -n performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
ifconfig eth0 mtu 1500
echo noop > /sys/block/mmcblk0/queue/scheduler
echo 60 > /proc/sys/vm/swappiness
echo 6000000 > /proc/sys/kernel/sched_latency_ns
echo 1000000 > /proc/sys/kernel/sched_rt_period_us
echo 950000 > /proc/sys/kernel/sched_rt_runtime_us
echo "flush DEFAULT sound profile"
fi
## kernel latency settings (1.0 Beta - raspyfi.10betatest.img )
## best settings with previous beta image (raspyfi.10betatest.img) but
## too "cold" sound and less OS stability with current image ( betaacx.img )
# beta1
if [ "$1" == "Mike" ]; then
echo -n performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
ifconfig eth0 mtu 1500
echo noop > /sys/block/mmcblk0/queue/scheduler
echo 0 > /proc/sys/vm/swappiness
echo 100000 > /proc/sys/kernel/sched_latency_ns
echo 10000 > /proc/sys/kernel/sched_rt_period_us
echo 9500 > /proc/sys/kernel/sched_rt_runtime_us
#echo 3 > /proc/sys/vm/drop_caches
echo "flush BETA1 sound profile"
fi
## kernel latency settings (1.0 BetaACX - betaacx.img ) MOD1
## "warm" sound but little less "focus"
# mod1
if [ "$1" == "ACX" ]; then
echo -n performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
ifconfig eth0 mtu 1500
echo noop > /sys/block/mmcblk0/queue/scheduler
echo 0 > /proc/sys/vm/swappiness
echo 1000000 > /proc/sys/kernel/sched_latency_ns
echo 166666 > /proc/sys/kernel/sched_rt_period_us
echo 158333 > /proc/sys/kernel/sched_rt_runtime_us
echo "flush MOD1 sound profile 'warm'"
fi
## kernel latency settings (1.0 BetaACX - betaacx.img ) MOD2
## very good sound "balance" and "transparency". My choice for current betaacx.img
# mod2
if [ "$1" == "Orion" ]; then
echo -n performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
ifconfig eth0 mtu 1500
echo noop > /sys/block/mmcblk0/queue/scheduler
echo 0 > /proc/sys/vm/swappiness
echo 500000 > /proc/sys/kernel/sched_latency_ns
echo 124999 > /proc/sys/kernel/sched_rt_period_us
echo 118749 > /proc/sys/kernel/sched_rt_runtime_us
echo "flush MOD2 sound profile 'balance and transparency'"
fi
## kernel latency settings (1.0 BetaACX - betaacx.img ) MOD2
## very good sound "balance" and "transparency". My choice for current betaacx.img
# mod3
if [ "$1" == "Buscia" ]; then
echo -n performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
ifconfig eth0 mtu 1500
echo noop > /sys/block/mmcblk0/queue/scheduler
echo 0 > /proc/sys/vm/swappiness
echo 625000 > /proc/sys/kernel/sched_latency_ns
echo 156248 > /proc/sys/kernel/sched_rt_period_us
echo 148436 > /proc/sys/kernel/sched_rt_runtime_us
echo "flush MOD3 sound profile 'balance and transparency'"
fi
# dev
if [ "$1" == "dev" ]; then
echo "flush DEV sound profile 'fake'"
fi
if [ "$1" == "" ]; then
echo "Orion Optimize Script v$ver"
echo "Usage: $0 {default|beta1|mod1|mod2} {startup}"
exit 1
fi