sonic-pi-net / sonic-pi

Code. Music. Live.
https://sonic-pi.net
Other
10.78k stars 923 forks source link

Crackling noise upon using Apple AirPods Max #3062

Open SecGus opened 2 years ago

SecGus commented 2 years ago

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

ethancrawford commented 2 years ago

@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.

basla01 commented 2 years ago

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

samaaron commented 2 years ago

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

florian-schulz commented 2 years ago

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

samaaron commented 2 years ago

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.

JackGriebel commented 2 years ago

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

henrystoll commented 1 year ago

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

meowlifornia commented 1 year ago

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

digioak commented 1 year ago

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.

gjoseph92 commented 10 months ago

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.
kadenn commented 3 months ago
## =================
## Soundcard Options
## =================

sound_card_buffer_size = 256

I was having the same issue with using an x86 MacBook Pro (16-inch, 2019) + Beats Fit Pro + Sonic Pi v4.5.1

Changing sound_card_buffer_size to 256 fixed it for me.

Thank you @gjoseph92