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

Banner image FastAPI with Tailwind CSS

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.

Linux terminal

Step 2: Run the ALSA Mixer

Type the following command and press Enter:

alsamixer

This command will open the ALSA sound mixer interface.

Alsa Mixer

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.

Alas Mixer panel

Soundcard selection

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.

Alas Mixer panel

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.

Test output

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 Consultant at Bentley Systems Inc.