Audio output not switching to headphones

Hello!

I am having trouble with my audio output switching over on Mac. I was using my internal speakers, and have plugged in my Audio Technica 770 headphones, and the audio output won’t switch over for Sonic Pi. It just stays on the internal speakers despite my headphones being plugged in and it saying it’s playing to the external headphones on Sonic Pi. However, all other applications on my computer are working through my headphones. It’s just Sonic Pi that isn’t working.

When I first plugged the headphones in, SonicPi wouldn’t load and it came up with an error message about an issue SuperCollider and to change the audio rate of the external output. So I went into my settings on my computer to change the headphone’s Audio Midi Setup to 44100Hz (and restarted Sonic Pi and my computer).

I’ve used these headphones before with Sonic Pi and have not had any issues. I haven’t updated my computer or SonicPi since then.

Here are some screenshots of the Audio Midi Setup for my external speakers and headphones:


Here are the audio settings on Sonic Pi when headphones plugged in with above settings:
Screenshot 2024-04-26 at 12.01.16 PM

When I have my headphones plugged in, the sound comes out of my laptop speakers when the above settings are selected. I also noticed that if I unplug my headphones (without restarting Sonic Pi) with these settings, no sound comes out at all.

Am I missing something?

I had an issue at a gig recently like this. I plugged into the external sound system through an audio jack and no sound came out initially. However, it seemed to solve itself after restarting Sonic Pi (as I know you have to when you have a new audio output/input). Just want to make sure I can problem-solve if this happens again.

I found an old article about this issue, but tried the solutions and still not working.

Any advice/help would be appreciated!

EDIT *** I just tried this with external speakers and it worked fine after restarting Sonic Pi. It seems to be a specific issue with the headphones.

Hi @tash_atkins,

this sounds very weird indeed. There was a point in the past when macOS automatically switched the audio between headphones and internal speakers and issues like this weren’t a thing. However, with my recent Macs, the headphones and the internal speakers are seen as two different hardware endpoints and the OS no longer handles switching between the two.

Unfortunately, SuperCollider, the internal synthesis engine that Sonic Pi uses also does not automatically switch its audio routing. Instead, when it boots, by default, it looks for the default audio output (highlighted by the little speaker icon in the Audio MIDI Setup app) and binds the audio to that. This remains bound until Sonic Pi is restarted. This is why plugging/unplugging the headphones shouldn’t make a difference.

However, it’s very weird that audio doesn’t come through the headphones when they’re plugged in and then Sonic Pi is started. I haven’t seen that before and I’m not sure how to even start to debug it.

Could you try the following:

  1. Plug in the headphones
  2. Make sure the little speaker is on the “External Headphones” item in the “Audio MIDI Setup”
  3. Start Sonic Pi
  4. Check if Sonic Pi comes out of the headphones.
    • If it does → win!
    • If it does not → could you paste the contents of ~/.sonic-pi/log/scsynth.log to this conversation.

Good luck!