connect to PA in stubdom if audio-model enabled

run pacat in low latency mode by default
This commit is contained in:
Dmitry Fedorov 2020-05-29 12:07:38 +03:00
parent b1453953f9
commit ec90829695
No known key found for this signature in database
GPG Key ID: C61C7F61C4D85F8D

View File

@ -341,7 +341,10 @@ class DAEMONLauncher:
:param vm: VM for which start AUDIO daemon
"""
# pylint: disable=no-self-use
pacat_cmd = [PACAT_DAEMON_PATH, vm.xid, vm.name]
xid = vm.stubdom_xid if vm.features.check_with_template('audio-model', False) \
and vm.virt_mode == 'hvm' else vm.xid
pacat_cmd = [PACAT_DAEMON_PATH, '-l', xid, vm.name]
vm.log.info('Starting AUDIO')
yield from asyncio.create_subprocess_exec(*pacat_cmd)
@ -387,7 +390,10 @@ class DAEMONLauncher:
if not vm.features.check_with_template('audio', True):
return
if not os.path.exists(self.pacat_pidfile(vm.xid)):
xid = vm.stubdom_xid if vm.features.check_with_template('audio-model', False) \
and vm.virt_mode == 'hvm' else vm.xid
if not os.path.exists(self.pacat_pidfile(xid)):
yield from self.start_audio_for_vm(vm)
def on_domain_spawn(self, vm, _event, **kwargs):