kyleneideck / BackgroundMusic

Background Music, a macOS audio utility: automatically pause your music, set individual apps' volumes and record system audio.
GNU General Public License v2.0
15.86k stars 670 forks source link

Sample rate seems broken with AirPods #272

Open Lyro1 opened 4 years ago

Lyro1 commented 4 years ago

I am using AirPods Pro on my MacBook Pro.

With the MacBook speakers, Background Music works just fine. But as soon as I switch to my AirPods, the sound is awful: very low, with scratches. After a few researches, my guess is that the Sample rate is broken with the AirPods.

I will be looking into it myself, but if anyone has time to do so I would love some help.

TLDR: Background Music output on AirPods Pro looks demonic, seems like a sample rate issue.

kyleneideck commented 4 years ago

You might be able to use Audio MIDI Setup (/System/Applications/Utilities/Audio MIDI Setup.app) to change the sample rate of the Background Music device to match your AirPods. BGMApp should be doing that automatically, but maybe it's failing for some reason.

Lyro1 commented 4 years ago

I tried to change the sample rate of my AirPods manually, but I can't find any setting that makes the sound any better.

kyleneideck commented 4 years ago

I think I might have been able to reproduce this using some different Bluetooth headphones (Sony WF-1000XM3).

They went into a 1-channel 16kHz mode for some reason and then they sounded like what you described. There's a bug where Background Music only works with output devices that have two channels, i.e. stereo devices.

Can you check in Audio MIDI Setup to see how many channels your AirPods have and if there's a way to put them into stereo mode?

Lyro1 commented 4 years ago

I just tried that, and as soon as I switch to 2-channel, it instantly comes back to 1-channel 16kHz. That's probably an AirPods specific issue, but various inputs from AirPods and other Bluetooth headphones might be usefull

BinaryShrub commented 4 years ago

@kyleneideck I can verify my WF-1000XM3 get fubared as well.

UrDone4 commented 4 years ago

AirPods run at 2 ch 32-bit Float format when just doing audio playback. When you are using an application that needs the mic, it changes to a lower quality 1 ch 16-bit integer format(such as a virtual meeting application). You cannot switch back to the 32-bit float (which is what Background Music uses). Maybe adding an option for background music to run at the 16-bit option is what is needed, since there doesn't seem to be a way to change to that lower quality format for it in the Audio Midi Setup app.

EDIT: Found a workaround that works for me

  1. Quit Background Music to stop the garbled audio
  2. Open System Preferences > Sound
  3. Change Input to use the internal microphone (Dont use AirPod mic)
  4. In Audio Midi Setup, you can now change the AirPods to 2 ch 32-bit Float (for output) since mic isnt being used
  5. Reopen Background Music, works fine
rajkundu commented 4 years ago

I'm experiencing the same issue, but the workaround doesn't seem to work for me. I'm using Bose NC 700s on a 2018 MBP running 10.15.4.

nelsonapollolee commented 4 years ago

+1 -- same issue with NC700s on 2017 MBP running 10.15.3