SonicPi not recognizing that I've plugged in Headphones? (v3.3.2 on Mac)

I’m running SP v3.2.2 on Mac Catalina, and have found that if I plug in headphones while SP is running, SP doesn’t recognize them and keeps playing out of the speakers.

Shutting down SP, and starting it back up with the headphones causes SP to recognize them – but I’d rather not have to quit and restart each time I decide I want to use headphones.

Is there a way within the SP environment to force it to recognize the headphones?

1 Like

you have to decide before launching sonic pi. I know it’s hard but life is life :slight_smile:

1 Like

Hi @gl3nn206,

unfortunately, the underlying synthesis engine, SuperCollider, isn’t currently capable of being configured whilst running. You therefore have to tell it what inputs and outputs to use before it starts and then you can’t change them and only quit.

I’ve been planning on and prototyping what it might look like to be able to start and stop a supercollider server whilst everything else is running just fine. I’m pretty sure I have the design down now, so hopefully in the future this is something we can start playing with.

However, for now, you do unfortunately have to restart Sonic Pi when you want to change either of your audio inputs or outputs.

1 Like

Well my usecase is more like this… I’m going along creating some awesome sounds and loving it and then all of a sudden I realize it is after 10pm and so for the sake of those in the rooms around me I decide “oh… I should put in the headphones”.

This use case works in other applications and software on my Mac… was just surprised that it didn’t work in SP… but I saw Sam’s response and now it makes more sense why it doesn’t work in SP.

Hi @samaaron,

Okay that makes a bit more sense. I thought it might be an issue with Mac Catalina as I’ve seen it also breaks Audacity’s ability to use the microphone (the Audacity team is working on a fix now, and there is a work around launching it from the shell).

I didn’t realize the issue was an issue with SuperCollider. I hadn’t even tried headphones prior to upgrading to Catalina. – for the sake of clarity, I didn’t upgrade a machine, my old laptop died and my new Mac came with Calalina on it.

Luckily, SP seems really good about saving all of the buffers when it closes and restarts so it isn’t a huge deal… was just curious if there was a way to avoid the quit/restart cycle as it takes more than a few seconds on my new Mac.

Regards

1 Like

If you use wired phones plugged into the headphone socket on a Mac then that does switch OK. It wont work if you use a bluetooth or usb based headset. That’s my experience on a Mac.
I prefer to use phnes like these to minimise latency problems.

Wired is what I’m using – I only used wired. And mine is not switching.

Are you on the latest Mac OS? (Catalina)

As I mentioned in the response to Sam, I’ve read that Audacity is also having issues with Catalina… Apple has become more strict in terms of how apps interact with the system in this version of the OS.

For comparison, when I’m running Garage Band (which is rare) it will adjust to using the headphones if I plug them in mid-session.

Anyhow, your response seems to conflict with Sam’s so has me wondering again if this is just a function of SuperCollider, or if it is indeed an issue with how apps interact with Apple’s latest OS. Seems if it was a SC issue then your headphone switching wouldn’t work either… but you say it does…

1 Like

No I’m using older High Sierra

Definitely in the past macOS did some fancy re-routing of the audio do using the internal speakers or headphones interchangeably with Sonic Pi whilst running worked well.

This might have changed recently or perhaps is only supported on certain Apple hardware.

However, the general point of Sonic Pi binding to one OS-level audio device still holds. In the future it would be nice to be able to automatically reboot SuperCollider internally to bind to a different card, but there’s quite a bit of internal re-working necessary to make this possible, sorry.