-
Notifications
You must be signed in to change notification settings - Fork 749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugging in headphones does not switch over from builtin speakers #5577
Comments
|
Yes, I have seen this too on M1 MBP under Big Sur. |
|
I'd now like to add another thing that I would like you to try: Boot SuperCollider. Weird huh? Try doing the same thing when playing sound in Quicktime Player to experience what I am sure everyone wants to have happen when plugging in or unplugging headphones. (I am still running the same machine and SC version as when I originally posted) |
Not weird :) unfortunately we currently don't handle audio device switching on the M1 macs. Someone needs to take a look what change in the device switching layer to bring this functionality back for M1 macs. |
|
The "unplugging headphones" case is just a special case of the more general problem of switching audio devices while the server is running. On Mac, this ultimately comes down to running My GUESS is that adding a new server command to switch audio devices, and using that to basically call If anyone picks this up, I would recommend NOT approaching this from the perspective of "switching devices when you plug in headphones", but rather just implementing it as a "switch the audio device" server message, and let the client decide on the behavior (it would be easy enough to add a primitive to list audio devices in |
|
@scztt thanks for the comments. Just one note here - switching headphones to speakers does work on intel hardware (at least before Big Sur/Monterey, can't test these ATM), so some form of device switch is already implemented AFAIU. First, it's a matter of figuring out what changed lately and bringing back that functionality on M1. As for device switching other than built-in/headphones (which is expected and should work), I also think it's worthwhile to have this implemented for other devices. BUT if anyone attempts this - it should not be an automatic switch in all cases. At the very least the user should be prompted what to do (IMO MainStage strikes a good balance between functionality and stage-ready reliability - it asks when the devices change whether to use the new one or keep using the old one). |
I believe it's actually a hardware-specific thing and not an OS thing - older macbooks have a single device that does the switch, newer macbooks have two devices where the OS handles the switch. Hard to find info, but here's one article: https://weblog.rogueamoeba.com/2018/11/09/apples-newest-macs-include-better-built-in-audio-devices/ Yeah, I agree that automatic switching could be very confusing / disruptive. But, from the perspective SC unplugging your headphones is identical to unplugging your USB audio interface. AFAIK the only differentiating factor we would have there is the name of the device? It's possible that there are flags deeper in CoreAudio that signify e.g. "you should fall back to this device if this one goes away", but it feels more straightforward to simply let SC specify the behavior openly and have the default be ONLY switching in the narrow case of "External Headphones" and "MacBook Pro Speakers". |
|
It's disappointing that Apple didn't provide any automatic switching options for their aggregate devices, since already work very well as an abstraction over multiple audio devices.... |
Thanks for that clarification. Because the device name did change on older hardware, and because of comments like this one in the code I thought that we were actually handling device switching for built-in speakers/headphones... but it looks like you're right, we were most likely not doing that and the device did not actually change. I was trying to trace that switching behavior in the SC's CoreAudio backend and I couldn't follow it, maybe it's because it's not actually happening :) |
|
Here is a similar issue in Audacity, maybe this gives some clues as to where to move? audacity/audacity#2409 |
|
Btw. I think this is a very important issue. There are quite a few situations in which supercollider has become very awkward to use, to say the least. E.g. you are working with speakers and need to plug in your headphones because you are disturbing someone. Currently we have to explicitly change the settings and restart the server ... |
|
Hey y'all. Just popping in here to add a tiny bit of information that may be good for y'all to have. |
|
Hello again. It's me, the original poster. Just thought I'd bump this thread and provide this little bit of information: Reaper has recently fixed this issue in Reaper, so don't feel bad for not having gotten around to fixing this in SC. Reaper is a commercial software and it took them until very recently (May 30th, 2023) to get this issue taken care of. I hope y'all are not too swamped with stuff that needs fixing and that eventually you'll get around to fixing this issue for SC. Again, I really think it would be good to take a look at how VLC solved this, link in my previous post, as they are also an open source application. Maybe it can be quick and painless? Maybe it can be a matter of copying and pasting a line or two. Who knows? Please know that I love and admire you for the important work that you do with this software. |
|
In audacity this still seems unsolved. What a mess! audacity/audacity#2409 It may have to do with different hardware as well? #5577 (comment) |
Hi, this has been on my radar since discovering SP and SC.
Searching for this listener, example found @ https://github.com/retrography/audioswitch/blob/master/device.c |
Hi, I also noticed this is not an issue with beloved REAPER, so I asked one of the experts, and the masterful Mr. Frankel advised
looking in the codebase this is found, but appears to be commented out... Ax'ing the pseudo-expert, GPT proposed Likely to require tweaks imho, but not sure if anyone here has chops to run with this... |
Environment
Steps to reproduce
Boot SuperCollider.
Choose builtin speakers.
Play any sound.
Plug in headphones.
Expected vs. actual behavior
Notice how the sound is still coming out of the builtin speakers and not out of the headphones. I expected the sound to switch over to the headphones when I plugged them in. I tried reproducing this using another program. I could not. I am convinced that this is an issue with SuperCollider.
The text was updated successfully, but these errors were encountered: