Audio noise/distortion issues

Hi, a SuperCollider newbie here. I’m trying to play a one-shot sample via a MIDI file. However, I’ve got the same issue regardless of what sound I’m generating in SuperCollider. Playing a sound to the left audio channel only is fine. I get extreme distortion or noise in the right channel, though, when playing a sound in stereo or to the right channel only. I’m on an HP Spectre x360 2-in-1 convertible with an Intel i7-8550U CPU @ 1.80GHz (1.99GHz), with 16GB RAM. Running Windows 10, Version 2004. I updated OS on 9/17, but the problem existed prior to that update.

After specifying s.options.device=“ASIO” in startup file, I see the following after booting the SC server:

Booting server ‘localhost’ on address 127.0.0.1:57110.
VSTPlugin 0.4.1

Device options:

  • MME : Microsoft Sound Mapper - Input (device #0 with 2 ins 0 outs)
  • MME : Microphone Array (Realtek High (device #1 with 2 ins 0 outs)
  • MME : Microsoft Sound Mapper - Output (device #2 with 0 ins 2 outs)
  • MME : Speakers (Realtek High Definiti (device #3 with 0 ins 2 outs)
  • Windows DirectSound : Primary Sound Capture Driver (device #4 with 2 ins 0 outs)
  • Windows DirectSound : Microphone Array (Realtek High Definition Audio(SST)) (device #5 with 2 ins 0 outs)
  • Windows DirectSound : Primary Sound Driver (device #6 with 0 ins 2 outs)
  • Windows DirectSound : Speakers (Realtek High Definition Audio(SST)) (device #7 with 0 ins 2 outs)
  • ASIO : ASIO4ALL v2 (device #8 with 4 ins 2 outs)
  • Windows WASAPI : Speakers (Realtek High Definition Audio(SST)) (device #9 with 0 ins 2 outs)
  • Windows WASAPI : Microphone Array (Realtek High Definition Audio(SST)) (device #10 with 2 ins 0 outs)
  • Windows WDM-KS : Speakers 1 (Realtek HD Audio output with SST) (device #11 with 0 ins 2 outs)
  • Windows WDM-KS : Speakers 2 (Realtek HD Audio output with SST) (device #12 with 0 ins 2 outs)
  • Windows WDM-KS : PC Speaker (Realtek HD Audio output with SST) (device #13 with 2 ins 0 outs)
  • Windows WDM-KS : Microphone Array 1 () (device #14 with 2 ins 0 outs)
  • Windows WDM-KS : Microphone Array 2 () (device #15 with 1 ins 0 outs)

Requested devices:
In (matching device found):

  • ASIO
    Out (matching device found):
  • ASIO

Booting with:
In: ASIO : ASIO4ALL v2
Out: ASIO : ASIO4ALL v2
Sample rate: 44100.000
Latency (in/out): 0.016 / 0.016 sec
SC_AudioDriver: sample rate = 44100.000000, driver’s block size = 64
SuperCollider 3 server ready.
Requested notification messages from server ‘localhost’
localhost: server process’s maxLogins (1) matches with my options.
localhost: keeping clientID (0) as confirmed by server process.
Shared memory server interface initialized

Both Realtek audio driver and ASIO4ALL driver have been updated. I’ve got output device sample rate and bit depth set to 24-bit, 48000Hz in Windows control panel. Audio is unaffected in other applications prior to opening SuperCollider (e.g., Audacity, Spotify, Facebook, YouTube). However, once I launch SC and experience that static, it seems that the audio driver image in memory is corrupted in some way going forward. So, I get distortion in other apps at that point, too. By going into the Control Panel and toggling the bit depth/sample rate from 24-bit, 48KHz to 16-bit, 48KHz, and back to 24-bit, 48KHz seems to resolve the problem for the non-SuperCollider applications. Next time I open SC, the problem returns.

Has anyone else seen a similar issue? Any suggestions for a fix? Thanks in advance.

Note that I’m cross-posting this question in Reddit r/supercollider and Facebook Supercollider group.

I would avoid using ASIO4ALL these days (it used to be necessary, to get audio with SC working in Windows). Likely the sample rate of your ASIO4ALL is set to 44.1kHz?

The days I use ASIO with SC if I have a real audio interface that supports it (e.g. my Focusrite), but otherwise I just use DirectSound or another API (just not MME!) and an internal device (Realtek, etc).

Hope helps,
Glen.

1 Like

Glen, thanks. Nothing I could do seemed to get SuperCollider and ASIO4ALL to play nicely together. Therefore, I decided to uninstall ASIO4ALL and move forward with the other options available under Windows 10. MME appears to meet my needs for now, although I’ll try WASAPI if latency proves to be unacceptable. However, I had just started thinking about an external audio interface. I have no immediate plans to record vocals or a physical instrument, though, so I’m wondering what the benefits of such an interface might be. Am I correct in assuming that all audio processing would be offloaded from the internal Windows interface and audio devices and totally processed in the external interface? Higher sample rate? Lower latency? What audio interface would you recommend?

No. The audio interface converts analog to digital and digital to analog, but the processing of the digital signals happens on your computer’s CPU.

Kyma is a programmable digital audio system with specialized DSP hardware. It’s… well, it’s expensive. (It’s very powerful, lower latency than consumer OSes can handle, and very high quality – just it’s in a way way different league from a US$200 USB audio interface.)

In Windows, a dedicated device driver for the audio interface should improve stability and performance. Windows’ handling of the built-in audio card is especially bad. Also, an external soundcard is likely to have higher quality converters and a bit less electrical interference noise.

hjh

Yes, when possible I use an external audio interface with SC (I happen to have Focusrite, but I understand other brands are available ;-). I think most of them have reliable ASIO drivers. When working on a laptop, though, I often use the internal sound card, and have good luck with it nowadays (thanks to SC’s much improved support for Windows audio, in version 3.10.something). But I also found using a non-ASIO interface was important when doing live coding streams, since I found OBS Studio couldn’t stream/record the output audio from a device when SC is using the ASIO API – in this case, I would use the internal (or external) sound device in SC via DirectSound or WASAPI.

But again, I would really avoid the MME API, I’ve tended to get glitches and hiccups on it, especially on medium-powered laptops when running on battery. On a laptop without external audio interface connected, I tend to use the DirectSound API (even though it’s not the most “modern”) to access the internal audio hardware (Realtek or whatever) with scsynth; it’s what’s proven most reliable for me on various computers and laptops from different brands, and I “never” have crashes or audio hiccups (knock on wood), and the latency is fine for my purposes. And it also means I can use built-in virtual devices like the Windows “Stereo Mix” to take SC output into other applications as an input.

So, from my own experience, I would suggest, in order of preference:

  1. use an external audio interface with its native ASIO driver
  2. when not available, use the computer’s internal audio hardware via DirectSound or WASAPI (or whatever API works for you, probably either should work equally well)
  3. if you need to do inter-application audio or grab streams with (e.g.) OBS Studio, use whatever audio hardware you like (internal or external) via DirectSound or WASAPI APIs, not ASIO in this case.

I would be happy to hear from other peoples’ experiences and recommendations with SC audio on Windows. Especially would be glad to hear success stories with using SC with ASIO drivers, while also sending audio between applications. I’ve tried “Voicemeeter” and similar things, with some – but not consistent – success. If you don’t mind having a DAW open, I think you can also do virtual ASIO routing with Reaper’s ReaRoute (and probably other solutions).

Thanks,
G.

sorry to revive an older thread, but i failed to find anywhere a similar issue that i’m now facing!

i’ve recently had switch to windows again and now i have this exact behaviour on my laptop (lenovo yoga i7 with realtek audio). whenever i boot up SC and play anything, it gets heavily distorted and an audible whining sound keeps playing even when i do ctrl+.

it does not seem to depend on the audio drivers, i’ve tried mme, directsound, wasapi and several asio solutions.

it works perfectly though with external audio devices, but i can’t be reliant for mobile use and showcasing/workshop/streaming situations on having an interface with me all the time.

was this issue resolved somehow for your makdaddy48? or are there other people who had similar situations and found some clues?

I can’t help you much because I don’t know how Windows works. But on Linux, SC connects to an audio interface that is called Jack, which allow to specify audio settings. I get those kinds of glitches when I set the ‘blocksize’ (or ‘samples per period’) parameter too low (on Jack, not on SC itself), because it puts too much stress on my hardware. When using an external sound card, the issue disappears. So this might be related ?

i don’t think it’s related to hardware stress. i’ve tried with different settings of samplerate and blocksizes up to 2048. i feel like it’s addressing some wrong audio endpoint or changing some flag, because the behaviour of “pure noise” coming out of the right speaker even persists outside of supercollider after i’ve tried to use it. i have to reboot to use the audiocard on the laptop and the issue can be easily reproduced by trying to use supercollider again. i’ve disabled all kinds of audio enhancement and exclusivity settings, too.

EDIT//:

it seems to be related to the audio quality setting. i thought i tried it before, but since i’ve changed the realtek audio card in windows from 24bit to 16bit it seems the noise does not appear anymore. i don’t really understand why this is related because i also run external soundcards with 24bit. for now it’s a workaround, but i’d be happy if anyone had more suggestions!

best,
dormir