Bug 116401 - ALC255 with power_save creates electricity failure when headphones are plugged in
Summary: ALC255 with power_save creates electricity failure when headphones are plugge...
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: Intel Linux
: P1 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
: 116381 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-04-15 13:35 UTC by bjoern
Modified: 2017-05-07 19:08 UTC (History)
1 user (show)

See Also:
Kernel Version: 4.6-rc3
Subsystem:
Regression: No
Bisected commit-id:


Attachments
alsa-info.sh output (32.30 KB, application/octet-stream)
2016-04-15 14:16 UTC, bjoern
Details

Description bjoern 2016-04-15 13:35:01 UTC
I have an Acer V5-591G-50BA laptop, with a Realtek ALC255 sound-card, and when I plug in headphones and the sound-card is in power-save mode the whole system crashes and looses power.
If disable all power management for the soundcard or play audio then everything works fine.
Though I observed that sometimes right after boot, when no audio was played before and headphones are plugged in, the crash also happens. So there might be an initialization issue here.

The bug is easily triggered:
1) plug in in headphones
2) issue "echo 5 > /sys/module/snd_hda_intel/parameters/power_save"
3) wait 5 seconds

Now the whole system crashes, it is like cutting power.

There are some configurations where power_save_controller seems to trigger this too, but I am not sure yet when exactly this happens, might be when I'm on battery.


The expected result would of course be that the sound-card successfully enters power-save mode.

I already tried different model parameters do solve this, but the only results were that sometimes the machine crashed directly after enabling power_save and not 5 seconds later.
I tried: laptop-amic, laptop-dmic, alc269-dmic, alc271-dmic, inv-dmic, headset-mic, headset-mode, headset-mode-no-hp-mic.

On Windows this problem doesn't exist. So the hardware is probably not broken.
I don't know what Windows does though, maybe they just disable power-saving for the sound-card.
Comment 1 Takashi Iwai 2016-04-15 13:43:49 UTC
First of all, could you give alsa-info.sh output?  Run the script with --no-upload option, and attach (don't paste) to Bugzilla.

Then we need to catch the kernel crash by some way.  At best, set up kdump and see whether you get the crash message.  Or, it might be caught via netconsole or such.  Without the log, it's impossible to debug further, unfortunately.
Comment 2 bjoern 2016-04-15 14:16:38 UTC
Created attachment 212911 [details]
alsa-info.sh output
Comment 3 bjoern 2016-04-15 14:21:32 UTC
I thought I had already attached the alsa-info.sh output. But oh well.

The normal logs show no relevant message at all.

I'll try to setup kdump.
Comment 4 Takashi Iwai 2016-04-15 14:35:34 UTC
BTW, if you try kdump, don't forget to test whether kdump really works beforehand, e.g. try to trigger kdump manually via "echo c > /proc/sysrq-trigger".
Comment 5 Takashi Iwai 2016-04-15 14:43:51 UTC
One likely culprit for the crash like your case is rather in the graphics side.  Now the power saving in audio is tightly coupled with the graphics due to HDMI/DP.  So, it might be worth to turn off the power saving in the graphics side while trying the audio power saving.
For example, pass the boot option i915.disable_power_save=1 
(and/or i915.enable_rc6=0 i915.enable_dc=0)
Comment 6 bjoern 2016-04-16 09:43:43 UTC
I tried to disable the i915 powersave options you told me to, but without success.

Sadly I also didn't get kdump to work. When I run:
$ kexec -p /boot/vmlinuz-4.6.0-rc3-ragas --append="root=/dev/sda2 single irqpoll maxcpus=1 reset_devices"
I get:
 Cannot determine kernel physical load addr
 Cannot load /boot/vmlinuz-4.6.0-rc3-ragas

I have enabled the necessary kernel options and am currently not sure how to solve this.
Comment 7 Takashi Iwai 2016-04-20 15:29:05 UTC
*** Bug 116381 has been marked as a duplicate of this bug. ***
Comment 8 Takashi Iwai 2016-04-20 15:30:03 UTC
You need to ask your distro how to set up kdump.  It's pretty specific to each distro.
Comment 9 bjoern 2017-01-16 23:57:46 UTC
So, I finally got around to testing this more. The basic problem persists even on kernel 4.9.

I got kdump to work but since the laptop experiences an immediate power reset, when I try to trigger the bug, there is no way to see any messages.
So I have a working setup with Netconsole, I tried to make the kernel as chatty as possible, but still nothing. (enabled all ACPI and ALSA debugging options I could find) I don't know if the kernel even has the opportunity to react in any way.
Maybe there is some other option to log what is happening?

I also recently noticed that this only happens when I plug in some kind of headphones. If I connect a TV through the audio jack, everything works fine. (I couldn't test many other devices)

Though before the problem appeared to be all over the place with different power save settings, currently the bug seems to be only triggered by the power_save option. If just power_save_controller is enabled, everything seems to work.
Comment 10 bjoern 2017-01-17 00:11:39 UTC
I have to correct myself. It still happens all over the place, I just sometime seem to hit as state where the problem doesn't happen for a while for some reason. (until the next reboot or until the next power cable unplug)
Comment 11 bjoern 2017-05-07 19:08:05 UTC
I made it work for me now on kernel 4.11. There were actually two related problems.
First is the already mentioned issue when 'power_save' is enabled and second the headphone-jack is actually a headset-jack, that Linux configures as a headphone-jack.

I solved the second problem by setting 'options snd-hda-intel model=dell-headset-multi'

Both problems separately cause electricity failure in the Acer V5-591G-50BA laptop.

Because it actually causes electricity failure, I am unable to provide any good crash-dumps.

But I'm pretty sure that these are quirks in the hardware and they should be added to the kernel as such.


Additionally 'power_save_controller' works without problems.
But when triggering one of the before mentioned problems while music is playing, the machine would not crash directly, but only at some later point when headphones were plugged in and no music was playing. (Which suggests that some register gets messed up while doing this.)
This lead to the confusion that I had above. 

So, works for me.

Note You need to log in before you can comment on or make changes to this bug.