Crackling Sound When Pausing, Skipping, or Seeking with Bluetooth Headphones #424

Open
opened 2025-03-07 12:37:01 -03:00 by moritz1000 · 17 comments
moritz1000 commented 2025-03-07 12:37:01 -03:00 (Migrated from github.com)

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:

  1. Connect Bose QC45 to a Mac mini M4.
  2. Play any song in Cog.
  3. Pause, skip, or seek forward/backward.
  4. Notice the crackling sound.

Expected behavior
Playback controls (pause, skip, seek) should function smoothly without crackling.

Version information:*

  • macOS version: 15.3.1
  • Cog version: Version 3040 (3040-g267948350)

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.

**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: 1. Connect Bose QC45 to a Mac mini M4. 2. Play any song in Cog. 3. Pause, skip, or seek forward/backward. 4. Notice the crackling sound. **Expected behavior** Playback controls (pause, skip, seek) should function smoothly without crackling. **Version information:*** - macOS version: 15.3.1 - Cog version: Version 3040 (3040-g267948350) **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.
kode54 commented 2025-03-08 02:46:17 -03:00 (Migrated from github.com)

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.

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.
kode54 commented 2025-03-08 02:57:49 -03:00 (Migrated from github.com)

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.

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.
kode54 commented 2025-03-08 03:02:29 -03:00 (Migrated from github.com)

Can't reproduce any noticeable crackle with Sony headphones either.

Can't reproduce any noticeable crackle with Sony headphones either.
moritz1000 commented 2025-03-08 04:28:56 -03:00 (Migrated from github.com)

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.

Image

audio crackling.mp3.zip (you might have to turn up the volume)

Image

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. ![Image](https://github.com/user-attachments/assets/ae56bf2f-e4ac-4eaf-95fd-f5b3a415b0d1) [audio crackling.mp3.zip](https://github.com/user-attachments/files/19142241/audio.crackling.mp3.zip) (you might have to turn up the volume) ![Image](https://github.com/user-attachments/assets/178c5640-aa6f-4a4c-9801-bec88ad5aa55)
moritz1000 commented 2025-03-08 04:52:42 -03:00 (Migrated from github.com)

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.

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.

Image

> 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. 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. ![Image](https://github.com/user-attachments/assets/b5d4cde6-6a8c-4836-bbfe-b4fdfd48ef5d)
kode54 commented 2025-03-08 05:17:10 -03:00 (Migrated from github.com)

Please try build 3047.

Edit: Strike that, I bodged the fade routine.

Edit 2: Try build 3049. It should be working now.

Please try build 3047. Edit: Strike that, I bodged the fade routine. Edit 2: Try build 3049. It should be working now.
moritz1000 commented 2025-03-08 06:28:55 -03:00 (Migrated from github.com)

Thank you! I will test it as soon as the update is availabe.
Currently I don't see Build 3049.

Image

Thank you! I will test it as soon as the update is availabe. Currently I don't see Build 3049. ![Image](https://github.com/user-attachments/assets/61efa128-9b79-4484-a7d8-1de984f4cb43)
kode54 commented 2025-03-08 18:22:47 -03:00 (Migrated from github.com)

Try 3050, which is up now.

Try 3050, which is up now.
moritz1000 commented 2025-03-09 03:13:38 -03:00 (Migrated from github.com)

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.

> 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.
kode54 commented 2025-03-09 05:13:53 -03:00 (Migrated from github.com)

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.

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.
kode54 commented 2025-03-09 05:15:06 -03:00 (Migrated from github.com)

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.

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.
kode54 commented 2025-03-09 05:20:02 -03:00 (Migrated from github.com)

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.

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.
kode54 commented 2025-03-09 05:22:58 -03:00 (Migrated from github.com)

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.

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.
moritz1000 commented 2025-03-09 07:30:10 -03:00 (Migrated from github.com)

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.

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.
kode54 commented 2025-03-09 18:42:30 -03:00 (Migrated from github.com)

Just a quick check, is this glitching only happening on seek, or is it happening on pause as well? With 3051?

Just a quick check, is this glitching only happening on seek, or is it happening on pause as well? With 3051?
kode54 commented 2025-03-09 23:01:07 -03:00 (Migrated from github.com)

Please try 3057.

Edit: Or 3058. I added a last minute fix for FFmpeg cover art handling.

Edit 2: Or 3065. Whee.

Please try 3057. Edit: Or 3058. I added a last minute fix for FFmpeg cover art handling. Edit 2: Or 3065. Whee.
moritz1000 commented 2025-03-10 14:02:05 -03:00 (Migrated from github.com)

Just a quick check, is this glitching only happening on seek, or is it happening on pause as well? With 3051?

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:

Pause, skip, or seek forward/backward.

So this means it's an improvement that it only happen on seek now!

Many thanks again!

> Just a quick check, is this glitching only happening on seek, or is it happening on pause as well? With 3051? 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: > Pause, skip, or seek forward/backward. So this means it's an improvement that it only happen on seek now! Many thanks again!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: chris/Cog#424
No description provided.