[USB sound card] High gain noise

Hi, running MODEP on my RPi 3b+, I get a very annoying high pitched electronic noise from my USB sound card. The noise is infrequently changing its pitch slightly between two frequencies. This alternation could be caused by any electronic module on the board, but I am not sure about it. The noise is also present with the guitar not plugged in.

As it’s not, or less present using a different OS and guitar amp software, it might be a MODEP related issue?

Trying to find the cause for this noise I tried the following so far:

Set very conservative jackd settings (-p 512 -n3)

Updated firmware using rpi-update

Changed the following settings in /boot/config.txt one by one:

  • Set USB-1.1 mode: dwc_otg.speed=1

  • Use alternative pwm mode: audio_pwm_mode=2

  • Disable audio dither: disable_audio_dither=1

Constantly played silence: aplay -t raw -r 48000 -c 2 -f S16_LE /dev/zero

Used different power supplies, headsets, cables, etc.

Powered RPi with a battery pack to eliminate issues with socket power supply.

Put slight pressure on the different electronic components of the RPi to make sure none of them where vibrating/resonating.

Removed HDMI and keyboard, leaving only the USB sound card.

When I booted the RPi with a different Raspbian Stretch image running Guitarix, it also produced some noise, but not this high pitched electronic noise. Disabling auto gain in alsamixer got rid of the noise.

Disabling auto gain using the MODEP image only lowered the volume of the high pitch sound.

Then I booted Android (Lineage OS) and used a guitar amp app. No noise at all. Just clear and brilliant sound!

Conclusion: None of the hardware is causing this issue.

So I booted back into the MODEP image and muted the bcm2835 device just to make sure.

Then I muted the mic and mic capture device of my USB sound card, which to my surprise didn’t have any effekt and my plugged in guitar was still amplified.

Muting the speaker and auto gain control however worked. I saved these settings (alsactl store).

Next I stopped Modep ‘systemctl stop mod-ui mod-host jack’. The noise was gone.

Then I started MODEPs components one by one.

  1. ‘systemctl start jack’ The noise appeared, but very faint

  2. ‘systemctl start mod-host’ No change

  3. ‘systemctl start mod-ui’ The noise got amplified and was noticeable as before. Unplugging the virtual patch cable in the UI reduced the noise to the level when only jack was running.

I’m running out of ideas here. Any help is appreciated.

Hey, any way you could record the noise you are hearing? From the description, it sounds like it’s crosstalk between audio analog signals with digital processing signals which induces the high pitched noise.

Muting and stopping jack may have removed the noise, as usually the audio output circuitry is shutdown if it is not in use on audio cards, removing the noise.

You may use jack_capture to capture the audio before it goes to the hardware output (see Overruns with arecord at 192 khz 2 channel on example usage) - by capturing it at the last stage of software processing, you may transfer the audio file to another system and listen to it to see whether the noise is present in the recording. If it’s not, then the audio output hardware adds it.

The same can be done to capture audio input immediately and listen to it on another system.

Hi. I recorded the noise with jack_capture as suggested.

jack_lsp gives me one capture and two playback devices, the latter which I recorded as stereo.

The recording of system:capture_1 contain a bit of noise, but without the high pitch peaks.
The recording of system:playback_* contained noise with the peaks.

Just to make sure, I unplugged the jacks between input and output in the MODEP UI and again recorded system_playback_* and the noise was completely gone.

If I understood you correctly, the capturing of system:playback was still on software level? Was it before reaching the USB sound card, or was it already on the USB sound card, just before the headphone jack?

As it seems, the input is adding a bit of noise which gets amplified. That’s ok with me. Really disturbing are these high pitched peaks, which seem to be added somewhere between input and output. They even appear using the guitar tuner effect, rendering it useless.

Happy to upload the wav file with the noise somewhere, if it helps.

Btw: Earlier this day I did an apt-get upgrade, since then alsamixer is missing and can’t be reinstalled either. Is it a bad thing to upgrade MODEP?

Yes, the jack_capture of system:playback is at the last stage of the software, before it gets sent to audio hardware.

I think you may upload the file directly to the forum as a zip file.

It should be ok, something probably went wrong during the upgrade though or at some other time.

Ah, thanks. I wasn’t aware of the upload button. I attached both the system.wav with the very faint noise and the problematic playback.wav. The pitch noise might seem not so bad at first, but it really gives you a headache over time.

I’m trying to borrow another USB sound card, hopefully with a different chipset. Should receive it by tomorrow evening. Will let you know, if another card behaves differently.

system_capture_1.zip (251.9 KB)
system_playback_stereo-MODEP_jacks_connected.zip (954.3 KB)

Took me a while to get hands on a different USB sound card, but I’m now testing an InLine mini stick with a C-Media chip, as opposed to the SpeedLink stick with a CM108 chip.

Good news is, that the infrequent high pitch noise is gone. Unfortunately the new stick also produces a fair bit of noise and doesn’t sound as far as loud and rich as the old one did with similar alsamixer settings.

Both sticks don’t produce any noise, when being used on a notebook running Ubuntu Studio and Guitarix. The old stick doesn’t even generate this annoying high pitch noise.

It seems to be specific to using them on the RPi 3b+ running Raspbian. Possibly it’s not happening, when using Android on the same RPi, but I have to confirm this.

Is anybody aware of Ubuntu Studio, or Guitarix using a filter to cancel out this noise? Or could anyone recommend a way to so using MODEP/Raspbian?

The noise certainly gets reduced, when lowering the values in alsamixer, but then I have to crank up the amps that MODEP provides, which then amplifies the noise again…

BTW. I noticed, that the different amps that MODEP provides, add different noise to the signal, when using different amp settings. Is this by design, so the amps sound like the originals – including their specific noise? Or is it just the noise from the sound stick being amplified using the different characteristics of the amps?

ALSA is a very complicated system unfortunately, and on different distros you get different preset files for firmware and different firmware support in general. Sometimes audio device has a ton of settings which are just not correctly set, and you have to copy the state over from a working system to a poorly working system. Check what you have in amixer contents output on both systems to compare. I would also do a clean test on RPi by stopping jack, mod-ui and mod-host via systemctl - check if the noise is gone - if not then this might be a driver or configuration problem. Also, try unplugging and replugging after that and check again (without starting jack etc.). If the noise is gone, then use speaker-test -c2 -t wav to test both output channels with builtin audio test sample. If there’s noise during test then most likely hardware configuration is incorrect, and you can try fixing that by tuning alsa controls via amixer command by comparing with Ubuntu’s values. It might be a pain but once done you should be able to warp these commands into a script and next time it’s easy. If there’s no noise during test then most likely jack’s configuration is not working well with this card - try to compare jack config from ubuntu with RPI’s (I mostly mean command line parameters). Ubuntu might also be running a different version of jack. Maybe you need to increase buffer length to resolve noise, try 1024 as a safe value which usually works for any hardware.


Hi, I have the same problem! Did you find a way to fix?

Hi Alessandro,

couldn’t fix it, so I worked around it by buying a used (cheap) Behringer UCG102 USB interface. Sounds quite good, but certainly isn’t supporting the idea of a tiny, transportable amp solution…