5

I have a sound problem (running Ubuntu 18.04 on an Acer Swift 1). After booting, the sound works perfectly fine at first (both via speakers and headphones). But if I suspend and then come back later, the sound is automatically set to headphones (although they are not plugged in) and in the settings there is no other option available. However, if I actually plug in my headphones, there is no sound either. Sometimes it helps to shut the display and reopen it while the sound is "playing" but that doesn‘t always work. I already sent it in to Acer but they said it‘s not their problem because I‘m using Ubuntu... Any ideas about what‘s the problem and how to fix it?

(And sorry, if the explanation is a bit long-winded, I‘m not that used to English IT-lingo. Hope the problem‘s still clear though. Otherwise just ask ;-)).

edit #1:

  1. Pulse Audio shows both speakers and headphones as output devices, but it also says that I have headphones plugged in (which I have not) and that the speakers are unavailable...

  2. I tried this suggestion (https://askubuntu.com/a/78179/307184), but as soon as I select the simultaneous output option, there is no sound (neither via speakers nor headphones).

edit #2:

Apparently somebody else experienced the same problem (No sound after suspend). So upon suggestion here's my system setup information:

sudo lspci -v gives:

00:0e.0 Audio device: Intel Corporation Device 3198 (rev 03) (prog-if 80)
    Subsystem: Acer Incorporated [ALI] Device 126a
    Flags: bus master, fast devsel, latency 0, IRQ 134
    Memory at a1114000 (64-bit, non-prefetchable) [size=16K]
    Memory at a1000000 (64-bit, non-prefetchable) [size=1M]
    Capabilities: [50] Power Management version 3
    Capabilities: [80] Vendor Specific Information: Len=14 <?>
    Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
    Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
    Kernel driver in use: snd_hda_intel
    Kernel modules: snd_hda_intel, snd_soc_skl

after waking up from suspend it says (there‘s only one number different in the third line, don‘t know what that means):

00:0e.0 Audio device: Intel Corporation Device 3198 (rev 03) (prog-if 80)
    Subsystem: Acer Incorporated [ALI] Device 126a
    Flags: bus master, fast devsel, latency 0, IRQ 25
    Memory at a1114000 (64-bit, non-prefetchable) [size=16K]
    Memory at a1000000 (64-bit, non-prefetchable) [size=1M]
    Capabilities: [50] Power Management version 3
    Capabilities: [80] Vendor Specific Information: Len=14 <?>
    Capabilities: [60] MSI: Enable- Count=1/1 Maskable- 64bit+
    Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
    Kernel driver in use: snd_hda_intel
    Kernel modules: snd_hda_intel, snd_soc_skl

aplay -l gives (same after booting and waking up from suspend):

**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: PCH [HDA Intel PCH], Gerät 0: ALC256 Analog [ALC256 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
Karte 0: PCH [HDA Intel PCH], Gerät 7: HDMI 1 [HDMI 1]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 0: PCH [HDA Intel PCH], Gerät 8: HDMI 2 [HDMI 2]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 0: PCH [HDA Intel PCH], Gerät 9: HDMI 3 [HDMI 3]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 0: PCH [HDA Intel PCH], Gerät 10: HDMI 4 [HDMI 4]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0

pactl list short sinks gives (also same after booting and waking up from suspend):

0   alsa_output.pci-0000_00_0e.0.analog-stereo  module-alsa-card.c  s16le 2ch 44100Hz   SUSPENDED
1   combined    module-combine-sink.c   s16le 2ch 44100Hz   SUSPENDED
Anne
  • 51
  • Have you tried using pavucontrol (pulse audio volume control) Output Devices (I'm not running Ubuntu 18.04 so I can't confirm this is what you meant by settings) and changing Output.Devices? If that was what you tried or doesn't help, next I'd go to the last Configuration tab & see if playing with Profile (using another profile, or turning it there, then back on) helps. – guiverc Jul 16 '19 at 08:17
  • as a temporary experiment, try this : https://askubuntu.com/a/78179/307184 the goal of that is to have sound at all devices on the same time but if this change actually cancels out the suspend bug you're experiencing, it will tell us something about the problem. – tatsu Jul 16 '19 at 08:27
  • @guiverc: It shows both speakers and headphones as output devices, but it also says that I have headphones plugged in (which I have not) and that the speakers are unavailable... – Anne Jul 17 '19 at 07:13
  • @tatsu: I can add the simultaneous output option, but as soon as I select it, there is no sound (neither via speakers nor headphones). – Anne Jul 17 '19 at 07:50
  • after ticking that option in paprefs, you have to go back into ubuntu sound settings then select the entry that has all your outputs in one (it will be a much longer line) and then reboot your computer. – tatsu Jul 17 '19 at 08:29
  • Yeah, I did that, but it doesn't work :/ – Anne Jul 17 '19 at 08:41
  • I had solved the similar problem here: https://askubuntu.com/questions/1234807/no-sound-after-sleep-ubuntu-20-04 – GHopper Dec 09 '20 at 05:58

2 Answers2

2

Edit: July 18, 2019

Question has been revised with new information:

after waking up from suspend it says (there‘s only one number different in the third line, don‘t know what that means):

The third line has changed from IRQ 134 to IRQ 25.

IRQ stands for Interrupt Request. It's basically a telephone number where the device calls the CPU (Central Processing Unit) to have work done. Because the telephone number has changed between suspend and resume the sound card can't call the CPU to get work done.


Here's a script I used a few years ago /lib/systemd/system-sleep/sound:

#!/bin/sh

NAME: sound

PATH: /lib/systemd/system-sleep

CALL: Called from SystemD automatically

DESC: PulseAudo 8 sets sound to laptop when going to sleep.

This script sets sound back to TV.

DATE: Sep 23 2016. Modified: Oct 28, 2018.

NOTE: Test psmouse for askubuntu.com "Touchpad not working after suspending laptop"

Aug 5, 2018 - Turn off executition bit. As per AU turn off automatic switching:

https://askubuntu.com/questions/1061414/how-to-disable-pulseaudio-automatic-device-switch/1061578#1061578

Turn execution bit back on as there is no sound at all.

case $1/$2 in pre/) echo "$0: Going to $2..." # Place your pre suspend commands here, or exit 0 if no pre suspend action required # modprobe -r psmouse sleep 1 ;; post/) echo "$0: Waking up from $2..." # Place your post suspend (resume) commands here, or exit 0 if no post suspend action required sleep 2 # modprobe psmouse export PULSE_RUNTIME_PATH="/run/user/1000/pulse/" sudo -u UserName -E pacmd set-card-profile 0 output:hdmi-stereo ;; esac

Note my new system doesn't need to use this script anymore. Not sure if it will work in your case but it might.

  • It doesn't seem to work for me (not 100% sure though if I did it right...) – Anne Jul 17 '19 at 08:42
  • @Anne After resuming laptop type journalctl | grep sound to ensure it ran and to see if errors were generated from typos. – WinEunuuchs2Unix Jul 17 '19 at 10:24
  • @Anne Someone with same problem. Can you edit your question to include system setup information like they did? https://askubuntu.com/questions/1136309/no-sound-after-suspend – WinEunuuchs2Unix Jul 17 '19 at 10:33
  • Thanks for finding out! I included the information in my post now. – Anne Jul 18 '19 at 07:15
  • @Anne - maybe this simpler solution of me works this out ? – dschinn1001 Jul 19 '19 at 01:36
  • Thanks for the explanation! So the problem is clear now... Does the script you posted still meet this problem? – Anne Jul 25 '19 at 10:39
  • @Anne I think you can manually test without the script. After resume type: export PULSE_RUNTIME_PATH="/run/user/1000/pulse/" and then type sudo -u anne -E pacmd set-card-profile 0 output:hdmi-stereo where anne is your user name and hdmi-stereo is replaced with your output device name. – WinEunuuchs2Unix Jul 25 '19 at 15:23
0

This question is duplicate on many questions with similiar like "no sound on my machine - what to do ?".

There was often simple solution working out like installing these two packages :

sudo apt install amarok rhythmbox

or

sudo apt install --reinstall amarok rhythmbox

Then additionally drivers are added for soundcard.

Perhaps you should reboot your machine then in the end :

sudo reboot

dschinn1001
  • 3,829