# Raspberry pi 4 / sonic pi 3.3.1 OSC Connection refused - send(2)

**URL:** <https://in-thread.sonic-pi.net/t/raspberry-pi-4-sonic-pi-3-3-1-osc-connection-refused-send-2/6236>\
**Category:** Support, Help & Resources\
**Created:** [December 17, 2021, 12:20pm UTC](https://in-thread.sonic-pi.net/t/raspberry-pi-4-sonic-pi-3-3-1-osc-connection-refused-send-2/6236 "2021-12-17T12:20:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iangtu23](https://avatars.discourse-cdn.com/v4/letter/i/65b543/32.png) [@iangtu23](https://in-thread.sonic-pi.net/u/iangtu23)\
**Post date:** [December 17, 2021, 12:20pm UTC](https://in-thread.sonic-pi.net/t/raspberry-pi-4-sonic-pi-3-3-1-osc-connection-refused-send-2/6236/1 "2021-12-17T12:20:53Z")

</div>

raspberry pi 4 / Raspberry Pi OS (32-bit) 2021-10-30 / sonic pi 3.3.1  
OSC Connection refused - send(2)

my code(from the example):  
use\_osc “localhost”,4560  
osc “/hello/world”,1

my problem:  
Runtime Error: [buffer 2, line 5] - Errno::ECONNREFUSED

Thread death!

Connection refused - send(2)

/opt/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp\_client.rb:38:in `send’

/opt/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp\_client.rb:38:in `send\_ts’

/opt/sonic-pi/app/server/ruby/lib/sonicpi/lang/core.rb:698:in `\_\_osc\_send\_api’

/opt/sonic-pi/app/server/ruby/lib/sonicpi/lang/core.rb:703:in `\_\_osc\_send’

/opt/sonic-pi/app/server/ruby/lib/sonicpi/lang/core.rb:741:in `osc’

workspace\_two:5:in `block (2 levels) in \_\_spider\_eval’

/opt/sonic-pi/app/server/ruby/lib/sonicpi/runtime.rb:830:in `eval’

/opt/sonic-pi/app/server/ruby/lib/sonicpi/runtime.rb:830:in `block (2 levels) in \_\_spider\_eval’

/opt/sonic-pi/app/server/ruby/lib/sonicpi/runtime.rb:1093:in `block (2 levels) in \_\_in\_thread’

this happens one of two times, even the one time that can be sent out, i’m still not seeing any thing coming back from the cue log.

i’ve updated the firmware from this thread, and still no luck

> <https://github.com/sonic-pi-net/sonic-pi/issues/75>
>
> /opt/sonic-pi/app/scripts/vendor/osc-ruby/lib/osc-ruby/client.rb:10:in \`send’: C…onnection refused – send(2) (Errno::ECONNREFUSED)
> from /opt/sonic-pi/app/scripts/vendor/osc-ruby/lib/osc-ruby/client.rb:10:in\`send’
> from /opt/sonic-pi/app/gui/../../app/scripts/run-code.rb:180:in \`block in osc’
> from :10:in\`synchronize’
> from /opt/sonic-pi/app/gui/../../app/scripts/run-code.rb:178:in \`osc’
> from /opt/sonic-pi/app/gui/../../app/scripts/run-code.rb:149:in\`clear\_scsynth’
> from /opt/sonic-pi/app/gui/../../app/scripts/run-code.rb:132:in \`reset\_scsynth!’
> from /opt/sonic-pi/app/gui/../../app/scripts/run-code.rb:41:in\`initialize’
> from /opt/sonic-pi/app/gui/../../app/scripts/run-code.rb:225:in \`new’
> from /opt/sonic-pi/app/gui/../../app/scripts/run-code.rb:225:in\`initialize’
> from /opt/sonic-pi/app/gui/../../app/scripts/run-code.rb:320:in \`new’
> from /opt/sonic-pi/app/gui/../../app/scripts/run-code.rb:320:in\`’
> 
> Hi, I’ve just (15/06/2014) created a brand new NOOBS image. I’ve sudo apt-get updated and sudo apt-get upgraded and then sudo apt-get installed sonic-pi. It seems to be pretty much the same error Jim Manley was getting in October 2013. Did anyone discover a fix? Thanks.

i run the same thing on my mac os 10.13.6 would be no problem at all.  
please help¬¬¬¬¬¬

---

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [December 18, 2021, 2:05pm UTC](https://in-thread.sonic-pi.net/t/raspberry-pi-4-sonic-pi-3-3-1-osc-connection-refused-send-2/6236/2 "2021-12-18T14:05:12Z")

</div>

Hi iang  
This appears to be a bug. Not tested yet if it is only on the new OS (Bullseye based).  
There is a quick workaround. On the IO tab in the preference window click the Allow incoming OSC box to deselect it. Then click it again to reselect it. You should find that the OSC calls work after that, and appear in the cue log. Unfortunately you have to do this each time you reboot Sonic Pi, which is very tedious.

I do have a fresh binary build created on the new OS, and the bug is removed on that. However the new OS also automatically enables the window manager xcompmgr (which can be disabled again using the command line interface to rasp-config using sudo rasp-config in a terminal window. The entry is in the advanced options A3 Compositor enable/disable xcompmgr  
Unfortunately this is enabled with an option which will not allow the transparency option in Raspberry Pi to work.  
In the fresh build I have, I am still working on the best way to get this working, and it is not yet implemented.  
You can download it if you wish from

> **[sonic-pi\_3.3.1\_2\_Bullseye\_armhf.deb](https://drive.google.com/file/d/1ztfGK3LN0r4NGC4ZCjBa--U3uglCfUnu/view?usp=sharing)**
>
> Google Drive file.

To install, make sure you remove any existing Sonic Pi installation using sudo apt purge sonic-pi, and then you can either double click the downloaded file and follow the instructions, or, open a terminal in the Download folder and use  
`sudo apt install ./sonic-pi_3.3.1_2_Bullseye_armhf.deb`

---

<div class="post-metadata">

**Author:** ![iangtu23](https://avatars.discourse-cdn.com/v4/letter/i/65b543/32.png) [@iangtu23](https://in-thread.sonic-pi.net/u/iangtu23)\
**Post date:** [December 18, 2021, 4:31pm UTC](https://in-thread.sonic-pi.net/t/raspberry-pi-4-sonic-pi-3-3-1-osc-connection-refused-send-2/6236/3 "2021-12-18T16:31:55Z")

</div>

that solves the problem!!! thank you robin
