LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-20-2018, 03:20 PM   #1
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,373

Rep: Reputation: Disabled
making audio automatically cut out if headphones are pulled out


I'm honestly not sure whether this is properly an issue of my distro (MX 16) or my desktop environment (XFCE). At some point in an earlier version of my distro (again, I'm not sure the distro has anything to do with it), the audio was set to instantly cut out if my headphones were unplugged form the audio jack. This was useful for preventing me from inadvertently annoying people with noise in a library or other public place expecting quiet. My current installation of the distro won't do it anymore. I no longer remember what setting it was, and have been unable to find it again. I thought it was the "auto-mute," but I tried it and it doesn't appear to accomplish what I'm describing.

I just had the scenario described: I was in the college library listening to music on headphones while studying, and suddenly noticed my headphones weren't fully plugged in. Nobody actually came over and told me to turn it off (and thus I wonder if they actually heard anything), but I'm still pretty embarrassed. (This, after I was just grumbling to myself about how stupid the school is to have maintenance trimming the trees outside the library with noisy tools in the middle of the day.) At least I don't listen to very loud or disruptive music.

I did already ask in my distro forum (not on LQ), but no one had any suggestions, possibly because it's not the distro's fault.

Last edited by newbiesforever; 09-20-2018 at 03:32 PM.
 
Old 09-20-2018, 04:20 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by newbiesforever View Post
I did already ask in my distro forum (not on LQ), but no one had any suggestions, possibly because it's not the distro's fault.
yes it is. it's just a feature they care not to figure out how to do, if they had even thought of such a thing.
if you are using pulse audio and it can tell when you have headphone or speaker on, then you too can gain this information by whatever means they do, then exploit it to your benefit to mute your speakers whenever the right condition(s) occurs. or you can look into how to mute your speakers permanently and not your head phones.

so yeah there is a clue to look into.

http://terokarvinen.com/2015/volume-...and-line-tools
and
https://askubuntu.com/questions/4378...o-jack-enabled
for starters

Last edited by BW-userx; 09-20-2018 at 04:48 PM.
 
1 members found this post helpful.
Old 10-12-2018, 08:15 AM   #3
nikgnomic
LQ Newbie
 
Registered: Aug 2018
Distribution: Manjaro, AVLinux
Posts: 17

Rep: Reputation: Disabled
anything in alsamixer can also be managed with amixer commands

For example, to set speaker volume to zero on my laptop:
  • set auto-mute in alsamixer to disabled (stop any audio switch / level change for headphones and speakers)
Code:
amixer set --card 0 'Auto-Mute Mode' Disabled
  • then set level on speakers to 0
Code:
amixer set --card 0 'Speaker' 0
to save it as permanent setting:
Code:
sudo alsactl store
your system may need different audio card number and ALSA mixer element names (case-sensitive too)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Any s/w to cut/add audio files, convert video to audio? ravisingh1 Linux - Software 17 08-28-2013 03:28 PM
I want headphones to make speakers cut out newbiesforever General 3 12-26-2012 01:50 PM
Headphones plugged in from do not cut out speakers completely TuxLives Mandriva 3 05-18-2008 03:10 PM
no audio on Headphones d4harvey Linux - Laptop and Netbook 5 10-21-2005 10:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration