Skip to content

Instantly share code, notes, and snippets.

@nsmlzl
Created October 19, 2024 18:16
Show Gist options
  • Select an option

  • Save nsmlzl/6a4fc9c17ad25d20aa11102c154bf6aa to your computer and use it in GitHub Desktop.

Select an option

Save nsmlzl/6a4fc9c17ad25d20aa11102c154bf6aa to your computer and use it in GitHub Desktop.
Fix Speaker Description of ThinkPad T14 AMD Gen 2 Under Ubuntu 24.04

Fix Speaker Description of ThinkPad T14 AMD Gen 2 Under Ubuntu 24.04

Under Ubuntu, the internal speaker (and microphone) of the ThinkPad T14 AMD Gen 2 has by default an unfortunate name in the GNOME interface, such as Speaker - Family 17h/19h HD Audio. While Family 17h/19h refers to an AMD CPU generation, it's not a user-friendly description.

This issue stems from the default description of the audio device. Fortunately, we can overwrite this description using a WirePlumber configuration script.

Solution

  1. Create a new WirePlumber configuration file:

    mkdir -p ~/.config/wireplumber/main.lua.d
    vim ~/.config/wireplumber/main.lua.d/51-alsa-rename.lua
  2. Add the following Lua script to the file:

    rule = {
        matches = {
            {
                { "device.name", "equals", "alsa_card.pci-0000_07_00.6" },
            },
        },
        apply_properties = {
            ["device.description"] = "Internal",
        },
    }
    table.insert(alsa_monitor.rules, rule)
  3. Save the file and exit the text editor.

  4. Restart WirePlumber to apply the changes:

    systemctl --user restart wireplumber.service

After applying these changes, the audio device should appear as "Internal" in your sound settings.

Notes

  • The device.name value (alsa_card.pci-0000_07_00.6) might differ on your system. To find the correct value, you can use the following command:

    wpctl status  # search for the device id
    wpctl inspect <device-id>
  • You can customize the device.description value to any name you prefer.

  • While WirePlumber seems to be shifting towards JSON-based configuration [see], for Ubuntu 24.04, only the Lua-based configuration worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment