13.1, have to plug-in and plug-out earphone to make speakers work

This is an old problem from which I’ve suffered for more than 1 year.

I’m still using 13.1 evergreen.

Before I upgraded from 12.3, there is no such problem. But after upgrade to 13.1, I found the speaker doesn’t work, if the earphone is not plugged in when starting the computer, unless plug-in the earphone and then plug it out(maybe for several times).

I still don’t find a method to this problem yet, nor the reason for this problem. I guess maybe it is because I plugged the earphone while upgrading from 12.3 to 13.1

If anyone has solved this problem, please teach me that.

Thank you, thank you.

The problem could be the alsa driver …

To investigate if it is a configuration problem (instead of the driver), can you provide more information ? To do so, with pc connected to internet, as a regular user open a terminal/xterm and send the following command in that terminal/xterm:


/usr/sbin/alsa-info.sh

do not update if asked to update. Select the SHARE/UPLOAD option. Let the script run to completion. When it completes, it will note in the terminal/xterm the address/url in which the script output has been uploaded to. Please copy that address/url here (just the address).

We will then look at that and see if there is anything obvious.

First, do provide the output requested by oldcpu as it will show your basic system details, as well as detailed audio settings. :wink:

I vaguely remember this issue, possibly on my old 12.3 based Tumbleweed and it probably was fixed by the time standard 13.1 arrived. I also run a 13.1 stable system but today it boots up with sound onto speakers, and after that, plugging 'phones in/out switches from/to speakers as one would expect. I won’t comment further until oldcpu has reviewed your output.

You posted in the right place here because 13.1 is not yet “Evergreen”. Support by openSUSE’s maintainers was extended, probably until year end at least. That means 11.4 Evergreen continues to have maintenance.

oldcpu, thanks for your reply.

Your command don’t have any output in terminal.It just goes blue and says it will collect the listing diagnostic information, bla bla bla. And if I select OK, it goes black without any output on screen. Is your command correct.

I cannot attach photos, sorry.

It works.

It turns out there is something wrong with the local network, and it has fixed.

The information is in the link below:
http://www.alsa-project.org/db/?f=e8bad2291586aeb420369ba964f4aa7d191c6cfd

I note your speaker is muted with 0% volume for playback. Was it your intent to run the script when the speaker is muted ? Note:


Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 0 **[0%]** -65.25dB] [on]
  Front Right: Playback 0 **[0%] **-65.25dB] [on] 

I recommend you unmute the speakers and then save that configuration.

Further, I note that both your HDMI device (card-1) and your analog/digital audio (card-0) use different instances of the same sound alsa module (snd_hda_intel) . You need to exercise caution there, for if you end up with a case with no sound (after an OS boot) it could be that the “card assignment” has been swapped. Your media devices by default will send audio to card-0, so if after a boot HDMI ends up as card-0, you will have no sound with analog/digital audio.
.

I had the earphone plugged.

And the link below is the information after OS restart without earphone:
http://www.alsa-project.org/db/?f=38b4ee8f9e4d0746e8a3418f39e49814396ecfdd

I can find card-0 is the Intel sound card in YaST.

If you look at the diagnostic script output you will see:



!!Loaded ALSA modules
!!-------------------

snd_hda_intel
snd_hda_intel

This indicates two separate instances of the “snd_hda_intel” alsa module loaded, likely associated with 2 separate sound devices (nominally card-0 and card-1).

If you then look at this script output:


!!Soundcards recognised by ALSA
!!-----------------------------

 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xf5230000 irq 27
 1 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xf3000000 irq 17

its clear there is a “PCH” and a “NVidia” separate sound device.

and then the following gives more information on these two devices.


!!PCI Soundcards installed in the system
!!--------------------------------------
00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
01:00.1 Audio device: NVIDIA Corporation GF108 High Definition Audio Controller (rev a1)

where the PCH (Intel Corp 7 series) is an Codec: Realtek ALC3202, and the NVidia GF108 is an Codec: Nvidia GPU 14 HDMI/DP. Where that makes it clear, card-1 is currently (when that script was run) an HDMI device.

Further, if you look at the ‘aplay’ output:


!!Aplay/Arecord output
!!--------------------

APLAY

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC3202 Analog [ALC3202 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

its pretty clear there that PCH is Card-0, an ALC3202; and that card-1 is an HDMI.

As long as that configuration stays, then if you are not using HDMI that is good. But if the sound instances were to be reversed after a boot, then that could cause sound problems.

Did you unmute the speaker for card-0 (ie your nominal analog sound device) like I suggested ?
.

Note:


!!-------Mixer controls for card 0 [PCH]
.....
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 0 **[0%]** -65.25dB] [on]
  Front Right: Playback 0 **[0%]** -65.25dB] [on]

0% playback … ie you should not hear anything with speakers.

Try this amixer command (I am guessing at the syntax):


amixer -c0 sset 'Speaker' on 80%

so since I am guessing please post here any error messages/feedback you may get from sending that.

With the earphone plugged in , the speakers are supposed to be muted Do you get the same with the headphones not plugged in ?

amixer -c0 sset 'Speaker' on 80%

Output:

Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 70 [80%] -12.75dB] [on]
  Front Right: Playback 70 [80%] -12.75dB] [on]

Yeah, muted.

And with headphones not plugged in, after sending that ‘amixer’ command ? Still muted ?

Have you also (in addition to sending that amixer command I provided) launched pavucontrol to confirm it has or has not a headphone/speaker mute selection ? I have such on my Toshiba laptop.

No, it is not.

Mmm… how could I confirm that?

ok - so the amixer command unmutes the speakers.

What happens when you reboot the PC, and try to play something? No sound in speakers ? If that is the case, do NOT use the headphone plug-in/plug-out method but instead send that amixer command. Does your sound work then ?

wrt pavucontrol, install pavucontrol if not installed, run it, and then when playing a multimedia application, check out the ‘output devices’ tab to see what selections you have, and if speaker and headphones are separate selections.

No sound after reboot. And the speaker works after sending that command.

The port of the Intel card is analog output, neither headphone nor speaker.

To quote from an alsa developer, if this happens after reboot, it’s likely the wrongly saved mixer state. There are a few layers saving/restoring the mixer state, alsactl invoked via udev, PulseAudio, and kmix.

A possible fix would be to clean up the config. Go to runlevel 3 once, login as root, kill all pending Pulse Audio processes (if any). Then adjust via “alsamixer -c0”, and run “alsactl store”. This resets the mixer restored via alsactl.

For Pulse Audio, remove ~/.pulse and ~/.config/pulse directories (if they exist).