Distortion / Glitching from Audio Input

Hi -

I’ve noticed some serious glitching/distortion in one of my patches that takes in audio input in from my mic/pickup. When I broke the problem down by removing all processing, I noticed it happens even using a simple {SoundIn.ar(0!2)}.play(); It lasts for about 5-10 seconds, comes in randomly, and then clears itself up.

  • Things I’ve tried

    • Upgraded from SC3.11 SC3.13
    • Tried a very large (2 gigs) then a relatively small (16384 kb) mem sizes for server options
    • Two different sound-cards for the mic / pickup
    • Monitored the CPU and Meter when the glitches happen - no issues. No clipping, no heavy CPU usage (1%-ish or less)
  • Next steps:

    • Remove massive amount of files from my computer to make space. I don’t have a lot of memory. Storage: 9 Gigs left :\
    • Try on a much older machine / operating system. Doesn’t fix the problem.

-My Machine
MacBook Pro (13-inch, 2020, Two Thunderbolt 3 ports)
Processor: 1.4 GHz Quad-Core Intel Core i5
Memory: 8 GB

Just in case it helps, I recorded the sound. Not sure if links are a good idea for posterity, but:

Does any one have any ideas? So close to being able to perform again with SC!

MGRT

What is the audio block size?

Thanks for the response:
s.options.blockSize; yields the default 64 samples

Did you change the hardware buffer size: s.options.hardwareBufferSize? I have had problems when not leaving this at the default value which I think is nil, meaning that the audio interface itself manages the buffer size (as I recall).

Hi Thor. I haven’t changed the default hardware buffer size.

When I evaluate the s.options.hardwareBufferSize; command, it returns nil. When I reboot the server, the post window reads:

SC_AudioDriver: sample rate = 44100.000000, driver’s block size = 512

Just incase you didn’t know, SoundIn wants an array of channels, SoundIn.ar([0,1] is probably what you meant. 0!2 duplicates the first mic input… I imagine this is completely unrelated to your issue though.

Is that two soundcards at the same time using apples aggregate thing? Sometimes that causes issues if set up wrong.

Just to follow up on what Jordan wrote, if I use the internal soundcard on my M1 as output and my UA interface as input I also get weird distortion from time to time.

1 Like

The goal was to duplicate one channel so I can hear it in my left and right ears while testing.

I’ve tried macbook pro (mbp) internal microphone as input and the headphone connected to my mbp as output. Noise happens.

Then I tried: separate audio interface with 1 channel into supercollider and mbp headphones as output and still happens.

Could you try just using the external audio interface, no macbook headphones?
And mess around with your system sound output – I think you want the mac sounds out of one sound device and supercollider out another.

1 Like

Im going to try all routing combinations and report back asap. One thing I’m noticing is if I play loud, I can get it to stop, so it seems like there’s something wrong with my hardware somewhere. But thats just an observation and need to test it out

Thanks for walking through this with me. Being able to perform again means a lot to me and this is really bumming me out. Here’s the updates of my tests:

Clean Signal:
2014 Macbook Pro
Internal Microphone → Supercollider → External Headphones

BAD Signal:
2014 Macbook Pro
Audio Box Audio Interface → Supercollider → Macbook Pro Speakers

Clean Signal:
2020 Macbook Pro
Internal Microphone → Supercollider → External Headphones

BAD Signal:
2020 Macbook Pro
Audio Box Audio Interface → Supercollider → External Headphones

BAD Signal:
2020 Macbook Pro
Focusrite Scarlett 2i2 Interface → Supercollider → External Headphones

I’m pretty stumped.

I’ve tried two different audio interfaces, three different audio cables now, varied instruments (digital keyboard, acoustic instrument via external microphone), two different computers, and three version of SuperCollider.

In the past when performing with SuperCollider, I’ve used FireWire with no issues on my 2014 MacBook Pro. I’m wondering if using USB has anything to do with it. Both my interfaces and computers have different USB types, so I’ve technically tried different USB cables, but my only guess is maybe I need better USB cables. I’m going to try that (ferrite bead), as well as recording into another software, but I don’t think that’ the issue.

The biggest thing that’s confusing me is that I can get the glitches/distortion to STOP by playing louder, and sometimes it starts when I’m NOT even playing - I’ll hear a few small cracks, start playing something, and then it fully glitches…I play a little louder, and it goes away.

In the cases where you are using external soundscards (Audio Box, Focusrite) are the
headphones through the external interface or straight from you mac?

Headphones through the mac, and as you mentioned in a previous post, it seems like that’s the problem!!

I did about about an hour of testing last night using an external interface as input and the same external interface as output, and had no issues using SuperCollider or Audacity.

I’m going to keep testing throughout the day and mark you previous suggestion as the solution is all goes well. Thanks for the help, both you and Jordan.

I think this is it! Thank you! Fingers crossed

If you absolutely need to use you built-in headphone out with an external audio interface as input, you should try creating an agregate device in Audio Midi Setup. The safer option is definitely to use only one interface - either the built-in with built-in headphones out or an external interface with a phones out from the interface.

1 Like