From ec90829695a42f186f6bba9d8236413fe3ddade8 Mon Sep 17 00:00:00 2001 From: Dmitry Fedorov Date: Fri, 29 May 2020 12:07:38 +0300 Subject: [PATCH] connect to PA in stubdom if audio-model enabled run pacat in low latency mode by default --- qubesadmin/tools/qvm_start_daemon.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qubesadmin/tools/qvm_start_daemon.py b/qubesadmin/tools/qvm_start_daemon.py index e42a7f5..dd5a87c 100644 --- a/qubesadmin/tools/qvm_start_daemon.py +++ b/qubesadmin/tools/qvm_start_daemon.py @@ -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):