Static noise when listening to Windows device through Pulseaudio loopback in Manjaro

This is an odd and very specific issue, and I understand there might not be any simple solutions, but here is some context.

I play a lot of video games and I’ve been trying to use Linux all the time for a few years now, but some games are still not supported on Linux. To remedy this, I have a separate Windows machine for these games. The setup might seem a bit odd, but I have the Windows’ audio output connected to the Linux’s mic input so that all the sound passes through Manjaro. This saves me from having 2 microphones and having to manage 2 different Discord sessions.

The issue with this setup is there is a constant noise that is coming from the Pulseaudio loopback. Here is a diagram of the current setup:

audio setup

The Windows machine has its speaker output connected to the microphone input on the Linux machine. Pulseaudio has the loopback module loaded and the microphone input has its volume lowered so it is comfortable to listen to.

Here is a short recording of the noise that I keep hearing: https://drive.google.com/file/d/1L1_ZQwKbr5PPFote99wQJ--TDBOHsCCd/view?usp=sharing

There is a constant static noise that is only present when there is sound coming from the Windows machine. This noise can be heard on any output device on the Linux machine (speakers, wired or wireless headphones). If there are no sound coming from the Windows machine, the noise is not present.

I tried loading the module-echo-cancel module from the solution found on this forum, but to no avail. I also checked if it was a sample rate issue (as hinted at from this Arch wiki entry), but nothing either.

I checked on the Windows machine’s audio output if I could hear the noise when plugging headphones directly in, but I could not hear it. I changed the cable multiple times to see if this was the issue, and nothing either. I also changed the audio interface on both machines (using a cheap USB adapter), and the issue was also present. I even went as far as testing another Windows machine. The noise was still there.

Does anyone have any idea as to what could be the issue? Is there a fix for this very specific problem?

1 Like

Hi, welcome to Manjaro. There are a few things I would check and things that come to mind:

  1. Dedicated mic input is not usually designed for line input; the line output will need to be reduced to avoid distortion, which will affect your signal to noise ratio. What audio device are you using for the mic input? Can you select expected input voltage level?
  2. Interference and ground loops are problematic, and computers often give many issues with audio. Earth leakage or poor shielding from one (or both) computer(s) may be causing an issue. Could potentially be solved by upgrading power supply or audio device, or possibly a mains voltage regulator.
  3. Are you using an RCA/3.5 mm or XLR (with XLR throughout, output and input) cable? How long is the cable? I have found RCA cables often pick up interference and, when having to use them, have found using high quality double shielded coax cable much better. Longer runs exacerbate the issue.
  4. Have you tried putting a microphone into the microphone input, to check that it works as it should with the expected input attached?

Best of luck.

The maximum peak audio level in the recording is < -25dB
https://imgur.com/ZuehK7G.png

A microphone input has a lower input level than the line-level output from the other OS
so the audio level from the other OS must be reduced to a level closer to the level of background noise
and when the audio level is increased within the 2nd system, the background noise is also amplified

Do you have a Line-In jack available instead of a microphone socket?

If no Line-In socket is available, it should be possible to reconfigure the Microphone to Line-In using GUI tool hdajackretask included in package alsa-tools

Mic2LineRetask

If retasking the jack socket is not possible, an audio attenuator should be used to reduce the audio level from the 1st system. This will protect the audio input circuit of the 2nd system from being overloaded and damaged

Hi @nikgnomic, thanks for the feedback. I just checked on the motherboard and I do have a line-in jack. I tried plugging the Windows machine to it and it didn’t change anything. The noise is still present.

As for the audio levels, I’m not familiar with how audio works specifically, but I know this: I have the volume on the Windows machine staying at about 80% and the line-in on Manjaro at around 15%. Adjusting the volume on the Windows machine does not affect the noise, even when lowering it at 0%, the noise is still present. Adjusting the line-in volume does affect the noise greatly. This makes it seem like it is an issue with power more than anything (voltages not playing nice between both machines?).

I was curious and tried the retasking the jacks via hdajackretask and it also did not work.

Any other leads?

Hi @summrum, I checked what you suggested. Here’s some feedback on that:

  1. I’m using the audio jacks provided on both computers’ motherboards. I was using the mic input on the Manjaro machine, but also tried using the line-in instead and it did not change anything.
  2. I’m not sure this is the issue specifically, but it is good to know. I’ll keep that in mind.
  3. I’m using the 3.5mm cables. Both cables I have are pretty long for their use (more than a meter in length). I don’t have access to a shorter cable at the moment, but I will give that a shot when I have one.
  4. As mentioned above, I’ve tried both the microphone input and the line-in. Both had the same issue.

Thanks for the help

I may be way off here.

Have you tried changing the playback sample rate/frequency on the Windows machine?

If that works, you could make changes to /etc/pulse/daemon.conf to match your Windows sample rate. You may need a tutorial from someone more knowledgeable than me.

Another thing you can try is to disconnect your USB audio devices and then send your Windows audio to eliminate any USB interference from the chain.

Hi @tharangalion, I tried that before writing this post. I saw it was mentioned that different sample rates might cause unwanted noise. I checked what the line-in on Manjaro was using (44100MHz) and matched it on the Windows machine, but it changed nothing.

I’ll be ordering a higher quality cable to hopefully remove any interference that could be added between the machines.

Adjusting the volume on the Windows machine does not affect the noise

That would suggest that the noise is from another source, the audio cable or 2nd system

voltages not playing nice between both machines

This can be considered as a problem with voltage levels

Using a line level audio signal of 500mV (rounded up for easier calculation)
the audio signal out from the 1st system at 80% level would be 400mV
and the if Line-In capture level set to 15% the audio signal in the 2nd system would be 60mV

Assuming the 2nd system has a constant background noise level of 6mV,
the audible signal would have background noise level of 10% relative to the original audio signal

But if the Line In capture level is increased to 30% the audio signal would be 120mV
and the relative background noise level would be 5%

If the Line In capture level is increased to 60% (240mv) relative background noise = 2.5%

To keep background noise to a minimum:

  1. Set the audio capture level in ALSA for Line-In to 0.0dB (possibly 100%) so the audio level from the source system remains at the same level in the 2nd system
  2. Set the PulseAudio Input Device level for Line-In to 0.0BdB (100%) to maintain the same audio level
  3. Turn the PulseAudio Playback level down for the Loopback audio to a comfortable listening level, probably to around 15%

I was curious and tried the retasking the jacks via hdajackretask

I suggest you run hdajackretask again and ensure that any Boot override created for the microphone jack is removed

Ok, over 3.5 mm cables over 1 m could well be picking up noise. They effectively work like an antenna. I have had this issue crop up a few times myself, and have solved by making cables from double-shielded coax or switching to XLR when possible.

The fact that the noise is only present when the Windows machine might be due to auto-muting/auto gain control of the mic or line input. You might be able to see if you can turn this feature off, and plug in the cable to just the Manjaro audio input. If the noise is there, it does point at the cable being the culprit.

Okay.

I mentioned removing your USB devices because I once had a USB audio interface that picked up a similar sound. The sound I can here does not sound like electrical hum or static, and there are a couple of occasions when the sound cuts out for a fraction of a second. That said, the music is masking the sound. If you could make a recording of silence rather than music, it would help to isolate the sound to make it clear.

Another thing your could try is to pass sound from Linux to Windows, and listen for the same sound. That would eliminate the Windows box audio out as the problem, and perhaps confirm a cable problem.

Alternatively, if you don’t mind going through reactivation of Windows, how about moving your Windows HDD/SSD from the Windows box into the Linux box, and use BIOS to boot into Windows when you need it? You wouldn’t have to dual-boot. Back up your Windows drive before moving it, though. Or, you could move your Linux drive into the Windows machine.

Thanks everyone for your replies. I’m thinking the cable is the issue as well. I spoke with a few other people and they mentioned it right away. I’ll be shopping for a short cable, shielded as much as possible. Does anyone know any good 3.5mm cables that are shielded from external interference?

@tharangalion, for the dual-booting on a single machine, I used to do that for a long time, but it became annoying when I had to reboot to play a single game, especially when my friends and I keep changing games in a single play-session. Dual-booting, however, would solve the sound issue for sure.

I’ll update the thread when I get the new cable and test it.

1 Like

I received a shorter shielded cable from UGreen and tested it quickly. The noise isn’t as loud, but is still present. For now, I’ll consider it a temporary fix, but it’s definitely not permanent. If I want to keep the current setup (2 PCs), I’ll need to do some major changes in how I manage the audio pass-through.

Thank you all for the help. It is greatly appreciated.

1 Like

Glad to hear you have some improvement after changing the cable. Without switching to XLR, in my experience you are probably best off making your own cables from some double shielded coaxial. You can find twin RCA to 3.5 mm adaptors for this if you stick with the 3.5 mm jacks. I would also look towards an audio device separated from your motherboard, as the on-board devices tend to be more affected by power supply noise.

1 Like

Another quick and dirty fix is making sure the windows audio output is maximized, as the background electronic noise will not increase with the volume of the device. Then you can lower the input device’s volume (not the loopback volume) and the static volume should lower with it.

1 Like

In professional audio, setting optimal audio levels through the audio signal chain is known as gain staging. This process is vital for maintaining an audio signal at the highest possible level above the noise-floor whilst also maintaining headroom between maximum audio level and 0dB to avoid any distortion in the final audio recording/output

Thanks again for all the help. I’ll look into making my own shielded cable in the near future. I also recently increased the volume on the Windows machine to 100% and lowered the input on Manjaro and it did help a little bit for the noise (as expected).

Will comment again when I have made the shielded cable and tested it.