The sound volume isn't set (via pactl) in certain conditions. (during the time between software suspend and hardware suspend)
Summary
There's a period of about 12 seconds after pulseaudio suspends the output sink during which the volume isn't actually set(in hardware) to the wanted value(via pactl
), it instead remains set to the current(previous) value, even though the software reports the newly set value.
environment
Unless you are sure its not relevant please attach files for each command.
uname -a
aplay -l
arecord -l
pactl info
pactl list
pulseaudio --version
(Attaching files doesn't seem to work, I'll retry in next comment!)
Steps to reproduce
- run attached script ./repro
- quit vlc
- look at
dmesg -w
until you see pulseaudio suspending stuff eg. the line with 278.189405 in the following:
[ 273.327622] user[4591]: ./repro ended
[ 275.180246] pulseaudio[1189]: ( 260.925| 1.854) D: [alsa-sink-ALC1220 Analog][pulsecore/sink.c:3737 pa_sink_volume_change_apply()] Volume change to 13107 at 275172637 was written 50 usec late
[ 278.189405] pulseaudio[1189]: ( 263.935| 3.009) I: [pulseaudio][modules/module-suspend-on-idle.c:69 timeout_cb()] Sink alsa_output.pci-0000_00_1f.3.analog-stereo idle for too long, suspending ...
[ 278.193188] pulseaudio[1189]: ( 263.936| 0.000) I: [alsa-sink-ALC1220 Analog][modules/alsa/alsa-sink.c:966 suspend()] Device suspended...[uname.log](/uploads/bcad246bdd8a5086742f0ba2d3b6c79a/uname.log)
[ 278.193330] pulseaudio[1189]: ( 263.936| 0.000) D: [pulseaudio][pulsecore/sink.c:449 sink_set_state()] alsa_output.pci-0000_00_1f.3.analog-stereo: suspend_cause: (none) -> IDLE
[ 278.193490] pulseaudio[1189]: ( 263.936| 0.000) D: [pulseaudio][pulsecore/sink.c:458 sink_set_state()] alsa_output.pci-0000_00_1f.3.analog-stereo: state: IDLE -> SUSPENDED
[ 278.193643] pulseaudio[1189]: ( 263.936| 0.000) D: [pulseaudio][pulsecore/source.c:403 source_set_state()] alsa_output.pci-0000_00_1f.3.analog-stereo.monitor: suspend_cause: (none) -> IDLE
[ 278.193793] pulseaudio[1189]: ( 263.936| 0.000) D: [pulseaudio][pulsecore/source.c:412 source_set_state()] alsa_output.pci-0000_00_1f.3.analog-stereo.monitor: state: IDLE -> SUSPENDED
[ 278.193901] pulseaudio[1189]: ( 263.936| 0.000) D: [pulseaudio][pulsecore/core.c:466 pa_core_maybe_vacuum()] Hmm, no streams around, trying to vacuum.
[ 278.194007] pulseaudio[1189]: ( 263.936| 0.000) D: [pulseaudio][modules/module-udev-detect.c:288 verify_access()] /dev/snd/controlC0 is accessible: yes
[ 278.194109] pulseaudio[1189]: ( 263.936| 0.000) D: [pulseaudio][modules/module-udev-detect.c:355 verify_access()] Resuming all sinks and sources of card alsa_card.pci-0000_00_1f.3.
[ 283.325517] pulseaudio[1189]: ( 269.071| 5.135) I: [pulseaudio][modules/module-device-restore.c:132 save_time_callback()] Synced.
- you now have 12 seconds before you see this on dmesg:
[ 290.558086] snd_hda_intel 0000:00:1f.3: PME# enabled
[ 290.570452] snd_hda_intel 0000:00:1f.3: power state changed by ACPI to D3hot
If you re-run ./repro during those 12 seconds, the issue is reproducible 100% (ie. the volume during 'vlc' is not 95% even though pamixer --get-volume
reports it as 95, it is in fact 20% still!)
If you run ./repro outside of those 12 seconds(ie. before or after), the issue never happens and thus the volume is set correctly to the 95% value.
I guess /sys/bus/pci/devices/0000:00:1f.3/power/control
must not be on
, should probably be auto
, and
and I have SOUND_POWER_SAVE_ON_AC=10
set in /etc/default/tlp
which probably sets it via
-rw-r--r-- 1 root root 4096 11.07.2019 07:37 /sys/bus/pci/devices/0000:00:1f.3/power/autosuspend_delay_ms
although I cannot read that value now, for unknown reasons:
cat: '/sys/bus/pci/devices/0000:00:1f.3/power/autosuspend_delay_ms': Input/output error
What is the current bug behavior?
during 'vlc' the volume remains set to the value it was last time eg. 20%
even though pamixer --get-volume
will report the new volume eg. 95%
In other words, during the time that pulseaudio
says it suspended stuff ie.
alsa_output.pci-0000_00_1f.3.analog-stereo: state: IDLE -> SUSPENDED
and the time the kernel(or what) says it suspended the sound card device ie.
snd_hda_intel 0000:00:1f.3: PME# enabled
snd_hda_intel 0000:00:1f.3: power state changed by ACPI to D3hot
setting the volume will have no actual effect, except that pulseaudio thinks it worked thus pamixer --get-volume
will wrongly report the set volume eg. 95% when in fact it's only 20% (the last value the volume had before suspend)
What is the expected correct behavior?
the volume should be set the the new value eg. 95% in hardware too!