sonic-pi icon indicating copy to clipboard operation
sonic-pi copied to clipboard

Crackling noise upon using Apple AirPods Max

Open SecGus opened this issue 3 years ago • 13 comments

SecGus avatar Apr 14 '22 12:04 SecGus

Hi :)

I've recently started playing around with Sonic Pi and have found that sound resolution produces a crackling noise when using the AirPods Max.

I'm on the latest macbook pro with the M1 chip, so there shouldn't be any issues with the CPU or sound-card. Furthermore, the sound is fine when using the macbook speakers, however, upon using the bluetooth headphones there is a weird crackling distortion around each intensive sample.

Even simple code such as the following produces the noise:

sample :drum_bass_hard

It also only appears to happen with bassy samples (please note the headphones have no issue with normal bass-heavy songs outside of sonic pi).

Let me know what you think

SecGus avatar Apr 14 '22 12:04 SecGus

@SecGus - what does the scsynth.log log file say? you can find it at ~/.sonic-pi/log. Maybe there's an issue with the sample rate that the headphones emit? Typically, most times Sonic Pi connects to audio devices set to 44.1 or 48 KHz.

ethancrawford avatar Apr 27 '22 07:04 ethancrawford

Hi, Was this issue ever solved? Having the same problem with Airpods 2. Thanks

basla01 avatar Jun 09 '22 23:06 basla01

Hi, unfortunately I don't have access to either a Mac with an M1 chip or Airpods to test and resolve this issue.

samaaron avatar Jun 16 '22 15:06 samaaron

Using my Airpods Pro on my i9 MacBook (16" 2019), I only get screeching noises on hitting play.

florian-schulz avatar Jul 01 '22 10:07 florian-schulz

I managed to borrow a pair of AirPods to test and also could only get either a very low-fi broken sound or screeching.

There's clearly something funky going on with SuperCollider here.

I've tried playing around with the audio-settings.toml file but can't seem to find any settings that fix it.

I'll leave this issue open - in case someone has better ideas of how to fix it. However, until then, I can only recommend you do not use AirPods with Sonic Pi - apologies.

samaaron avatar Jul 21 '22 07:07 samaaron

Same issue here... m1 mac using airpods severely distorts the audio for the program

JackGriebel avatar Sep 15 '22 16:09 JackGriebel

Same issue here: Using a x86 MacBook + AirPods only plays severely distorted audio

henrystoll avatar Nov 01 '22 14:11 henrystoll

Same issue here. Using MacBook Air (13-inch, Early 1015) with macOS 12.6.3 + AirPods 2 and Sonic Pi 4.3.0

naturestudy avatar Mar 23 '23 03:03 naturestudy

I think I'm having similar issue on Windows 11, connected to PC using bluetooth Bose earbuds. When recorded, popping sound artifacts aren't there. Only when playing live.

digioak avatar Aug 24 '23 23:08 digioak

I had the same issue with an Intel MacBook Pro and AirPods Pro.

It seems other people have had related issues with Bluetooth headphones and SuperCollider involving sample rate: https://github.com/supercollider/supercollider/issues/5729.

I found this Reddit thread which ended up providing a solution: https://www.reddit.com/r/supercollider/comments/qj36ji/issue_with_headphones_after_montereyos_update/

Setting the buffer size in my audio-settings.toml to 64, 128, or 256 all seem to solve the issue:

## =================
## Soundcard Options
## =================

sound_card_buffer_size = 256

Anything larger than 256 leads to Block Size: 480 in the audio hardware info (which is the same thing I get with no config set), which gives crunchy sound.

For anyone looking to set this: on macOS, the file you need to edit is ~/.sonic-pi/config/audio-settings.toml. You can do that in the terminal if you're comfortable, otherwise:

  1. Open a new Finder window
  2. Do shift-command-G, or in the menu bar, Go > Go to Folder
  3. Paste in that path ~/.sonic-pi/config/audio-settings.toml
  4. Open the file in your preferred text editor. The easiest way is to open TextEdit (comes with macOS), then drag the file onto the TextEdit icon in the Dock to open it with TextEdit.
  5. Find the Soundcard Options section and make the necessary change.

gjoseph92 avatar Dec 08 '23 03:12 gjoseph92