I have been able to reproduce the following bug in both Ubuntu 17.04 and Manjaro 17.0.2 on a 2017 Dell Inspiron 15 5567. It uses RealTek audio codec ALC3246. If you plug in headphones, then put the laptop into sleep mode by shutting the lid, then open the lid again, audio hardware will cease to be detected and be replaced with "Dummy Output". Booting into another operating system, or booting onto a live USB will not fix this problem. However, if I take apart the back and unplug the CMOS battery to reset the NVRAM, audio will be immediately restored on reboot. I have been able to reproduce this and recover from it 100% of the time in both Manjaro and Ubuntu, running XFCE with the most up to date version of Pulse Audio.
Sounds like a bug at a lower level than pulseaudio, but before reporting this to the alsa developers, can you try if you can reproduce the problem without pulseaudio? If you don't know how to do that, attach the output of "pactl list" and "cat /proc/asound/cards" when things are working, I'll give more instructions after that.
/proc/asound/cards: 0 [PCH ]: HDA-Intel - HDA Intel PCH HDA Intel PCH at 0xd1228000 irq 280 pactl list: Module #0 Name: module-device-restore Argument: Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "Automatically restore the volume/mute state of devices" module.version = "10.0" Module #1 Name: module-stream-restore Argument: Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "Automatically restore the volume/mute/device state of streams" module.version = "10.0" Module #2 Name: module-card-restore Argument: Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "Automatically restore profile of cards" module.version = "10.0" Module #3 Name: module-augment-properties Argument: Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "Augment the property sets of streams with additional static information" module.version = "10.0" Module #4 Name: module-switch-on-port-available Argument: Usage counter: n/a Properties: Module #5 Name: module-udev-detect Argument: Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "Detect available audio hardware and load matching drivers" module.version = "10.0" Module #6 Name: module-alsa-card Argument: device_id="0" name="pci-0000_00_1f.3" card_name="alsa_card.pci-0000_00_1f.3" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1" Usage counter: 0 Properties: module.author = "Lennart Poettering" module.description = "ALSA Card" module.version = "10.0" Module #7 Name: module-bluetooth-policy Argument: Usage counter: n/a Properties: module.author = "Frédéric Dalleau, Pali Rohár" module.description = "Policy module to make using bluetooth devices out-of-the-box easier" module.version = "10.0" Module #8 Name: module-bluetooth-discover Argument: Usage counter: n/a Properties: module.author = "João Paulo Rechi Vita" module.description = "Detect available Bluetooth daemon and load the corresponding discovery module" module.version = "10.0" Module #9 Name: module-bluez5-discover Argument: Usage counter: n/a Properties: module.author = "João Paulo Rechi Vita" module.description = "Detect available BlueZ 5 Bluetooth audio devices and load BlueZ 5 Bluetooth audio drivers" module.version = "10.0" Module #10 Name: module-esound-protocol-unix Argument: Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "ESOUND protocol (UNIX sockets)" module.version = "10.0" Module #11 Name: module-native-protocol-unix Argument: Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "Native protocol (UNIX sockets)" module.version = "10.0" Module #12 Name: module-default-device-restore Argument: Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "Automatically restore the default sink and source" module.version = "10.0" Module #13 Name: module-rescue-streams Argument: Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "When a sink/source is removed, try to move its streams to the default sink/source" module.version = "10.0" Module #14 Name: module-always-sink Argument: Usage counter: n/a Properties: module.author = "Colin Guthrie" module.description = "Always keeps at least one sink loaded even if it's a null one" module.version = "10.0" Module #15 Name: module-intended-roles Argument: Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "Automatically set device of streams based on intended roles of devices" module.version = "10.0" Module #16 Name: module-suspend-on-idle Argument: Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "When a sink/source is idle for too long, suspend it" module.version = "10.0" Module #17 Name: module-console-kit Argument: Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "Create a client for each ConsoleKit session of this user" module.version = "10.0" Module #18 Name: module-systemd-login Argument: Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "Create a client for each login session of this user" module.version = "10.0" Module #19 Name: module-position-event-sounds Argument: Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "Position event sounds between L and R depending on the position on screen of the widget triggering them." module.version = "10.0" Module #20 Name: module-role-cork Argument: Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "Mute & cork streams with certain roles while others exist" module.version = "10.0" Module #21 Name: module-filter-heuristics Argument: Usage counter: n/a Properties: module.author = "Colin Guthrie" module.description = "Detect when various filters are desirable" module.version = "10.0" Module #22 Name: module-filter-apply Argument: Usage counter: n/a Properties: module.author = "Colin Guthrie" module.description = "Load filter sinks automatically when needed" module.version = "10.0" Module #23 Name: module-x11-publish Argument: display=:0.0 Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "X11 credential publisher" module.version = "10.0" Module #24 Name: module-x11-xsmp Argument: display=:0.0 session_manager=local/medusa:@/tmp/.ICE-unix/3907,unix/medusa:/tmp/.ICE-unix/3907 Usage counter: n/a Properties: module.author = "Lennart Poettering" module.description = "X11 session management" module.version = "10.0" Sink #0 State: SUSPENDED Name: alsa_output.pci-0000_00_1f.3.analog-stereo Description: Built-in Audio Analog Stereo Driver: module-alsa-card.c Sample Specification: s16le 2ch 44100Hz Channel Map: front-left,front-right Owner Module: 6 Mute: no Volume: front-left: 28374 / 43% / -21.81 dB, front-right: 28374 / 43% / -21.81 dB balance 0.00 Base Volume: 65536 / 100% / 0.00 dB Monitor Source: alsa_output.pci-0000_00_1f.3.analog-stereo.monitor Latency: 0 usec, configured 0 usec Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY Properties: alsa.resolution_bits = "16" device.api = "alsa" device.class = "sound" alsa.class = "generic" alsa.subclass = "generic-mix" alsa.name = "ALC3246 Analog" alsa.id = "ALC3246 Analog" alsa.subdevice = "0" alsa.subdevice_name = "subdevice #0" alsa.device = "0" alsa.card = "0" alsa.card_name = "HDA Intel PCH" alsa.long_card_name = "HDA Intel PCH at 0xd1228000 irq 280" alsa.driver_name = "snd_hda_intel" device.bus_path = "pci-0000:00:1f.3" sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0" device.bus = "pci" device.vendor.id = "8086" device.vendor.name = "Intel Corporation" device.product.id = "9d71" device.form_factor = "internal" device.string = "front:0" device.buffering.buffer_size = "352800" device.buffering.fragment_size = "176400" device.access_mode = "mmap+timer" device.profile.name = "analog-stereo" device.profile.description = "Analog Stereo" device.description = "Built-in Audio Analog Stereo" alsa.mixer_name = "Realtek ALC3246" alsa.components = "HDA:10ec0256,10280767,00100002 HDA:8086280b,80860101,00100000" module-udev-detect.discovered = "1" device.icon_name = "audio-card-pci" Ports: analog-output-speaker: Speakers (priority: 10000) analog-output-headphones: Headphones (priority: 9000, not available) Active Port: analog-output-speaker Formats: pcm Source #0 State: SUSPENDED Name: alsa_output.pci-0000_00_1f.3.analog-stereo.monitor Description: Monitor of Built-in Audio Analog Stereo Driver: module-alsa-card.c Sample Specification: s16le 2ch 44100Hz Channel Map: front-left,front-right Owner Module: 6 Mute: no Volume: front-left: 9995 / 15% / -49.00 dB, front-right: 9995 / 15% / -49.00 dB balance 0.00 Base Volume: 65536 / 100% / 0.00 dB Monitor of Sink: alsa_output.pci-0000_00_1f.3.analog-stereo Latency: 0 usec, configured 0 usec Flags: DECIBEL_VOLUME LATENCY Properties: device.description = "Monitor of Built-in Audio Analog Stereo" device.class = "monitor" alsa.card = "0" alsa.card_name = "HDA Intel PCH" alsa.long_card_name = "HDA Intel PCH at 0xd1228000 irq 280" alsa.driver_name = "snd_hda_intel" device.bus_path = "pci-0000:00:1f.3" sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0" device.bus = "pci" device.vendor.id = "8086" device.vendor.name = "Intel Corporation" device.product.id = "9d71" device.form_factor = "internal" device.string = "0" module-udev-detect.discovered = "1" device.icon_name = "audio-card-pci" Formats: pcm Source #1 State: SUSPENDED Name: alsa_input.pci-0000_00_1f.3.analog-stereo Description: Built-in Audio Analog Stereo Driver: module-alsa-card.c Sample Specification: s16le 2ch 44100Hz Channel Map: front-left,front-right Owner Module: 6 Mute: no Volume: front-left: 9995 / 15% / -49.00 dB, front-right: 9995 / 15% / -49.00 dB balance 0.00 Base Volume: 6554 / 10% / -60.00 dB Monitor of Sink: n/a Latency: 0 usec, configured 0 usec Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY Properties: alsa.resolution_bits = "16" device.api = "alsa" device.class = "sound" alsa.class = "generic" alsa.subclass = "generic-mix" alsa.name = "ALC3246 Analog" alsa.id = "ALC3246 Analog" alsa.subdevice = "0" alsa.subdevice_name = "subdevice #0" alsa.device = "0" alsa.card = "0" alsa.card_name = "HDA Intel PCH" alsa.long_card_name = "HDA Intel PCH at 0xd1228000 irq 280" alsa.driver_name = "snd_hda_intel" device.bus_path = "pci-0000:00:1f.3" sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0" device.bus = "pci" device.vendor.id = "8086" device.vendor.name = "Intel Corporation" device.product.id = "9d71" device.form_factor = "internal" device.string = "front:0" device.buffering.buffer_size = "352800" device.buffering.fragment_size = "176400" device.access_mode = "mmap+timer" device.profile.name = "analog-stereo" device.profile.description = "Analog Stereo" device.description = "Built-in Audio Analog Stereo" alsa.mixer_name = "Realtek ALC3246" alsa.components = "HDA:10ec0256,10280767,00100002 HDA:8086280b,80860101,00100000" module-udev-detect.discovered = "1" device.icon_name = "audio-card-pci" Ports: analog-input-internal-mic: Internal Microphone (priority: 8900) analog-input-headphone-mic: Microphone (priority: 8700, not available) analog-input-headset-mic: Headset Microphone (priority: 8700, not available) Active Port: analog-input-internal-mic Formats: pcm Client #0 Driver: module-systemd-login.c Owner Module: 18 Properties: application.name = "Login Session c2" systemd-login.session = "c2" Client #3 Driver: module-x11-xsmp.c Owner Module: 24 Properties: application.name = "XSMP Session on xfce4-session as 2159d3f97-86ba-4963-b479-502063b5ced6" xsmp.vendor = "xfce4-session" xsmp.client.id = "2159d3f97-86ba-4963-b479-502063b5ced6" Client #4 Driver: protocol-native.c Owner Module: 11 Properties: application.name = "pa-applet" native-protocol.peer = "UNIX socket client" native-protocol.version = "32" application.process.id = "4246" application.process.user = "scientifics" application.process.host = "medusa" application.process.binary = "pa-applet" application.language = "en_CA.utf8" window.x11.display = ":0.0" application.process.machine_id = "085bfaaf2ce44b1ab51d8ae63418ee05" application.process.session_id = "c2" Client #9 Driver: protocol-native.c Owner Module: 11 Properties: application.name = "pactl" native-protocol.peer = "UNIX socket client" native-protocol.version = "32" application.process.id = "5292" application.process.user = "scientifics" application.process.host = "medusa" application.process.binary = "pactl" application.language = "en_CA.utf8" window.x11.display = ":0.0" application.process.machine_id = "085bfaaf2ce44b1ab51d8ae63418ee05" application.process.session_id = "c2" Card #0 Name: alsa_card.pci-0000_00_1f.3 Driver: module-alsa-card.c Owner Module: 6 Properties: alsa.card = "0" alsa.card_name = "HDA Intel PCH" alsa.long_card_name = "HDA Intel PCH at 0xd1228000 irq 280" alsa.driver_name = "snd_hda_intel" device.bus_path = "pci-0000:00:1f.3" sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0" device.bus = "pci" device.vendor.id = "8086" device.vendor.name = "Intel Corporation" device.product.id = "9d71" device.form_factor = "internal" device.string = "0" device.description = "Built-in Audio" module-udev-detect.discovered = "1" device.icon_name = "audio-card-pci" Profiles: input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 60, available: yes) output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6000, available: yes) output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6060, available: yes) output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5400, available: no) output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5460, available: yes) output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (sinks: 1, sources: 0, priority: 300, available: no) output:hdmi-surround+input:analog-stereo: Digital Surround 5.1 (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 360, available: yes) output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (sinks: 1, sources: 0, priority: 300, available: no) output:hdmi-surround71+input:analog-stereo: Digital Surround 7.1 (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 360, available: yes) output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (sinks: 1, sources: 0, priority: 5200, available: no) output:hdmi-stereo-extra1+input:analog-stereo: Digital Stereo (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5260, available: yes) output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 100, available: no) output:hdmi-surround-extra1+input:analog-stereo: Digital Surround 5.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes) output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 100, available: no) output:hdmi-surround71-extra1+input:analog-stereo: Digital Surround 7.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes) output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (sinks: 1, sources: 0, priority: 5200, available: no) output:hdmi-stereo-extra2+input:analog-stereo: Digital Stereo (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5260, available: yes) output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 100, available: no) output:hdmi-surround-extra2+input:analog-stereo: Digital Surround 5.1 (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes) output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 100, available: no) output:hdmi-surround71-extra2+input:analog-stereo: Digital Surround 7.1 (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes) off: Off (sinks: 0, sources: 0, priority: 0, available: yes) Active Profile: output:analog-stereo+input:analog-stereo Ports: analog-input-internal-mic: Internal Microphone (priority: 8900, latency offset: 0 usec) Properties: device.icon_name = "audio-input-microphone" Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround+input:analog-stereo, output:hdmi-surround71+input:analog-stereo, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1+input:analog-stereo, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2+input:analog-stereo analog-input-headphone-mic: Microphone (priority: 8700, latency offset: 0 usec, not available) Properties: device.icon_name = "audio-input-microphone" Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround+input:analog-stereo, output:hdmi-surround71+input:analog-stereo, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1+input:analog-stereo, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2+input:analog-stereo analog-input-headset-mic: Headset Microphone (priority: 8700, latency offset: 0 usec, not available) Properties: device.icon_name = "audio-input-microphone" Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround+input:analog-stereo, output:hdmi-surround71+input:analog-stereo, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1+input:analog-stereo, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2+input:analog-stereo analog-output-speaker: Speakers (priority: 10000, latency offset: 0 usec) Properties: device.icon_name = "audio-speakers" Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo analog-output-headphones: Headphones (priority: 9000, latency offset: 0 usec, not available) Properties: device.icon_name = "audio-headphones" Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo hdmi-output-0: HDMI / DisplayPort (priority: 5900, latency offset: 0 usec, not available) Properties: device.icon_name = "video-display" Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround, output:hdmi-surround+input:analog-stereo, output:hdmi-surround71, output:hdmi-surround71+input:analog-stereo hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, not available) Properties: device.icon_name = "video-display" Part of profile(s): output:hdmi-stereo-extra1, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1, output:hdmi-surround71-extra1+input:analog-stereo hdmi-output-2: HDMI / DisplayPort 3 (priority: 5700, latency offset: 0 usec, not available) Properties: device.icon_name = "video-display" Part of profile(s): output:hdmi-stereo-extra2, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2, output:hdmi-surround71-extra2+input:analog-stereo
Try this before and after closing the laptop lid: pasuspender -- speaker-test -Dhw:0 --channels=2 That will play some noise. Press ctrl-c when you've had enough. pasuspender makes pulseaudio release the alsa devices and then runs speaker-test. The -Dhw:0 argument makes speaker-test use the hardware directly instead of playing through pulseaudio. Does speaker-test stop working after closing the lid?
No headphones: sound stops when lid closed (activating suspend), sound starts again when lid opened and suspend is over. Headphones: sound stops when lid closed, starts when lid open Headphones in, sound stops when lid closed, starts when lid opened, switches to internal speakers when headphones unplugged. Fourth time I tried it again with headphones in, first it kept going when the lid was closed, laptop didn't suspend, I opened the lid and suspend state activated after a few seconds, then I lost all sound. Headphones were plugged in the whole time.
After restart I get this message from pasuspender: speaker-test 1.1.4 Playback device is hw:0 Stream parameters are 48000Hz, S16_LE, 2 channels Using 16 octaves of pink noise Playback open error: -2,No such file or directory
If trying to open "hw:0" fails with "No such file or directory", then it looks like alsa removes the sound card from the system for some reason. Please report this to the alsa developers. http://alsa-project.org/main/index.php/Bug_Tracking
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.