Skip to content

Commit db50b2d

Browse files
authored
Merge pull request #2682 from rbnpi/v3.3.1-dev
V3.3.1 dev updates for Raspberry Pi
2 parents 15d5352 + 2a614c6 commit db50b2d

File tree

3 files changed

+12
-39
lines changed

3 files changed

+12
-39
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ def boot_server_raspberry_pi
416416
puts "Jackd already running. Not starting another server..."
417417
end
418418

419-
block_size = raspberry_pi_1? ? 512 : 128
419+
block_size = 128
420420

421421
local_scsynth_opts = {
422422
"-c" => "128",
@@ -429,17 +429,19 @@ def boot_server_raspberry_pi
429429

430430
boot_and_wait(scsynth_path, scsynth_opts)
431431

432-
`jack_connect SuperCollider:in_1 system_capture_1`
433-
`jack_connect SuperCollider:in_2 system_capture_2`
434432
`pactl load-module module-jack-source connect=0 client_name=JACK_to_PulseAudio`
435433
`pactl load-module module-loopback source=jack_in`
434+
`pactl load-module module-jack-sink channels=2 connect=0 client_name=PulseAudio_to_JACK`
435+
`jack_connect PulseAudio_to_JACK:front-left SuperCollider:in_1`
436+
`jack_connect PulseAudio_to_JACK:front-right SuperCollider:in_2`
436437
`jack_connect SuperCollider:out_1 JACK_to_PulseAudio:front-left`
437438
`jack_connect SuperCollider:out_2 JACK_to_PulseAudio:front-right`
438439

439440
sleep 3
440441
end
441442

442443
def boot_server_linux
444+
#to do -- needs further work
443445
log_boot_msg
444446
puts "Booting on Linux"
445447
#Start Jack if not already running

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ def start_mixer
565565
# set_mixer! :basic
566566
# set_mixer! :default
567567
log_message "Starting mixer"
568-
mixer_synth = raspberry_pi_1? ? "sonic-pi-basic_mixer" : "sonic-pi-mixer"
568+
mixer_synth = "sonic-pi-mixer"
569569
@mixer = @server.trigger_synth(:head, @mixer_group, mixer_synth, {"in_bus" => @mixer_bus.to_i}, nil, true)
570570
end
571571

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

Lines changed: 6 additions & 35 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
@@ -430,14 +417,6 @@ def sox_path
430417
File.join(native_path, "sox", __exe_fix("sox"))
431418
end
432419

433-
def osmid_o2m_path
434-
File.join(native_path, "osmid", __exe_fix("o2m"))
435-
end
436-
437-
def osmid_m2o_path
438-
File.join(native_path, "osmid", __exe_fix("m2o"))
439-
end
440-
441420
def scsynth_log_path
442421
log_path + '/scsynth.log'
443422
end
@@ -446,14 +425,6 @@ def erlang_log_path
446425
log_path + '/erlang.log'
447426
end
448427

449-
def osmid_m2o_log_path
450-
log_path + '/osmid_m2o.log'
451-
end
452-
453-
def osmid_o2m_log_path
454-
log_path + '/osmid_o2m.log'
455-
end
456-
457428
def ruby_path
458429
case os
459430
when :windows

0 commit comments

Comments
 (0)