When I plug in my headphone, the speaker still sounds, how to solve this problem please, I can use alsamixer to adjust the total volume, but I just want the speaker stopped making sound after I plug in my headphone...Thanks for helping...:-)

Dani AI

Generated

Short summary and an actionable checklist that extends the replies here (thanks to and ): the speaker usually keeps playing because the mixer is routing both outputs or the jack-detect/auto-mute control is off. The reliable fixes are (A) toggle the ALSA auto-mute / speaker/headphone mixer controls so speakers are silenced when headphones are inserted, (B) if PulseAudio is present, select the headphone port in PulseAudio’s output controls, and (C) for broken jack-detection you may need a hardware pin override or a codec-specific driver option.

Quick steps (safe, in order):

  • Open the ALSA mixer and pick the right card:

    alsamixer

    Press F6 to choose the card, F5 to show all controls. Look for an “Auto-Mute Mode” control and set it to Enabled. If that control is missing, mute the “Speaker” channel and raise “Headphone” instead (use left/right arrows, up/down, and M to mute/unmute). Exit with Esc.

  • If your distro uses PulseAudio, use the PulseAudio volume control to pick the headphone port (this overrides per-application routing):

    pavucontrol

    In Output Devices/Playback choose the device and set “Port” to Headphones; mark it as fallback if needed.

  • Make the change persistent:

    sudo alsactl store

Advanced troubleshooting (only if the two steps above don’t help): test with another set of headphones and a different OS/live USB to rule out a mechanical jack fault. If jack detection still fails, try hdajackretask (from alsa-tools) to remap pins, or add a codec-specific option for snd-hda-intel in /etc/modprobe.d (these are codec-specific—backup configs first and search for your codec model before changing).

This expands on ’s “different channels” hint and on ’s PulseAudio note by showing exactly where to toggle auto-mute and how to persist settings.

Recommended Answers

All 3 Replies

Not sure if it's any help, but I had a similar problem with my old tablet pc.

Turned out that the main speakers and the headphones were on different channels. I eventually realised when I took a look at the user options/settings for the mixer and found (and enabled) a couple of extra sliders. So now I've muted the channel for the main speakers, turned the headphones to full and I use the master volume slider to control the overall volume.

So you might want to look into the possibility that your headphones and speakers are on different channels!

What distribution+version of linux are you running? Newer systems use Pulse Audio (as well as ALSA), which should allow you to change your output hardware from speakers to the headphone port.

I have found an answer, just ajust the alsamixer

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.