LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Alsa Headphone jack (https://www.linuxquestions.org/questions/linux-software-2/alsa-headphone-jack-4175544333/)

Lsatenstein 06-03-2015 12:45 AM

Alsa Headphone jack
 
What patch or other do I need to always keep the alsa headphone jack active. If I switch user and return, the headphone jack signal is muted.

I need it on full time. Currently I enable it with
A mixer -c0 set Headphone unmute 100%

fatmac 06-04-2015 08:59 AM

See if you have alsamixer installed, set & save settings, hopefully will work for you.

Lsatenstein 06-04-2015 04:30 PM

Quote:

Originally Posted by fatmac (Post 5372044)
See if you have alsamixer installed, set & save settings, hopefully will work for you.

If it worked for me (switch user, and return to myself), I would not post a question.

If you know how to have amixer Headphone jack permenantly unmuted and on, it would be helping me out.

genss 06-04-2015 06:35 PM

Quote:

Originally Posted by Lsatenstein (Post 5371337)
What patch or other do I need to always keep the alsa headphone jack active. If I switch user and return, the headphone jack signal is muted.

I need it on full time. Currently I enable it with
amixer -c0 set Headphone unmute 100

just put it somewhere where it will be run at boot

Shadow_7 06-04-2015 07:05 PM

# alsactl store

Which saves the mixer settings, and should be restored by default at boot. It depends on the distro ofc. Implies root to save it for all users. Although priorities vary depending on setups. BITD debian would check for alsa's settings, then use aumix-ers settings if they didn't exist. Pulseaudio (pavucontrol) might be the route these days. For some chipsets the headphone setting is ONLY available with alsamixer, so that's a good starting point.

jbuckley2004 06-04-2015 10:06 PM

Alsamixer wouldn't save my settings (both the headphone and mic were muted) for the first three days after I installed F22. Maybe it was an update, but now the settings are saved on exit. You may just want to try it again to see if anything's changed.

fatmac 06-05-2015 01:08 PM

Quote:

Originally Posted by Lsatenstein (Post 5372279)
If it worked for me (switch user, and return to myself), I would not post a question.

If you know how to have amixer Headphone jack permenantly unmuted and on, it would be helping me out.

Quote:

Currently I enable it with amixer -c0 set Headphone unmute 100
Then why not put that in your start up config, depending on your distro as to where & which file.

Lsatenstein 06-10-2015 08:45 AM

Here is the situation

Within /etc/profile.d/leslie.settings I have set

amixer -c0 set Headphone unmute 100 >/dev/null 2>&1

along with some other settings for other applications.

When I log into the system, amixer is correctly setup. (its the global profile setup for all users)

When I invoke Gnome's "switch user", amixer is muted, as it should be.

When I return from "switch user" amixer is not re-established.

So, the question I have is, On a return from "switch user", what are the names of the scripts that are activated?
For example, the profile scripts (.bash_rc /etc/bashrc and contents of /etc/profile.d are not called). What is the name of the script that decides that logic operation? I want to add a line to that script to re-initialize amixer.

I wonder if this question should be cross posted?

Shadow_7 06-10-2015 05:24 PM

Quote:

Originally Posted by Lsatenstein (Post 5375080)
Within /etc/profile.d/leslie.settings I have set

amixer -c0 set Headphone unmute 100 >/dev/null 2>&1

With that setup you probably have to logout and login to have those settings take effect and otherwise get re-applied. When you switch to a user who's already logged on, that's probably not happening. Or something like that.

I tend to have scripts that I run as the user that I am. Which is mostly manual for me, but it can be automated in .bashrc and other places. My tendancy towards scripts is that when I move on to another install I can just copy all my scripts, instead of trying to remember what configurations I changed from defaults times however many customizations I did. And I can tarball them and netcat them across computers on the local network without doing much in terms of "extras".

Lsatenstein 06-14-2015 12:07 AM

So...

Can you or anyone
tell me the name of a script that is called when I first log into the system, and the name of the script when I return from a switch user, or when I enter virtual terminal mode, and then return to Gnome

Drakeo 06-14-2015 09:44 AM

as per "Shadow_7" said there is only 2 reasons that can cause a muted anything is when alsa starts up it reads the aslactl store setting and sets them there. so set that. after that it is up to you to learn your tools and how to auto-start programs per operating systems.

As for the second reason you may have a setup in your .asoundrc that can cause that. good luck.

genss 06-28-2015 06:35 AM

Quote:

Originally Posted by Lsatenstein (Post 5376887)
So...

Can you or anyone
tell me the name of a script that is called when I first log into the system, and the name of the script when I return from a switch user, or when I enter virtual terminal mode, and then return to Gnome

its a GDM thing
i guess you use GDM
ask them and if there isn't, file a bug report

Lsatenstein 07-06-2015 08:19 PM

I have learned to have the amixer restarted via my .bash_profile, and via /etc/profile.d/leslie.sh

And when I return from a switch user, I just open a terminal and close it again to restore amixer.

I did notice the following.

The .bash_profile script must finish before amixer is setup because of timings. Therefore.. I have a amixer.sh script that I call from the .bash_profile.
The amixer.sh script is a task, amixer.sh & and within amixer.sh is a 1 second sleep command followed by the amixer -c0 ......

My hardware does not have jack/in /jack out detection for the front headphone jack. (pc is circa 2010). Newer PCs do have it, and that would solve my problem.

I can't see myself buying a new PC, so I will live with what I have for now.


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