Is it possible to disable the default audiovm for sys-usb / firewall / net? I get a notification that I can’t restart sys-audio because it’s being used by sys-net etc.
Using the individual qube assignment above and setting it to “NONE” worked for me.
[user@dom0 ~]$ qvm-prefs sys-net audiovm ''
Out of the blue, totally new property might prevent you from hearing sound from sys-audio.
admin.vm.property.Get +stubdom_xid sys-audio @tag:audiovm-sys-audio allow target=dom0
Updated the “non recommended way”
I’m stuck at Testing sound, I can’t start sys-audio: start failed: internal error: unable to reset pci device... 3: no flr, pm reset or bus reset available. see /var/log...
In the log:
... the kernel doesn't support reset from sysfs for pci device ...
I must say, I passed only one device to the sys-audio: audio device: interl corporation...
I don’t know what else to pass, because there’s no devices with name “audio” in them and I don’t know how to determine them. qvm-pci don’t really tell me much.
When I passed this audio device to sys-audio and it failed, I stopped getting audio in dom0 and aplay -l didn’t show any audio devices. So I’m kinda sure it’s the only audio device I have, but not sure as I also have audio jack in my laptop.
You should set the “no-strict-reset” attribute of your audio device via Qubes Manager. In “Settings” of sys-audio, switch to “Devices” page and you’ll see the “no-strict-reset” button.
Upon applying your patches, I’m getting this error
Dec 26 09:04:45 dom0 qubesd[72401]: File "/usr/share/qubes/templates/libvirt/xen.xml", line 190, in block "devices"
Dec 26 09:04:45 dom0 qubesd[72401]: cmdline="-machine xenfv,max-ram-below-4g=2G -qubes-audio:audiovm_xid={{ audiovm_xid }}"
Dec 26 09:04:45 dom0 qubesd[72401]: jinja2.exceptions.UndefinedError: 'audiovm_xid' is undefined
Is it because I have in the same line 2GB patch?
This is how looks the code in xen.xml I understood it:
{% endblock %}
<os>
{% block os %}
{% if vm.audiovm %}
{% set audiovm_xid = vm.audiovm.xid %}
{% else %}
{% set audiovm_xid = 0 %}
{% endif %}
{% if vm.virt_mode == 'hvm' %}
Also:
{% else %}
cmdline="-net lwip,client_ip={{ vm.ip -}}
,server_ip={{ vm.dns[1] -}}
,dns={{ vm.dns[0] -}}
,gw={{ vm.netvm.gateway -}}
,netmask={{ vm.netmask }} -machine xenfv,max-ram-below-4g=2G -qubes-audio:audiovm_xid={{ audiovm_xid }}"
{% endif %}
This is how it looks in stubroots:
# add audiodev conf to cmdline and run pulseaudio
audio_model=$(echo "$dm_args" | sed -n '/^-soundhw/ {n;p}')
# Extract network parameters and remove them from dm_args
audio_args=$(echo "$dm_args" | sed -n '/^-qubes-audio:/p')
dm_args=$(echo "$dm_args" | sed '/^-qubes-audio:/d')
get_audio_arg() {
echo "$audio_args" | sed -n 's/^.*[:,]'$1'=\([^,]\+\).*$/\1/p'
}
if [ -n "$audio_model" ] ; then
model_args=
and also
pulseaudio --use-pid-file=no --daemonize=no --exit-idle-time=-1 --disable-shm=yes -n \
-L "module-native-protocol-unix auth-anonymous=1 socket=/tmp/pa.sock" \
-L "module-vchan-sink domid=$(get_audio_arg 'audiovm_xid')" &
fi
Do I have a typo somewhere I can’t see it, or…?
Thank you.
It works now.
Well I remember there are two lines that both read {% if vm.virt_mode == ‘hvm’ %}. You’ll need to add new lines above the second appearance of that line.
the watch daemon in the sys-audio qube almost never picks up new qubes starting (in the application stream overview), unless it’s been restarted very recently. (Running 4.2, been an issue since I tried RC3/4).
Also a bit sad that so much of the configuration (explained by neowutran) still has to be done manually in dom0 before this works at all.
Thanks, but unfortunately the same result…
Here’s where I put it now, according to your tip
</features>
{% block clock %}
{% if vm.audiovm %}
{% set audiovm_xid = vm.audiovm.xid %}
{% else %}
{% set audiovm_xid = 0 %}
{% endif %}
{% if vm.virt_mode == 'hvm' %}
New post because of those accessing via email.
It’s definitely about xen.xml. Because I left stubdoms with given patches, but reverted xen.xml to original state and now I can start sys-audio, or any other qube, which wasn’t possible when xen.xml patch as given was applied.
So, the syntax in cmdline line maybe, when there are other arguments, after ,netmask=...?
Sorry that my memory turned out to be wrong. There are actually 3 appearances of {% if vm.virt_mode == 'hvm' %}. The local variable audiovm_xid only has effect while in its block. So instead of {% block os %} or {% block clock %}, you’ll need to find the line {% block devices %} and scroll down until you see {% if vm.virt_mode == 'hvm' %}, that’s where audiovm_xid should be set, because it will be used in cmdline=....
@neowutran could you please update the instructions to make it clearer? Thanks!
@tempmail Also I think that using this workaround together with the 4gb patch will make it easy to mess up with commas and dashes. So I’d make cmdline look like this:
cmdline="-net lwip,client_ip={{ vm.ip -}}
,server_ip={{ vm.dns[1] -}}
,dns={{ vm.dns[0] -}}
,gw={{ vm.netvm.gateway -}}
,qubes-audio:audiovm_xid={{ audiovm_xid -}}
,netmask={{ vm.netmask }} -machine xenfv,max-ram-below-4g=2G"
Thanks @augsch
Finally, I was able to start sys-audio after your findings.
Unfortunately, I cannot start win qubes. Now it gives me error:
Dec 27 15:17:57 dom0 libvirtd[1808]: internal error: libxenlight failed to create new domain ‘win10’
Dec 27 15:17:57 dom0 qubesd[72401]: vm.win10: Start failed: internal error: libxenlight failed to create new domain ‘win10’
When I manually set domid (sys-audio’s xid) in stubdoms, no problem with any of these. So, this guide isn’t accurate for all.
updated the instructions
Also, in my xen.xml, there are 3 occurencies of cmdline =
{% if vm.virt_mode == 'hvm' %}
<!-- server_ip is the address of stubdomain. It hosts it's own DNS server. -->
{% if vm.audiovm %}
{% set audiovm_xid = vm.audiovm.xid %}
{% else %}
{% set audiovm_xid = 0 %}
{% endif %}
<emulator
{% if vm.features.check_with_template('linux-stubdom', True) %}
type="stubdom-linux"
{% else %}
type="stubdom"
{% endif %}
{% if vm.netvm %}
{% if vm.features.check_with_template('linux-stubdom', True) %}
cmdline="-qubes-net:client_ip={{ vm.ip -}}
,dns_0={{ vm.dns[0] -}}
,dns_1={{ vm.dns[1] -}}
,gw={{ vm.netvm.gateway -}}
,qubes-audio:audiovm_xid={{ audiovm_xid }}
,netmask={{ vm.netmask }} -machine xenfv,max-ram-below-4g=2G"
{% else %}
cmdline="-net lwip,client_ip={{ vm.ip -}}
,server_ip={{ vm.dns[1] -}}
,dns={{ vm.dns[0] -}}
,gw={{ vm.netvm.gateway -}}
,qubes-audio:audiovm_xid={{ audiovm_xid }}
,netmask={{ vm.netmask }} -machine xenfv,max-ram-below-4g=2G"
{% endif %}
{% else %}
cmdline="-machine xenfv,max-ram-below-4g=2G
,qubes-audio:audiovm_xid={{ audiovm_xid }}"
{% endif %}
{% if vm.stubdom_mem %}
memory="{{ vm.stubdom_mem * 1024 -}}"
{% endif %}
{% if vm.features.check_with_template('audio-model', False)
or vm.features.check_with_template('stubdom-qrexec', False) %}
kernel="/usr/libexec/xen/boot/qemu-stubdom-linux-full-kernel"
ramdisk="/usr/libexec/xen/boot/qemu-stubdom-linux-full-rootfs"
{% endif %}
/>
Still not working, though. Any additional hint appreciated.
at the end of every cmdline you should have
-qubes-audio:audiovm_xid={{ audiovm_xid }}
so
{% if vm.netvm %}
{% if vm.features.check_with_template('linux-stubdom', True) %}
cmdline="-qubes-net:client_ip={{ vm.ip -}}
,dns_0={{ vm.dns[0] -}}
,dns_1={{ vm.dns[1] -}}
,gw={{ vm.netvm.gateway -}}
,qubes-audio:audiovm_xid={{ audiovm_xid }}
,netmask={{ vm.netmask }} -machine xenfv,max-ram-below-4g=2G -qubes-audio:audiovm_xid={{ audiovm_xid }}"
{% else %}
cmdline="-net lwip,client_ip={{ vm.ip -}}
,server_ip={{ vm.dns[1] -}}
,dns={{ vm.dns[0] -}}
,gw={{ vm.netvm.gateway -}}
,qubes-audio:audiovm_xid={{ audiovm_xid }}
,netmask={{ vm.netmask }} -machine xenfv,max-ram-below-4g=2G -qubes-audio:audiovm_xid={{ audiovm_xid }}"
{% endif %}
{% else %}
cmdline="-machine xenfv,max-ram-below-4g=2G -qubes-audio:audiovm_xid={{ audiovm_xid }}"
{% endif %}