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 669 forks source link

Audio distortion making it impossible to hear anything #445

Open MoonPhoenix83 opened 3 years ago

MoonPhoenix83 commented 3 years ago

Description of the bug The audio is distorted and impossible to hear when my blutooth headphones are reconnected. Update: paused all video playing but the distortion is gone. The audio is still there but the video is stuck on one frame.

Steps to reproduce Play any audio throught background music after reconnecting bluetooth audio device (sounds like a Dalek and completely inaubible) (See above)

Versions

Hardware

MoonPhoenix83 commented 3 years ago

Update: paused all video playing but the distortion is gone. this bug makes the app impossible to use so I have downgraded as a temporary solution

kyleneideck commented 3 years ago

A lot of Bluetooth devices will switch to a single channel mode in some cases. From the sound of it, that's probably not what's happening here, but it's worth checking anyway. Background Music currently only supports 2-channel devices.

MoonPhoenix83 commented 3 years ago

By channels do you mean left/right audio so stereo?

bloomkd46 commented 3 years ago

I have the same problem where it sounds really glitchy, it only happens when I'm using my AirPods. Mac OS Big Sur

kyleneideck commented 3 years ago

@MoonPhoenix83 That's right. You can check with Audio MIDI Setup.app.

bloomkd46 commented 3 years ago

never mind I found out that zoom was changing my audio settings to mono.

MoonPhoenix83 commented 3 years ago

Right, I checked the channels in Audio MIDI setup and they're all 2 channel. But, as a temporary fix, after a few tries between switching between the headphones and Background music, it worked. I will try to fiddle with zoom to find a long term solution, but this is good for an interim.

OEverything commented 3 years ago

When I have this problem with wired headphones, if I leave Background Music open, switch my system audio device to the computer speakers, switch the Background Music output device to the computer speakers, then select my system audio device to Background Music then change Background Music's output device to the headphones, it fixes it. Don't know if this works with Bluetooth headphones.

OEverything commented 3 years ago

But if that doesn't work then just mess with the hz output in Audio MIDI Setup a bit then bring it back to 48k.

OEverything commented 3 years ago

And if that still doesn't work then idk about a fix for it.

iranzoferri commented 3 years ago

Same problem here. Google meet and youtube at the same time, "meet" sounds well, but youtube only emits an inaudible noise.

My hardware:

OEverything commented 3 years ago

I found that restarting the computer works to fix it. After restarting, open Background Music before you play any media and it should be fine.

mavenor commented 3 years ago

TL;DR — worth looking into codecs?

I’ve experienced the distortion too. I’ve been wondering if this is a mid-playback codec-switch thing, though…

AFAIK, most bluetooth two-way audio devices (like my Sony WH-100XM3 headset) use one bluetooth profile and codec when the mic is in use (HFP with SCO in my case), and a much higher-quality codec when only playing audio (A2DP with AAC or SBC). Most of the times I experience this distortion, my headset was communicating over one bluetooth profile (and therefore a corresponding audio codec), and switched to another While in a Microsoft Teams meeting with my headset’s microphone in use (when the bluetooth profile selected is HFP, and the codec used for audio output is SCO)

116709936-d2454e00-a9ee-11eb-9bab-8c27e665022f

But while just playing audio, like on a website or local app, the A2DP profile is selected, and (depending on the bluetooth device, something like SBC or AAC):

116712225-4254d380-a9f1-11eb-872d-1323dde836ed

And in my experience, it’s these switches that are the culprit. I’ve once successfully obtained undistorted audio through the SCO codec (with my mic on during a Teams meeting), and AAC output works fine for me most of the time. To make it all work in either profile, I’ve had to play a lot of acrobatics, restarting the concerned audio-providing service (Teams, Music, etc.), restarting Background Music, toggling the output to the Internal Speakers in the Background Music menu and then back to my bluetooth device. And so far, only a random combination of these stunts makes it all work in a certain codec without distortion, so I tend to keep it in A2DP by refraining from using my headset mic altogether nowadays xD

Hope this helps!

P.S.: Sorry about the distracting graphs in the screenshots

mavenor commented 3 years ago

Lol 🤣 I was so convinced Now I think I was being stupid Maybe it’s the BGM audio device? Wondering cuz restarting coreaudiod seems to help me sometimes…

cepsong commented 1 year ago

I confirm this is a bug and it shows very often (like a buffer memory overflow issue). The only way to resolve it is to reset coreaudiod. I hope there can be an auto buffer clear function integrated to avoid such an issue from arising.