Crackling Sound When Pausing, Skipping, or Seeking with Bluetooth Headphones #424
Labels
No labels
2230
2243
App version
Apple OS errata
Apple SDK
bug
bugsnag
build
dlt
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: chris/Cog#424
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe
When using Cog with Bluetooth headphones (Bose QC45), a brief but noticeable crackling sound occurs when pausing, skipping, or seeking through a song.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Playback controls (pause, skip, seek) should function smoothly without crackling.
Version information:*
Additional context
This issue does not occur in other applications even when using the same music files (e.g.: foobar2000, IINA).
The crackling sound only happens with Bluetooth audio; wired headphones (including Bose QC45 via cable) work fine in Cog.
The issue appears to be specific to Cog rather than the headphones or macOS.
EDIT: The same problem happens in Cog when using my Beats Flex Bluetooth headphones so it is definitely not specific to my QC45s.
Can't reproduce with Apple AirPods Max and an M4 Pro. I will have to test with my old broken pair of Sony WH-1000XM4 cans.
Maybe you can identify which audio format you're playing (or at least sample rate and number of channels), and which DSPs you have enabled at the same time? (Rubber Band, FreeSurround, Equalizer, HRTF) And which sample format is reported for the device in Audio MIDI Setup.
Basically, the only thing I do special for pause/unpause is stopping or resuming the output AUAudioUnit to Core Audio. For seeking or skipping, I restart audio output as well as clearing the output buffers.
Can't reproduce any noticeable crackle with Sony headphones either.
So, I created this "very scientific setup" to be able to record the issue:
I listened to a song in Cog while playing around on the seekbar - everytime I skipped forward or backward you can hear the small crackling sound.
audio crackling.mp3.zip (you might have to turn up the volume)
Mostly MP3s and FLACs
Sample Rate seems to be always 44,100 Hz
Number of channels seems to be always 2
As for the rest I don't think I changed any settings in Cog so it should all be set to default.
Please try build 3047.
Edit: Strike that, I bodged the fade routine.
Edit 2: Try build 3049. It should be working now.
Thank you! I will test it as soon as the update is availabe.
Currently I don't see Build 3049.
Try 3050, which is up now.
Thank you for you work!
I just tested build 3051 and sadly I have to report that the crackling issue still persists.
Dev literally can't hear any crackle. Not even in your sample. Your sample has the abrupt cutoff of the playback stopping and nothing more. Now there is a 125ms fade. If your sound device crackles when the sound output is terminated after the fade, it is defective.
Use the Add URL feature to add a
silence://20
to the playlist to simulate 20 seconds of silence. (It will also show an error mark, since this feature isn't meant to be used normally.) If you manage to produce crackling from that, it is indeed your sound system and not the player.Also, I can't record my headphones, because they all do head detection and cut off all sound unless there's a head sitting inside them. And my microphone records -30dB of noise constantly.
I only cut off and restart sound output. If I keep sound output open permanently, it should stop the crackle, but then your machine will never go to sleep while the player is paused.
Thank you for taking the time to investigate this issue — I really appreciate your efforts. I apologize if this has been a wild goose chase.
I tried the
silence://20
test as you suggested but I can't reproduce the crackling there.I'll continue looking into whether this could be something specific to my setup rather than Cog itself.
The crackling also appears e.g.: in Firefox when watching YouTube Videos and seeking through the video.
But at the same time I still can't figure out why I don't notice any crackling while playing music in foobar2000.
Maybe I should just start listening to my music via cable on some propper headphones.
Just a quick check, is this glitching only happening on seek, or is it happening on pause as well? With 3051?
Please try 3057.
Edit: Or 3058. I added a last minute fix for FFmpeg cover art handling.
Edit 2: Or 3065. Whee.
So I just installed version Version 3065 (3065-g845b33e42) and the crackling sound only happens when seeking through a song or when first starting to play music not while skipping songs, pause/playing.
When I first made the I opened this issue I wrote under steps to reproduce:
So this means it's an improvement that it only happen on seek now!
Many thanks again!