How to enable the line out in Linux when headphones are connected.

Banner showing Linux terminal and audio settings interface

Introduction

When I setup a new linux machine, I always have the same problem, the line out is disabled when I connect my headphones and cannot use my speakers without disconnecting the headphones. By default, Linux may mute the line-out (speakers) when it detects headphones. Luckily, there’s a simple way to fix this issue in Ubuntu and Ubuntu based distros, so that you can seamlessly switch between your speakers and headphones without disconnecting them. In this post I’ll share with you how to enable the line out in Linux when your headphones are connected.

Steps to Fix the Issue

Follow these simple steps to fix this problem:

Step 1: Open a Terminal

Open a new terminal window.

Ubuntu terminal window with command prompt ready

Step 2: Run the ALSA Mixer

Type the following command and press Enter:

alsamixer

This command will open the ALSA sound mixer interface.

Terminal showing alsamixer command being executed

Step 3: Select the Correct Sound Card (if necessary)

If you don’t see the expected panel or options, press F6 to select the correct sound card. Choose the appropriate one from the list.

ALSA Mixer interface showing audio control sliders

Sound card selection menu in ALSA Mixer

Step 4: Disable Auto-Mute Mode

Use the right arrow key to navigate to the Auto-Mute Mode option.

Use the up/down arrow keys to disable it.

ALSA Mixer showing Auto-Mute Mode disabled

Step 5: Save Your Settings

Run the following command to save the changes:

sudo alsactl store

Enter your password when prompted and press Enter.

Step 6: Test Your Audio

Now, try switching between your headphones and speakers without unplugging anything. Your speakers should work even with the headphones plugged in.

Ubuntu sound settings showing output device selection

Conclusion

That’s it! Now you should be able to switch between speakers and headphones without the hassle of unplugging and re-plugging your devices. I hope this tutorial helps you!

About the author:

Victor Sejas Photo

Victor Sejas

Structural Civil Engineer | Senior Software Engineer Contractor at Bentley Systems Inc.