Neil Schemenauer's Web Log

[Archives]

August 12, 2023

Mic boost for MSI B650 TOMAHAWK WIFI board

You would think in the year 2023, they would have finally figured out how to make audio chips and drivers that can perform basic functions (e.g. play sound through headphones, record sound through a mic). Alas, it is not so. With my shiny new MSI B650 TOMAHAWK WIFI motherboard, I cannot record the mic. Updating the ALSA UCM2 files in /usr/share/alsa/ucm2 made the mic actually produce a signal. However, the level is too low to work properly in most apps. There is no "Mic Boost" control, even when using "alsamixer -D hw:N" to control it directly.

I filed a bug report in the Linux bug tracker since it seems to be a bug in the ALSA USB Audio driver. I was able to confirm that the Windows Realtek driver does expose a "Mic Boost" setting (+10, +20, and +30 db). I was able to run Windows in Qemu and "pass-through" the USB device. The key qemu option is as follows.

-usb -device usb-host,vendorid=0x0db0,productid=0x422d

Since I filed the bug report, I figured out a work-around. Pipewire allows you to set the "volume" property of the device node, at a level beyond what the GUI will allow. My shell script to do it follows.

#!/bin/sh

set -e

# This is the node.description for the mic
name='USB Audio Microphone'

# Default value is 1.0.
volume=15

find_id () {
    pw-dump -N| 
        jq --arg n "$name" 
            '..|objects|select(.["node.description"]==$n)|.["object.id"]'
}

# Lookup id of node for mic
id="$(find_id)"

# Set volume property
pw-cli set-param "$id" Props "{ volume: $volume }"

[comments]