33

I've been playing ARC Raiders, and seeing people playing music into their microphone got me to find a way to do that on Linux. Fortunately, it doesn't take much to set it up, but it took me couple of days to piece that commands together. I wrote a post about it, and I figured people here may find this useful.

TLDR: Bind these scripts to a key

Setup Script

src=alsa_input.usb-Samsung_Samsung_USB_C_Earphones_20160406.1-00.analog-stereo; # Sets the microphone name
pactl load-module module-null-sink sink_name=Combined sink_properties=device.description="Combines-real-mic-with-sound-effects"; # Create a virtual device
pactl load-module module-loopback source=$src sink=Combined; # Make microphone play sound into the virtual device

Toggle Microphone Script

dev=alsa_input.usb-Samsung_Samsung_USB_C_Earphones_20160406.1-00.analog-stereo
vol=$(pactl get-source-volume $dev | grep -o '[0-9]\+%' | head -n1 | tr -d '%')

if [ "$vol" -eq 0 ]; then
    pactl set-source-volume $dev 100%
else
    pactl set-source-volume $dev 0%
fi

Play Sound Script

# Optionally add "pkill paplay" so that sound can never overlap
paplay --device=Combined --volume 30000 <Path to the file you want to play>
# Optionally repeat the same command but without the --device flag so you know what's being played in the microphone

Kill All Sound Being Played

pkill paplay
you are viewing a single comment's thread
view the rest of the comments
[-] Assassassin@lemmy.dbzer0.com 14 points 9 months ago

This is so much more work than you need to do. Swap over to pipewire and qpwgraph and route the output from whatever audio app you want to use as a soundboard directly into ark or discord or whatever.

[-] Object@sh.itjust.works 7 points 9 months ago

I did actually use qpwgraph for visualising and verifying my setup! Really cool tool. I just like scripting so that I can have it as part of my NixOS config though.

[-] Assassassin@lemmy.dbzer0.com 6 points 9 months ago

Yeah, that's totally fair, I kinda misunderstood what you were doing my first go around. It's always neat to see a scripted solution to problems like this, it's one of the things that keeps me on Linux.

[-] offspec@lemmy.world 1 points 9 months ago

Helvum is good too

this post was submitted on 14 Jan 2026
33 points (90.2% liked)

Linux Gaming

28126 readers
399 users here now

Discussions and news about gaming on the GNU/Linux family of operating systems (including the Steam Deck). Potentially a $HOME away from home for disgruntled /r/linux_gaming denizens of the redditarian demesne.

This page can be subscribed to via RSS.

Original /r/linux_gaming pengwing by uoou.

No memes/shitposts/low-effort posts, please.

That includes posts generated by LLMs. It doesn’t matter if you “don’t have the time” or “would’ve written the same anyway”, or if “everyone’s doing it geez get with the times”.

For now it’ll also include “AI”-assisted projects that haven't had at least two months of (public, verifiable) dev time behind them.

Resources

Help:

Launchers/Game Library Managers:

General:

Discord:

IRC:

Matrix:

Telegram:

founded 3 years ago
MODERATORS