Hi!
I’m trying to create a setup with Sonic Pi and I run into errors. Here’s what I’m trying to do:
- I run a raspberry pi (3B) with the latest Raspberry Pi OS headless (April 4th 2022)
- Sonic Pi server installed from repository
sonic-pi-server/stable,now 3.2.2~repack-7+rpt1 all [installed]
- sonic-pi-tool.py (GitHub - emlyn/sonic-pi-tool: 🎻 Controlling Sonic Pi from the command line, in Python.) to send code/commands to sonic-pi-server
I have verified that I can have sound output of the pi (speaker-test
), but I can’t get sound from Sonic Pi. When I run some code (which I know works well on another Sonic Pi install), I get no sound, but these errors appear in the journal:
Apr 25 20:11:27 sonicpi ruby[395]: Exception!
Apr 25 20:11:27 sonicpi ruby[395]: Connection refused - send(2)
Apr 25 20:11:27 sonicpi ruby[395]: ["/usr/lib/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/usr/lib/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/usr/lib/sonic-pi/app/server/ruby/bin/sonic-pi-server.rb:613:in `block in <main>'"]
Apr 25 20:11:27 sonicpi ruby[395]: Exception!
Apr 25 20:11:27 sonicpi ruby[395]: Connection refused - send(2)
Apr 25 20:11:27 sonicpi ruby[395]: ["/usr/lib/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/usr/lib/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/usr/lib/sonic-pi/app/server/ruby/bin/sonic-pi-server.rb:615:in `block in <main>'"]
Apr 25 20:11:27 sonicpi ruby[395]: Exception!
Apr 25 20:11:27 sonicpi ruby[395]: Connection refused - send(2)
Apr 25 20:11:27 sonicpi ruby[395]: ["/usr/lib/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/usr/lib/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/usr/lib/sonic-pi/app/server/ruby/bin/sonic-pi-server.rb:615:in `block in <main>'"]
This just repeats as long as the code is running. If I stop the playback the errors also stop.
I have been troubleshooting this but can’t seem to figure out what is happening. Is there anyone that can point me in the right direction? The only pointer that I have is from line 613 of sonic-pi-server.rb, that reads:
gui.send("/incoming/osc", message[:time], message[:id], message[:address], message[:args])
Which leads me to think I might need to install a GUI for this to work. I would rather not though since this Pi will not have display outputting anywhere… should it be possible to run Sonic Pi headless like this?