I have such a malfunction: after coming out of sleep, the sound disappears on the PC (in chromium). It can be solved if you type the pulseaudio -k
command in the terminal. But in order not to enter it every time, I made a script:
#!/bin/bash
pulseaudio -k
I did everything as in this answer, but it didn't work. I get the message in the log:
E: [pulseaudio] main.c: The daemon could not shut down: There is no such process
At the same time, if you enter it in the console after that: pulseaudio -k
, the command is executed without error and the sound appears.
What am I doing wrong?
P.S.
User service:
[Unit]
Description=Run my_script_pulse
After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
#After=sleep.target
[Service]
#Type=oneshot
#Type=forking
ExecStart=/usr/local/bin/st_pulse
#ExecStart=/home/paul/st_pulse.sh
#User=paul
#Environment=DISPLAY=:0
StandardOutput=file:/home/paul/log_file
[Install]
WantedBy=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
#WantedBy=sleep.target
systemctl --user restart pulseaudio.service
, I get:Failed to connect to bus: There is no such file or directory
– sapeg Jan 27 '24 at 15:34