Bug 49421

Summary: No sound on Dell XPS after suspend (ALC275)
Product: Drivers Reporter: Michael (auslands-kv)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: NEEDINFO ---    
Severity: normal CC: gugulea, klycman, leho, rcolonia, tiwai
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.2.0 up to 3.13 Subsystem:
Regression: No Bisected commit-id:
Attachments: alsa-info.sh before S3
alsa-info.sh after S3
alsa-info.sh after S4
Test patch
ALC282 after cold boot, (before suspend to ram)
alsa-info.sh: ALC282 after suspend to ram (speaker not working)
pacmd list-sinks output after a cold boot (speaker ok)
pacmd list-sinks output after suspend to ram (speaker stop working)

Description Michael 2012-10-24 12:51:16 UTC
Dell XPS One 2710, Ubuntu 12.04, Kernel 3.2.0.31 or 3.2.0.32 or 3.6.2

Sound works out of the box, until machine is suspended to RAM (STR). After suspend and resume, no sound at all.

Interestingly, a suspend to Disk (STD) and resume restores sound!

aplay -l:
Karte 0: PCH [HDA Intel PCH], Gerät 0: ALC275 Analog [ALC275 Analog]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 0: PCH [HDA Intel PCH], Gerät 3: HDMI 0 [HDMI 0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0

lsmod|grep snd:
snd_hda_codec_hdmi 32506 1
snd_hda_codec_realtek 79668 1
snd_hda_intel 34147 3
snd_hda_codec 135374 3 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel
snd_hwdep 13668 1 snd_hda_codec
snd_pcm 97661 3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd_timer 29989 1 snd_pcm
snd 79391 13 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
soundcore 15091 1 snd
snd_page_alloc 18572 2 snd_hda_intel,snd_pcm

It is not possible to unload snd modules:

# sudo /sbin/alsa force-unload
Unloading ALSA sound driver modules: snd-hda-codec-hdmi snd-hda-codec-realtek snd-hda-intel snd-hda-codec snd-hwdep snd-pcm snd-seq-midi snd-rawmidi snd-seq-midi-event snd-seq snd-timer snd-seq-device snd-page-alloc
(failed: modules still loaded: snd-hda-codec-hdmi snd-hda-codec-realtek snd-hda-intel snd-hda-codec snd-hwdep snd-pcm snd-timer snd-page-alloc).

All information in the net either is depreciated (using acpi_suspend) or refers to chips that have options (e.g. modprobe snd_hda_intel option=acer). It seems, there is no documentation about options of the ALC275 chip available.

Anybody has a solution to this?

Thanks

Michael
Comment 1 Michael 2013-01-17 07:59:13 UTC
Just a small update:

Tried kernel 3.7.1, 3.7.2 and 3.8.0-rc3, all with the same result.

It seems there is no chance to get sound working after suspend on ALC275 systems :-(
Comment 2 Michael 2013-08-16 12:12:19 UTC
Obviously there is nobody at all interested in this bug.

Anyway, just reporting that really nothing has changed in 3.10.7 :-(
Comment 3 Michael 2013-08-16 12:30:32 UTC
and not working in 3.11-rc5 either :-(


(who do I need to kill to get some attention to this bug? At least change the state to something else than "NEW". I reported it 10 months ago.)
Comment 4 Takashi Iwai 2013-08-16 13:01:10 UTC
Give alsa-info.sh outputs before and after suspend.  Run it with --no-upload option and attach the outputs here (don't paste).

Also what about S4 (hibernation)?  Doesn't it work, too?
Comment 5 Michael 2013-08-16 13:10:32 UTC
Created attachment 107214 [details]
alsa-info.sh before S3
Comment 6 Michael 2013-08-16 13:10:51 UTC
Created attachment 107215 [details]
alsa-info.sh after S3
Comment 7 Michael 2013-08-16 13:11:15 UTC
Created attachment 107216 [details]
alsa-info.sh after S4
Comment 8 Michael 2013-08-16 13:13:45 UTC
Hi, thanks for looking at this bug.

Here is some older background info and alsa-info output for older kernels:

https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1066488

S4 (hibernate) does not have this problem. Actually, it can be used to reenable sound after S3 has disabled sound output.

I have attached three alsa-info outputs for kernel 3.11-rc5:

before S3
after S3
after S4

Hope this helps to fix this awful bug.

Michael
Comment 9 Takashi Iwai 2013-08-16 13:28:27 UTC
Hrm, there is no difference in the codec registers at all between before and after S3.  Also the result after S4 is identical.
And, looking at alsa-info output, there is no specific quirk applied to this laptop.  That is, the driver works without special setup after the boot and S4.

So, something else stopped working the sound.  When you reload the sound driver after S3, does it make working again, or is it still silent output?
Also, are the all sound outputs muted, not only from the speaker but also from the headphone?
Comment 10 Michael 2013-08-16 13:53:41 UTC
Interesting idea about headsets. Never thought about it nor used one (its a desktop PC), but the result is really suprising: Headset still works after S3, only loudspeakers stop working.

For relaoding sound driver, please tell me howto. Unloading or reloading via /sbin/alsa always fails:

# sudo /sbin/alsa force-unload
Unloading ALSA sound driver modules: snd-hda-codec-hdmi snd-hda-codec-realtek snd-hda-intel snd-hda-codec snd-hwdep snd-pcm snd-seq-midi snd-rawmidi snd-seq-midi-event snd-seq snd-timer snd-seq-device snd-page-alloc
(failed: modules still loaded: snd-hda-codec-hdmi snd-hda-codec-realtek snd-hda-intel snd-hda-codec snd-hwdep snd-pcm snd-timer snd-page-alloc).
Comment 11 Takashi Iwai 2013-08-16 13:58:18 UTC
Logout once after S3, go to Linux console, kill X.  Maybe better to go to runlevel 3.

Then try to unload snd-hda-intel module manually.  If it still can't be unloaded, check the blocking process via "fuser -v /dev/snd/*", and kill appropriately.  Then load snd-hda-intel driver again, check the mixer status and test whether the speaker output works again.
Comment 12 Michael 2013-08-16 14:29:32 UTC
o.k. finally got it. (There does not seem to be an "init3" in ubuntu, so I stopped the lightdm service and later also pulseaudio, which seemed to be the blocker.)

So, this is the workflow I did in VT:

play /usr/share/sounds/ubuntu/stereo/system-ready.ogg (works)
alsamixer (wrote down the config I saw)
pm-suspend (and resume)
play /usr/share/sounds/ubuntu/stereo/system-ready.ogg (only on headset working)
service lightdm stop
service pulseaudio stop
alsa reload (first time "Failed)
alsa reload (this time works)
play /usr/share/sounds/ubuntu/stereo/system-ready.ogg (still only on headset working)
alsamixer (everything seems to be o.k.)

Any other idea? Is it possible that there is an extra amplifier for the loudspeakers that needs some initialization after suspend?
Comment 13 Michael 2013-08-20 07:41:51 UTC
Hello?

Anything else, I can do?
Comment 14 Takashi Iwai 2013-11-14 10:16:32 UTC
So, in short, reloading the module after S3 didn't help, right?  It's bad...

Just to be sure, could you test with 3.12?  There was a known issue of the unbalanced runtime PM refcount in the older kernels.

Also, as a blind shot, try the patch below.  There is a known quirk for another Dell machine, and this might be applicable to yours.
Comment 15 Takashi Iwai 2013-11-14 10:17:00 UTC
Created attachment 114641 [details]
Test patch
Comment 16 Michael 2013-11-14 10:32:56 UTC
Thanks, I will test it as soon as possible. Currently I'm in hospital, though. Hope to get back home in a week or so...
Comment 17 Michael 2013-11-19 11:19:52 UTC
Just a short feedback: 3.12 does not make any difference.

Gonna try the patch next. Need to inform myself how to most easily apply the patch.
Comment 18 Takashi Iwai 2013-11-29 07:32:26 UTC
Any news?
Comment 19 Michael 2014-04-23 06:00:59 UTC
I'm back again, as I upgraded to Ubuntu 14.04 with Kernel 3.13. No change, however. :-)

Guess I need to try to compile my own kernel then and test the patch.

Guess I need to do that anyway as the alx driver is borked on kernel 3.13. Ethernet connection breaks after a couple of seconds... :-( :-(
Comment 20 Michael 2014-04-23 08:15:43 UTC
Just tested mainline kernel 3.14.1. No sound either.

Is your patch already included, or do I need to compile the source and include the patch to test this?
Comment 21 Michael 2014-04-24 14:33:34 UTC
Well, I downloaded kernel source 3.14.1. It does not include this patch, so I applied the patch, compiled and installed the kernel.

Unfortunately, still no change. After a Suspend-to-RAM there is no sound from the desktop speakers. Only a Suspend-to-Disk or a Reboot reenables the sound from the speakers. (Headphones do work)
Comment 22 Takashi Iwai 2014-04-28 13:12:46 UTC
Then I have no idea for now.  It's BIOS who disables the speaker output in some non-standard way, and the kernel doesn't know how to re-enable it.
Comment 23 Ricardo Colonia 2014-09-09 18:32:14 UTC
If it helps with the troubleshooting, this problem also happens in windows 8.1 using UEFI. Let me know if you want any detail.
Comment 24 NeverMind 2015-09-28 20:48:32 UTC
Hi, I have the same issue on a Gigabyte P37, with a ALC282 :

- cold start: speaker OK (and headphones ok)
- suspend to ram
- resume :    speaker not ok (no sound), and heaphones still ok.
Comment 25 NeverMind 2015-09-28 20:50:38 UTC
Created attachment 188831 [details]
ALC282 after cold boot, (before suspend to ram)
Comment 26 NeverMind 2015-09-28 20:52:03 UTC
Created attachment 188841 [details]
alsa-info.sh: ALC282 after suspend to ram (speaker not working)
Comment 27 NeverMind 2015-09-28 21:12:49 UTC
After a cold boot (speaker ok), the command "pacmd list-sinks" returns the ALC282 Analog state:
	state: SUSPENDED
	suspend cause: IDLE 
but after a suspend to ram / resume (speaker not working), the AlC282 Analog state is:
	state: IDLE
	suspend cause: 

I also attached the two "pacmd list-sinks" outputs.
Comment 28 NeverMind 2015-09-28 21:14:47 UTC
Created attachment 188871 [details]
pacmd list-sinks  output after a cold boot (speaker ok)
Comment 29 NeverMind 2015-09-28 21:16:03 UTC
Created attachment 188881 [details]
pacmd list-sinks output after suspend to ram (speaker stop working)
Comment 30 georgeg 2015-10-29 11:37:35 UTC
For me the problem is solved, see this thread on alsa devel mailing list:
http://mailman.alsa-project.org/pipermail/alsa-devel/2015-October/099688.html
Comment 31 NeverMind 2015-11-14 22:31:37 UTC
Thanks georgeg for the answer.
In the mail, you're talking about the 4.4-rc1 kernel version, aren't you?
I'm using the 3.19.0-33-generic #38-Ubuntu SMP Fri Nov 6 18:18:12 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux. Is there also a way to patch the 3.19 branch?

By the way, my sound card is a ALC282 (not ALC275). Does the patch could be applied to?
Thanks.