LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-17-2015, 12:35 PM   #1
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Rep: Reputation: 271Reputation: 271Reputation: 271
How do I tell if headphones (or speakers) are plugged into the headphone jack?


How do I tell whether a device is plugged into the headphone jack? acpid can: every time I plug a device into it /var/log/messages notes, 'logger: ACPI group jack / action headphone is not defined'
 
Old 07-19-2015, 08:22 AM   #2
LinBox2013
Member
 
Registered: Sep 2013
Location: Southern Kentucky
Distribution: Arch
Posts: 119

Rep: Reputation: 45
The mixer in my distribution shows this info.
 
Old 07-20-2015, 03:50 PM   #3
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by LinBox2013 View Post
The mixer in my distribution shows this info.
What mixer is that? amixer, alsamixer, rexima don't.
 
Old 07-20-2015, 03:54 PM   #4
LinBox2013
Member
 
Registered: Sep 2013
Location: Southern Kentucky
Distribution: Arch
Posts: 119

Rep: Reputation: 45
Quote:
Originally Posted by RandomTroll View Post
What mixer is that? amixer, alsamixer, rexima don't.
I am using pulse audio.

I know in the past it was buggy and had problems. It has not given me any issues for the last couple years.
 
Old 07-21-2015, 07:37 AM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I originally assumed you were asking "How do you detect this via Linux files" or via a program, and not just via Desktop widgets. But in poking around my system, I couldn't find that response easily. Turns out a bit of googling immediately helped, and peeps to this stack exchange question/answer.

If you were interested in via a program or a system file, check out /proc/acound/card0/codec#0. What I did was concatenated that to a file in my home directory with no headphones inserted and a different file in my home directory after plugging in headphones and then compared the two files.

Obviously ALSA knows you did this action, and if you need to go deeper about how things are understood, then you'd have to grab the ALSA sources and determine where these changes are detected. My assumption is that it comes from the BIOS.
 
2 members found this post helpful.
Old 07-21-2015, 12:56 PM   #6
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
Thanks. I had already checked this, but I looked too quickly: it takes a few seconds for this file to reveal a change in plugged-in-ness.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Speakers do not mute when headphones are plugged in sunnieside-up Linux - Hardware 2 08-16-2012 08:14 PM
Fedora 12 on laptop - speakers wont mute when headphones plugged in jan1024188 Linux - Software 2 04-07-2010 11:34 PM
Headphones plugged in from do not cut out speakers completely TuxLives Mandriva 3 05-18-2008 03:10 PM
no sound from speakers or headphone jack in ibm 600e donnyb General 4 03-27-2006 11:37 AM
Headphone plugged in, sound still comes out of speakers tbraun Linux - Hardware 3 01-18-2005 03:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:11 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