Skip to content

Commit 35b89c2

Browse files
authored
Update util.rb
Remove references to Raspberry Pi 1, and update default_sched_ahead times for Pi2 and Pi3 models
1 parent fc613be commit 35b89c2

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

app/server/ruby/lib/sonicpi/util.rb

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ module Util
5656
@@current_uuid = nil
5757
@@home_dir = nil
5858
@@util_lock = Mutex.new
59-
@@raspberry_pi_1 = RUBY_PLATFORM.match(/.*arm.*-linux.*/) && File.exist?('/proc/cpuinfo') && !(`cat /proc/cpuinfo | grep BCM2708`).empty?
6059
@@raspberry_pi_2 = RUBY_PLATFORM.match(/.*arm.*-linux.*/) && ['a01040','a01041','a22042'].include?(`awk '/^Revision/ { print $3}' /proc/cpuinfo`.delete!("\n"))
6160
@@raspberry_pi_3 = RUBY_PLATFORM.match(/.*arm.*-linux.*/) && ['a02082','a22082','a32082'].include?(`awk '/^Revision/ { print $3}' /proc/cpuinfo`.delete!("\n"))
6261
@@raspberry_pi_3bplus = RUBY_PLATFORM.match(/.*arm.*-linux.*/) && ['a020d3'].include?(`awk '/^Revision/ { print $3}' /proc/cpuinfo`.delete!("\n"))
@@ -118,10 +117,6 @@ def raspberry_pi?
118117
os == :raspberry
119118
end
120119

121-
def raspberry_pi_1?
122-
os == :raspberry && @@raspberry_pi_1
123-
end
124-
125120
def raspberry_pi_2?
126121
os == :raspberry && @@raspberry_pi_2
127122
end
@@ -195,17 +190,15 @@ def num_buffers_for_current_os
195190
end
196191

197192
def num_audio_busses_for_current_os
198-
if os == :raspberry && @@raspberry_pi_1
199-
64
200-
else
201193
1024
202-
end
203-
204194
end
205195

206196
def default_sched_ahead_time
207-
if raspberry_pi_1?
208-
1
197+
if raspberry_pi_2?
198+
2
199+
elsif raspberry_pi_3? or raspberry_pi_3bplus? \
200+
or raspberry_pi_3_64? or raspberry_pi_3bplus_64?
201+
1.5
209202
else
210203
0.5
211204
end
@@ -214,9 +207,7 @@ def default_sched_ahead_time
214207
def host_platform_desc
215208
case os
216209
when :raspberry
217-
if raspberry_pi_1?
218-
"Raspberry Pi 1"
219-
elsif raspberry_pi_2?
210+
if raspberry_pi_2?
220211
"Raspberry Pi 2B"
221212
elsif raspberry_pi_3?
222213
"Raspberry Pi 3B"
@@ -260,11 +251,7 @@ def host_platform_desc
260251

261252
def default_control_delta
262253
if raspberry_pi?
263-
if raspberry_pi_1?
264-
0.02
265-
else
266254
0.013
267-
end
268255
else
269256
0.005
270257
end

0 commit comments

Comments
 (0)