[Solved] No sound on pi-top 4

I was trying to run the theramin project from further this morning and everything ran fine (i.e. button and ultrasonic sensor worked as expected) until I added the code for the sonic pi support. No sound! I had run the run-sonic-pi-server and it did not show any errors. Later I just tried to run the sonic-pi program, and although the oscope showed waveforms I still got no sound. Not on the internal speaker. Not on headphones.

It occurred to me that I had never tried anything with sound on the pi-top 4, so I tried playing a youtube video as a final test as to whether or not the problem was with sonic-pi or the pi-top 4, and, you guessed it: no sound.

I am VNCed in over wifi, which makes me wonder if that has something to do with it. The desktop bar shows sound up at maximum volume and unmuted. Should sound still come from the pi-top 4 itself or will it be sent to the VNC client? I am running RealVNC VNC Connect on MacOS.

Would love some tips on tracking this down. Thanks!

Hey @mgwhit I’ve had this exact issue, the audio comes through onto the computer that you’re VNCing with. You can change the output device from the toolbar at the top of the VNC window.

I was the fool that completely disassembled my pi-top [4] to check that that the speaker was plugged in, the amplifier was turning on and there was a signal going into the amplifier before I realised (don’t tell Dwudi :sweat_smile:)

#MistakesWereMade

That’s Duwudi to you sir :wink:

Thanks! My VNC client said that the VNC server didn’t provide audio when I tried that, but I will connect directly to the pi-top [4] tonight (i.e. no VNC) and see if that takes care of it.

:weary: 不好意思 老板 @duwudi

@mgwhit, could you right click on the speaker icon on the bottom right of the screen and check the audio output. It should be switched to Analog. Lastly could you also plug in a set of headphones into the 3.5mm audio jack and see if there’s any audio out from there?

image

I did try the 3.5mm audio jack with a pair of headphones and got nothing. I will check the Analog/HDMI setting on the speaker icon in just a bit. Thanks!

Speaker said HDMI, so I changed to Analog. Sound now comes from the pi-top [4] when I use YouTube in Chromium. Whew!

Still can’t get sound from my own code using psonic or from the Sonic-Pi program, however.

It took me a little while to find the log file for the sonic-pi server, but I finally found it in /tmp/sonic-pi-log.txt. Tailing the log I see that whenever the python code from the theramin project tries to play() a note, the server generates an exception:

Exception!
Connection refused - send(2)
["/usr/lib/sonic-pi/server/lib/sonicpi/osc/udp_client.rb:30:in `send'", "/usr/lib/sonic-pi/server/lib/sonicpi/osc/udp_client.rb:30:in `send'", "/usr/lib/sonic-pi/server/bin/sonic-pi-server.rb:464:in `block in <main>'"]

Working now. I hooked up a keyboard and a monitor, switched the sound back to HDMI and BINGO! Sound! Sonic Pi works like a charm.

Thanks for all the help!

1 Like

Glad to hear it! You know where to come if you need anymore help.