laptop confused: no sound with headphones in

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

laptop confused: no sound with headphones in

Atte André Jensen
Hi

I have a laptop running debian 10. Sometimes it gets confused with a mini-jack in headphones and mutes audio. It seems to be something automatic that goes wrong, since 1) pulling the mini-jack makes the sound come out of the speakers just fine (putting it back in mutes audio again etc)and 2) a reboot fixes it.

I tried writing a script that un-mutes everything I can see and turns it up, but to no avail:

amixer set 'Master' 100% unmute
amixer sset -c 0 'Master' 100% unmute
amixer sset -c 0 'Headphone' 100% unmute
amixer set -c 0 'Speaker' 100% unmute
amixer set -c 0 'PCM' 100%

I'd like to know what's causing this and most importantly: any solution or work-around would be great!

I know it's a long shot, but maybe someone can recognize this and point me in a more constructive direction?

Cheers
--
Atte
http://latestyoutube.a773.dk | http://a773.dk
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: laptop confused: no sound with headphones in

Len Ovens
On Mon, 9 Dec 2019, Atte wrote:

> I tried writing a script that un-mutes everything I can see and turns it
> up, but to no avail:
>
> amixer set 'Master' 100% unmute
> amixer sset -c 0 'Master' 100% unmute
> amixer sset -c 0 'Headphone' 100% unmute
> amixer set -c 0 'Speaker' 100% unmute
> amixer set -c 0 'PCM' 100%
>
If only it was so simple. In days of old when apple computers didn't have
a mouse or often any disc drive, Headphone jacks had extra contacts for
switching speakers off. Not any more. HDA audio has this pin enabling that
allows a mic jack to be mono with 5v power or a stereo output which is
auto detectable or switchable by some applet. (In debian it is probably
hdajackretask) However, I am sure you are looking for a more automated
method. For this there is a tool called hda-verb (say what?). which can
"enable/disable the headphone jack using pins."

An example that works on someone's laptop (doesn't work on my desktop for
sure cause my pin numbers are different):

To enable headphone jack, use:

hda-verb /dev/snd/hwC0D0 0x0f SET_PIN_WIDGET_CONTROL 0x40

To disable headphone jack, use:

hda-verb /dev/snd/hwC0D0 0x0f SET_PIN_WIDGET_CONTROL 0

I am sure that both the file in /dev/snd/ and the value right after that
(0x0f) need to match your system. On my system another (PCI) card picks up
hw:0 and so mine would be hwC1D*

In my file on this stuff I don't seem to have added the file one would use
to look up what these values might be. (not proc/asound it appears) But I
did find it by googling so the stuff is out there.

BTW the acpi system probably detects headphone plug events. Use
acpi_listen to see if this is true on your system. If so you can add a
script to /etc/acpi/events/ (actually a pointer to a script I think) that
will run on a headphone plug event. Some systems leave the headphone jack
always enabled and only need levels changed, but yours seems to need pin
changes too.

If you are using pulseaudio along with jack, I have found it best to
remove both alsa and udev modules from pulse and direct everything through
a pulse-jack bridge. Pulse will give up the audio device to jack just
fine, but will remember the device is there and control levels, mutes and
maybe pins even though jack has the device. Removing the alsa module will
stop this and removing the udev module will stop it from reloading the
alsa module on an alsa reset.

I haven't figured it out yet either. I hope you at least get started in
the right direction.


--
Len Ovens
www.ovenwerks.net
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: laptop confused: no sound with headphones in

Atte André Jensen
In reply to this post by Atte André Jensen
On Mon, 9 Dec 2019 15:34:02 -1000
Joel Roth <[hidden email]> wrote:

> Hi,
>
> Do you have pulseaudio installed? If so removing it might help.

Yeah, I have pulse audio installed, might simply remove it and see how that goes. Thanks!

Cheers
--
Atte
http://latestyoutube.a773.dk | http://a773.dk
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: laptop confused: no sound with headphones in

Atte André Jensen
In reply to this post by Len Ovens
On Tue, 10 Dec 2019 09:20:56 -0800 (PST)
Len Ovens <[hidden email]> wrote:
> I haven't figured it out yet either. I hope you at least get started in
> the right direction.

Thanks! Lots of good things to work with! As this only happens once every few weeks out of the blue, it's very hard to fix, but let's see how it goes without pulseaudio first :-)

Cheers
--
Atte
http://latestyoutube.a773.dk | http://a773.dk
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user