mirror of
https://github.com/lutris/lutris
synced 2024-10-14 03:32:52 +00:00
Verify Pulseaudio is installed before reset (Closes #2651)
This commit is contained in:
parent
05d8edf1c4
commit
13ddb444db
|
@ -1,12 +1,15 @@
|
|||
"""Whatever it is we want to do with audio module"""
|
||||
import subprocess
|
||||
import time
|
||||
from lutris.util.log import logger
|
||||
from lutris.util import system
|
||||
|
||||
|
||||
def reset_pulse():
|
||||
"""Reset pulseaudio."""
|
||||
subprocess.Popen(["pulseaudio", "--kill"])
|
||||
if not system.find_executable("pulseaudio"):
|
||||
logger.warning("PulseAudio not installed. Nothing to do.")
|
||||
return
|
||||
system.execute(["pulseaudio", "--kill"])
|
||||
time.sleep(1)
|
||||
subprocess.Popen(["pulseaudio", "--start"])
|
||||
system.execute(["pulseaudio", "--start"])
|
||||
logger.debug("PulseAudio restarted")
|
||||
|
|
Loading…
Reference in a new issue