Pulse -> Pipewire: How to Loopback Line-In Only?

I am trying to get my line-in separated from the rest of my rear audio ports so that I can loopback only that port’s audio when I plug-in another audio source I want to listen to.
Currently Line-in has my phone’s audio jack connected. I want to loopback that port to capture its audio and play it through my speakers or headphones. Timely notifications are important and I don’t want the notification or ringtone leaking into my mic during zoom meetings.
Getting loopback turned on is super easy with alsamixer, but I ultimately want to enable loopback for only a specific port on the card instead of all the ports.
I tried How to separe ports into different devices on pulseaudio? - #4 by nikgnomic and Listen to line-in while keeping a working mic - #4 by nikgnomic from a few forum searches.
I tried to make a card profile like output:analog-stereo+input:analog-stereo+input:analog-linein with a custom analog-linein mapping but the configuration kept giving failed initialization errors and returning to the default so I reverted my changes.
I added the following to /etc/pulse/default.pa

default.pa

#hw:1 for 1080ti
#3 for DVI-D-0/TSBA
#7 for DP-0/LGEP
#8 for DP-3/ASUS
load-module module-alsa-sink device=“hw:1,3” format=s16 rate=48000 sink_name=1080ti_dvi_0 sink_properties=device.description=DVI
#load-module module-alsa-sink device=“hw:1,7” format=s16 rate=48000 sink_name=1080ti_dp_0 sink_properties=device.description=DP0
load-module module-alsa-sink device=“hw:1,8” format=s16 rate=48000 sink_name=1080ti_dp_3 sink_properties=device.description=DP3

The rest of it is unchanged from default.
Relevant hardware info:

aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC1220 Analog [ALC1220 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC1220 Digital [ALC1220 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 11: HDMI 5 [HDMI 5]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 12: HDMI 6 [HDMI 6]
Subdevices: 1/1
Subdevice #0: subdevice #0

amixer --card=0

amixer --card=0
Simple mixer control ‘Master’,0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 87
Mono: Playback 63 [72%] [-18.00dB] [on]
Simple mixer control ‘Headphone’,0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 0 [0%] [-65.25dB] [on]
Front Right: Playback 0 [0%] [-65.25dB] [on]
Simple mixer control ‘PCM’,0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 255 [100%] [0.00dB]
Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control ‘Front’,0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 87 [100%] [0.00dB] [on]
Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control ‘Front Mic’,0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 0 [0%] [-34.50dB] [on]
Front Right: Playback 0 [0%] [-34.50dB] [on]
Simple mixer control ‘Front Mic Boost’,0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 3
Front Left: 0 [0%] [0.00dB]
Front Right: 0 [0%] [0.00dB]
Simple mixer control ‘Surround’,0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 87 [100%] [0.00dB] [on]
Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control ‘Center’,0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 87
Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control ‘LFE’,0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 87
Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control ‘Line’,0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 31 [100%] [12.00dB] [on]
Front Right: Playback 31 [100%] [12.00dB] [on]
Simple mixer control ‘Line Boost’,0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 3
Front Left: 0 [0%] [0.00dB]
Front Right: 0 [0%] [0.00dB]
Simple mixer control ‘IEC958’,0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control ‘IEC958 Default PCM’,0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control ‘Capture’,0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 63
Front Left: Capture 55 [87%] [24.00dB] [on]
Front Right: Capture 55 [87%] [24.00dB] [on]
Simple mixer control ‘Capture’,1
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 63
Front Left: Capture 0 [0%] [-17.25dB] [off]
Front Right: Capture 0 [0%] [-17.25dB] [off]
Simple mixer control ‘Auto-Mute Mode’,0
Capabilities: enum
Items: ‘Disabled’ ‘Enabled’
Item0: ‘Enabled’
Simple mixer control ‘Input Source’,0
Capabilities: cenum
Items: ‘Front Mic’ ‘Rear Mic’ ‘Line’
Item0: ‘Line’
Simple mixer control ‘Input Source’,1
Capabilities: cenum
Items: ‘Front Mic’ ‘Rear Mic’ ‘Line’
Item0: ‘Front Mic’
Simple mixer control ‘Loopback Mixing’,0
Capabilities: enum
Items: ‘Disabled’ ‘Enabled’
Item0: ‘Disabled’
Simple mixer control ‘Rear Mic’,0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 0 [0%] [-34.50dB] [on]
Front Right: Playback 0 [0%] [-34.50dB] [on]
Simple mixer control ‘Rear Mic Boost’,0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 3
Front Left: 0 [0%] [0.00dB]
Front Right: 0 [0%] [0.00dB]

Forgot to include my capture options.

arecord -l

**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC1220 Analog [ALC1220 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: ALC1220 Alt Analog [ALC1220 Alt Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0

I’m certain I can capture at least 2 of my 3 input ports (rear mic, rear line-in, front mic), just not sure how to setup the card profile or configuration.
Also, I found that plugging in my headphones to the front headphone port disables my line-out completely, even though the “Show additional options for Built-In Audio Analog Stereo” does show ports line-out and headphones which I should be able to switch between. I really want to be able to swap between headphones (front headphone) and IEMs (rear line-out) without unplugging my headphones from the front or IEMs from the rear. Can I set them to the same priority maybe?

If you only want to hear the Line-in connection via ALSA loopback to headphones or speakers
configure the ALSA capture inputs not to use Line-in as a capture source, so PulseAudio
cannot use Line In instead of microphone

amixer --card=0 sset ‘Input Source’,0 ‘Front Mic’
amixer --card=0 sset ‘Input Source’,1 ‘Rear Mic’

and save the ALSA settings

sudo alsactl store

Changing the 2nd (Alt Analog) capture source is not critical as ‘Capture’,1 is set to [0%] [-17.25dB] [off]

The playback level controls for Front Mic and Rear Mic are set to 0% but you may also want to mute any loopback audio from the microphones

amixer --card=0 sset ‘Rear Mic’,0 mute
amixer --card=0 sset ‘Front Mic’,0 mute

Turn off Auto-Mute Mode so rear jack is not muted when headphones are plugged in

amixer -c1 sset 'Auto-Mute Mode' Disabled

Auto-mute is useful on a laptop to disable internal speakers, but it is usually not wanted for a desktop systems or users that want to keep headphones plugged in

If you want to mute or unmute either Headphones or IEMs

amixer sset -c0 Headphone toggle
amixer sset -c0 Front toggle

or two commands to change both outputs

amixer sset -qc0 Headphone unmute && amixer sset -qc0 Front mute
amixer sset -qc0 Headphone mute && amixer sset -qc0 Front unmute
1 Like

After making your changes and enabling loopback, only the Line In is played back in the IEMs and Headphones. Success!
However, with loopback enabled there is a significant static soundfloor in my IEMs (lineout) but not in the headphones (headphone). If I mute Front in alsamixer it goes away, but that also mutes the IEMs… so close.
Also, disabling auto-mute sends sound through both devices simultaneously. That’s not exactly what I hoped for, but disabling auto-mute in the alsamixer CLI, then switching between Line Out and headphones in the plasma-pa tray applet is disabling the headphones on Line Out and enabling both on headphones. I can settle for that, but toggling between one and the other (always one active and one muted) would be optimal.

image

image

Should loopback persist on reboot if set in alsamixer?
I use the plasma-pa applet daily and rarely use alsamixer.

Big update to my problems, I just switched to manjaro-pipewire and switching between devices was completely taken care of. I’ve now left my headphones plugged-in (front headphone and front mic) simultaneously with my line out (rear) and each one activates independently when swapping them in plasma-pa applet (as in prior image). The only issue I have left now is the static hissing/soundfloor in Line-Out when using loopback.

Could I use ‘Capture’,1 as the source for line-in in a loopback command or would that require altering the card profile to enable the line-in for ‘Capture’,1 since it’s not an option yet?
Enabling Loopback Mixing no longer plays line-in through any of my sink devices.

Help me please, im new user and i hope same to ( can hear my microphone input in my speaker )
aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC887-VD Analog [ALC887-VD Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: AUDIO [LZY USB AUDIO], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

amixer --card1=1

Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958',1
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958',2
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958',3
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]

please help me

To check your onboard audio controls:

amixer --card=0

Audio codec ALC887-VD has an additional control for loopback mixing that may need to be disabled

amixer --card=0 sset 'Loopback Mixing' Disabled

This topic is about Line In, not Rear Microphone. You may want to create a different thread.