You are not logged in.

#1 2024-06-25 11:07:40

GOKOP
Member
Registered: 2018-04-29
Posts: 48

Static noise on line-in in Linux but not in Windows

I'm trying to get audio from Nintendo Switch to play through my computer, so that I can use Discord at the same time; for this I'm connecting it to audio line-in on my motherboard.
On Windows I can navigate to "Line-in" in audio settings through the control panel, select "listen to this device" and it's perfect. Sounds just as if I hooked up my headphones to the Switch.

On Linux I do this:
pactl load-module module-loopback latency_msec=15 source=alsa_input.pci-0000_0f_00.4.analog-stereo

It works, but there's also annoying static noise present. My first thought was that maybe it's playing both line-in and microphone input (which is disconnected; I use an USB adapter for microphone for unrelated reasons) but I can switch between them in alsamixer so that's not the case.
How can I get rid of the noise?

Offline

#2 2024-06-25 12:33:42

cryptearth
Member
Registered: 2024-02-03
Posts: 1,072

Re: Static noise on line-in in Linux but not in Windows

To test if it's an unclean input or if the loopback messes up use something like audacity to do a recording and listen to it instead of direct loopback. If the record is clean then it's an issue with the loopback - otherwise it could be a driver issue.
Also: sounds like you dual-boot with windows - make sure to disable fast start in windows - the unclean shutdown could mess things up

Offline

#3 2024-06-25 16:18:31

GOKOP
Member
Registered: 2018-04-29
Posts: 48

Re: Static noise on line-in in Linux but not in Windows

It's exactly the same in Audacity as it is as a loopback. Ultimately I think it's a driver thing, as you say because I've tinkered a bit more and I think that I get the raw signal on Linux while Windows is doing something fancy.
On Windows I can max out volume on the Switch and the sound is clear. It's also kinda quiet though. On Linux on the other hand it's a lot louder and if I go above roughly half, it gets distorted.
This happens on the hardware side (or at least close to it) because lowering the volume of the loopback playback doesn't reduce the distortion.
I completely understand the distortion because I've read in multiple places that the voltage range of headphone output is slightly higher than what line input expects - so the circuit gets overdriven if you go too high.
That makes me wonder how does Windows manage to remedy this - surely the driver must utilize some special function of the audio card? Can I somehow check if I it's possible to configure the Linux driver to do the same?

Last edited by GOKOP (2024-06-25 16:38:22)

Offline

#4 2024-06-26 01:55:40

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,430

Re: Static noise on line-in in Linux but not in Windows

Is a mic boost enabled or so? Check

aplay -l
amixer -c0 #or whatever index your card refers to

Offline

#5 2024-06-26 08:36:35

GOKOP
Member
Registered: 2018-04-29
Posts: 48

Re: Static noise on line-in in Linux but not in Windows

Ok, I think combination of disabling line boost and lowering volume of the loopback did the trick, *almost*. I can still hear the static noise when the volume is comparable to that on Windows but it's a lot easier to ignore now because it's very faint

Edit: in case I wasn't clear enough, disabling line boost got rid of the distortion too

Last edited by GOKOP (2024-06-26 11:06:11)

Offline

Board footer

Powered by FluxBB