Audio qube

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"
1 Like

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.

1 Like

updated the instructions

2 Likes

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 %}

I’m missing visual feedback, is there any relevant package I can use to show current status(percentage/muted) and on key-binded press for up/down/mute?

Good guide, thank you.

If you just want to make sure up/down/mute work as expected, you can press those keybindings while running pavucontrol inside sys-audio.

You can install the pasystray package in sys-audio, it’ll at least show muted/unmuted status and you can open Volume Control through this tray icon.

@fsflover
Thanks, didn’t see that.

Thanks, I’m aware. I want to be able to see current status.

Thanks. Tried that, but I see the icon as white square, similar to sys-net.

It looks fine for me on default Qubes OS 4.2 setup with Xfce, seems to be a KDE issue.

will this configuration allow you to attach bluetooth headphones to a standaloneVM? More specifically, an android VM?

Hi, I could not get pipewire installed. It says ‘no match for argument: pipwire-qubes’

I tried to add audio devices to the VM but now sound doesnt work at all. My output device is missing from pulseaudio. Any recommendations on how i can fix this?

I don’t really understand what you are trying to do.

What is an “android VM” ? What OS does it really run ? how do you install packages on it ? and then you need to find how to install the qubes os packages on it. But you really should not try to make it an audiovm, or, you could, but be ready to suffer a bit

The standard way would be to create an audiovm following this guide (no standalone, no ‘android vm’), nothing related to an “android vm”. Once everything work correctly, setup your “android vm” (nothing related to audio), and install the required qubesos packages on your “android vm” so it can communicate and integrate with qubesos tools

From boot to boot, PulseAudio configuration(within sys-audio) is missing completely, printing “No cards available for the configuration”. Meaning I don’t have sound and I can’t enable it.

Is there any command to re-enable it?

Was this bug after the in place upgrade from 4.1 to 4.2?