Unplugging laptop charger disables sound (13.1)

Hello,

My openSUSE 13.1 64 bit KDE Current laptop developed a weird habit a few months ago: Whenever I unplug it, I lose audio output from internal speakers and headphones (plugging the charger back in doesn’t do anything). Clearly this must be some power saving feature gone wrong. The KMix meter goes away completely or its name changes to “Dummy output”. Veromix gets all confused as well.

Restarting pulseaudio doesn’t help. However, if I go to the Sound settings in Yast, there make some change to the driver settings, and then cancel the changes after Yast has restarted the sound system, this restores my sound most of the time. It is also notable that my bluetooth speakers usually keep working just fine if my audio output is directed to them via pulseaudio.

Some help fixing this would really be appreciated!

In the context of my statement that this may be a power saving “feature”, let me mention that around the same time that this became a problem, I had to make a few changes to my system to prevent it from overheating. It has hybrid graphics (intel/radeon) and until I installed kernel 3.14, both would run at all times at full power. I also installed laptop-mode and maybe a few other programs. I checked the effect of changing laptop-mode’s sound settings, which apparently aren’t to blame.
/usr/sbin/alsa-info.sh

Thanks in advance for any help you can offer.

You might want to share more info about your audio hardware

/usr/sbin/hwinfo --sound

I’m no sound guru, but I note that some audio hardware drivers provide power saving features which might be behind this issue eg the ‘snd-hda-intel’ driver provides

parm:           power_save:Automatic power-saving timeout (in second, 0 = disable). (xint)
parm:           power_save_controller:Reset controller in power save mode. (bool)

Some links which may (or may not) be relevant to you
https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture#Pops_when_starting_and_stopping_playback
http://mickcharlesbeaver.blogspot.co.nz/2012/04/snd-intel-hda-and-speaker-popping-noise.html

/usr/sbin/hwinfo --sound
13: PCI 1b.0: 0403 Audio device                                 
  [Created at pci.319]
  Unique ID: u1Nb.QgEwyVEnfB3
  SysFS ID: /devices/pci0000:00/0000:00:1b.0
  SysFS BusID: 0000:00:1b.0
  Hardware Class: sound
  Model: "Intel Audio device"
  Vendor: pci 0x8086 "Intel Corporation"
  Device: pci 0x1e20 
  SubVendor: pci 0x1028 "Dell"
  SubDevice: pci 0x0572 
  Revision: 0x04
  Driver: "snd_hda_intel"
  Driver Modules: "snd_hda_intel"
  Memory Range: 0xc1610000-0xc1613fff (rw,non-prefetchable)
  IRQ: 47 (1015 events)
  Module Alias: "pci:v00008086d00001E20sv00001028sd00000572bc04sc03i00"
  Driver Info #0:
    Driver Status: snd_hda_intel is active
    Driver Activation Cmd: "modprobe snd_hda_intel"
  Config Status: cfg=yes, avail=yes, need=no, active=unknown


I’d very much like to try the fix described in the second link, but the file doesn’t exist. The path is slightly different as well (/usr/lib/pm-utils/power.d/). Will it work to just create the file “intel-audio-powersave”? Same problem with the file /etc/modprobe.d/alsa-base.conf and /etc/modprobe.d/modprobe.conf .

Thanks a lot!

Uncharted territory for me, but the sound driver configuration is located in /etc/modprobe.d/50-sound.conf, so you could try adding the options there (maybe one at a time)

options snd_hda_intel power_save=0 power_save_controller=N

I don’t know about the other possible solution. Someone else may be able to advise further about that.

I tried and it didn’t help. Thanks though. Are there any other ideas?

That’s a shame. I don’t suppose there are any BIOS-releated parameters that may need tweaking? (Worth a look IMHO.)

Be patient, maybe others can advise…

That alsa-info has


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

indicating sound is muted in your mixer. Did you try unmuting that ?

Also further to that, alsa-info has:


snd-hda-intel: power_save_controller=1

ie your PC has a custom setting in the /etc/modprobe.d/50-sound.conf file. What happens if that option of “power_save_controller=1” is removed ?

Also further to that, alsa-info has:

snd-hda-intel: power_save_controller=1

ie your PC has a custom setting in the /etc/modprobe.d/50-sound.conf file. What happens if that option of “power_save_controller=1” is removed ?

That is interesting. I did tell the OP to consider trying ‘power_save_controller=N’ (to disable power saving), but perhaps they got mixed up?

Thanks for the suggestions!

snd-hda-intel: power_save_controller=1

predates my changes. A current output of the script is here.

I am not sure what you mean by my sound being muted. Is this some backend setting or the same kind of muting I could set with kmix or pulseaudio?

If the former, I did make sure that sound wasn’t just muted – it may have been on mute at the time that I executed the script. Alternatively, it may be a consequence of my problem.

If the latter, I may need some hints determining if this is the case. I do want to repeat that my sound is working just fine when my charger is plugged in. I just started alsamixer and none of the channels appeared to be muted.

Thanks for your help!

Might there be some sort of log that could help me understand what is going on in the moment of unplugging? I am only marginally familiar with these things, but could something in /var/log/ or even .xsession-errors record stuff like this? If yes, what would I have to look out for in the log file?

  1. Okay, clearly the options to prevent power saving do not seem be having an effect. Try removing all the power saving parameters in /etc/modprobe.d/50-sound.conf as oldcpu suggested
options snd slots=snd-hda-intel

Then restart the sound system with

systemctl restart alsasound.service

For that matter, does restarting alsasound.service (when on battery) cause your sound to be re-enabled? (Try running a sound test just after it is run.)

  1. Could you please tell us your laptop make and model. (Perhaps there is a hardware feature/quirk behind this that is not Linux-specifc?)

I obtained that from the script output you provided. Previous your mixer showed this:


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

With Speaker playback volume set to 0% that mutes the sound. I hope that clarifies that for you.

Now currently it shows this:


Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 74
  Mono: Playback 34 [46%] -40.00dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 74
  Mono:
  Front Left: Playback 0 [0%] -74.00dB] [off]
  Front Right: Playback 0 [0%] -74.00dB] [off]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 74
  Mono:
  Front Left: Playback 74 [100%] [0.00dB] [on]
  Front Right: Playback 74 [100%] [0.00dB] [on]

Do I need to highlight this in colour for you to see the settings ?

Now this is better, as the ‘speaker’ control is at 100%, where before it was at 0% . But your ‘Master’ volume playback at 46% is pretty low - it may be so low you can not hear anything. And your headphones are muted.

Thank you all for your helpful comments thus far. Please excuse my slow response. :slight_smile:

I tried clearing /etc/modprobe.d/50-sound.conf by backing up the file. The current file is now empty. This didn’t change anything, and restarting ALSA doesn’t restore the sound either.

One thing that still helps though is when I use Yast to reset the sound system. If we could find out what command Yast uses for this, that may take us one step further.

For about a week now I have had another sound problem that is just as troubling: If I want my internal speakers to work, I have to plug in headphones (which have sound) and unplug them. Only then do I get sound on my internal speakers.

This is driving me bonkers. :slight_smile:

Do you think that my kernel 3.14 may be the issue? Could a newer kernel fix this?

Thanks again.

@oldcpu: Thank you for your illustration. Since I’m able to have sound under certain conditions, I’m not sure that a too low master volume would be the problem. Still, it’s weird how these settings seem to change.

I need to see the output of the alsa-info.sh script file, immediately after the problem occurs, BEFORE you start adjusting any configuration settings. That last output CLEARLY indicated a problem with the mixer settings. But that may not be the only problem.

Maybe it will. We are fortunate that at least one, and maybe more, alsa sound driver developer(s) is/are a member of the SuSE-GmbH team that packages openSUSE. If you write a bug report on openSUSE describing your problem, they have a better chance of anyone in answering the question you asked. For certain, they WILL ask for the script output, that I asked for. There is guidance here wrt writing bug reports. http://en.opensuse.org/openSUSE:Submitting_bug_reports You can use your openSUSE user name and password when logging on to bugzilla.

Here you go!

Filing a bug definitely sounds like an option. I’ll just see how far we get here.

Thanks again.

That one reads like it has options in the /etc/modprobe.d/50-sound.conf file that completely breaks the sound, and those options should ALL be removed.

I type that because I note:


!!Modprobe options (Sound related)
!!--------------------------------

snd-hda-intel: power_save_controller=0 power_save_controller=N 

and I note:


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

APLAY

aplay: device_list:268: no soundcards found...

ARECORD

arecord: device_list:268: no soundcards found...

I recommend you remove the /etc/modprobe.d/50-sound.conf file, restart your PC and try again from scratch to sort the sound. I also suspect in any bug report, the SuSE-GmbH packagers who address the bug report will also ask you to clean up that file (where the easiest way is to remove it, as it will be created again from YaST).

That’s strange because that’s exactly what I did!

For a few days the file didn’t even exist, until Yast recreated it when I tried to reset the sound system. Now, it is possible that I made some changes to it through Yast inadvertently. Let me try it again just to be sure.

This is how 50-sound.conf looks right now:

options snd slots=snd-hda-intel# u1Nb.QgEwyVEnfB3:Intel Corporation
alias snd-card-0 snd-hda-intel

I 1. renamed the file, 2. restarted alsa, 3. let Yast configure the sound.

And this is the new 50-sound.conf Yast created:

options snd slots=snd-hda-intel# u1Nb.QgEwyVEnfB3:Intel Corporation
alias snd-card-0 snd-hda-intel

Am I the only one who is confused by this? :slight_smile:

And just to be sure: Here’s the output of /usr/sbin/alsa-info.sh after what I just tried.

Don’t just rename the file. Any file in that /etc/modprobe directory can be loaded, independant of the file name. If you want to keep the old version you need to MOVE the file to a different directory.

Thats an improvement, but the problem is still there !! I note:


!!Modprobe options (Sound related)
!!--------------------------------

snd-hda-intel: power_save_controller=0 power_save_controller=N

I think those options are coming from the backup/renamed file you have in place in the /etc/modprobe directory. You need to remove that backup file and put it elsewhere. That is highly likely to be causing some problems.

Now I also note your laptop’s mixer has the sound muted with playback at 0%.


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

Again … do NOT store backups in the /etc/modprobe directory.

That should read “do NOT store backups in the /etc/modprobe**.d** directory”

Not quite.
Only files that end in .conf are loaded. See “man modprobe.d”:

All files underneath the /etc/modprobe.d directory which end with the .conf extension specify those
options as required.

So it is actually ok to rename it to 50-sound.conf.old or similar.
YaST itself does this by the way, it keeps the old file as “50-sound.conf.YaST2save” (or correspondingly for other config files).

Of course the OP didn’t say to what he renamed the file, so it might still be the cause of the problem… :wink: