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.
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.
Created attachment 212911 [details] alsa-info.sh output
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.
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".
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)
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.
*** Bug 116381 has been marked as a duplicate of this bug. ***
You need to ask your distro how to set up kdump. It's pretty specific to each distro.
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.
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)
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.