Audio qube

From my understanding, HDMI audio will only work if your gpu contains an audio device and a vga device. In that case you can passthrough the audio part of the GPU to sys-audio, and you will have sound through HDMI. Nvidia and Amd seems to work correctly. It seems that for Intel there is only 1 device that is used for vga+audio. In that case you can’t have HDMI sound in sys-audio unless you do a gpu passthrough

2 Likes

Glad to see you got it working!

And sorry for the very late answer: I only got this to work with Debian and not Fedora. Of course, like you I tried setting sys-audio as audiovm to sys-audio but that didn’t work for me back then.

What didn’t work for me with Debian was the so called “recommended way”, applying the patch. After that my sys-audio stopped working and there were some error messages. I changed back to the “non recommended way” and this is working.

Thanks, I gave up on HDMI actually because I didn’t have enough ports. On the other hand, I was getting sound out of the speakers via BT, but after a few days it stopped working and I couldn’t even get sound out the same way. Now I am using the USB speaker I have been using to produce sound. This is still not inconvenient.

But I would like to try the audio-app again. In the very first step, I created an audio-app, and when I created it, sys-audio (I think) was automatically selected as the template, but when I checked the settings after creating the audio-app, the template changed to debian-12-xfce and there is a triangular alert mark next to it. I think it should be sys-audio here, how should I review the settings?

When I checked the error message, I found an item in the Application shown in App Menu column where Thunar was not installed, and when I moved this item to the I should have read the English message a little more carefully…

Also, if anyone is reading this, please let me know, in the audio-template

sudo apt install pipewire-qubesqubes-audio-daemon pavucontrol qubes-core-admin-client When I run qubes-usb-proxy alsa-utils

I get an error saying pipewire-qubesqubes-audio-daemon, this is not found. qubesqubes, I get the same error when I change it to qubes. I think it’s probably because I’m trying to install with the debian template, but can I use another pipewire instead?

Thanks for making this great guide! I have tried to get an audio vm working but unfortunately I just can’t get it to work. I’ve had some successes, sometimes, but then it stops working again and I can’t reproduce it working anymore.

I’ve followed your steps of making the three qubes (sys-audio, audio-template and audio-qube). I’ve compated all with qvm-prefs so I’m convinced they’re set up right. I’ve gotten the sound test to work in sys-audio too, but that’s where I get stuck. I’ve added the policies, patched the python file, and then reboot my machine, but then there is no sound anymore, not even in sys-audio. That’s when I started to fiddle with the global/local preference for audiovm and reboot sys-audio where at one point it worked for a short while. Unfortunately I wasn’t able to figure out what got it to work, but I had to restore everything back to normal so that at least I have sound again.

What I found interesting is that at the times sys-audio had sound, it showed it’s audio sync (via tray icon menu settings) to be Qubes Virtual Audio Sink. When it wasn’t working, something like Dummy Output showed up here.

I tried to automate the creation of the VMs with Salt while I was setting everything up, when I found out there already exists a salt state for sys-audio (can be executed by sudo qubesctl state.sls qvm.sys-audio). This seems to set up something something similar, but only sys-audio is created. It leaves me with the same non working situation anyways. Is this supposed to be the ‘official’ way as intended by the Qubes devs?

Anyone have any idea how I would be able to proceed next? Any logs I can produce to enable somebody to help me further?

Any help is appreciated!

The correct command is qvm-device (without s).

Otherwise it’s working well, with a Scarlett Solo sound card and bluetooth headset!

It’s not necessary to install all linux-firmware (almost 200mb). You can simply run sudo dnf install linux-firmware and see which package you need (in my case it was only atheros-firmware).

1 Like

What should be the audiovm for sys-audio? If sys-audio itself, then we can’t stop this qube because it says sys-audio is still running as it depends on itself.

fixed the “qvm-devices” :slight_smile:

And for the sys-audio audiovm, you choose (read the posts around this one) :

1 Like

Thanks!

Also, any ways to run the same XFCE applet than the one by default in dom0 instead of pasystray?

I seem to be stuck at the same point, just without the sound issues in sys-audio.

From Clean install, I get to the point where it says:

Once this is done, you can restart your ‘sys-audio’ qube.
If everything has been configured correctly, you should see the active qube
configured to use ‘sys-audio’ in the ‘pavucontrol’ interface of ‘sys-audio’.

I’m following the “Recommended way”, and am super confused.

Playing audio out from the USB Audio device works fine in sys-audio.
Each of the (not sys-audio) volume control have “dummy output” listed.

I’ve tried running pactl load-module module-vchan-sink as per other forum guides within one of my Personal qubes, which gives me the Failure: no such entity error.

Have I missed something?

(p.s. while I do seem to be having issues, thank you @neowutran for this well-written guide :slight_smile: )

You can also check the Salt scripts from Qusal, it’s working out of the box:

what is the confusing thing ?

My main confusion is the fact that I end uo with this dummy output after getting to this step.

Ive tried restarting the device, checking for errors in the logs, manually configuing the xid then restarting pipewire, just cant seem to get it to work.

Whats more frustrating is, (ive got nothing on the device so i can), i did a blank reinstall of the latest Qubes, and out of the box the default Dom0 behaves exactly as you describe and how id expect, letting me output to devices as expected, i just cant output to my UBS headset.

I think the key thing im struggling to figure out is how to debug what went wrong, and correct it. Getting stuck with “Dummy Output”, no obvious errors or clear guidance on debugging is not fun. I dont expect you to baby us by any means, but at the same time a “if you get dummy outputs only, check youve done x step correctly” would be extremely helpful - (more helpful would be an official guide, but hey, lets do one step at a time :rofl: )

P.s. did spent the entirety of yesterday and today debugging this before posting - used about 10 different threads and asked a few different AI’s (not that i expected much from them)

Getting “dummy output” on other qubes means the communication between the qubes and audiovm is not working.
If you only modified things mentioned in the guide, I would guess you did something wrong at the step “Configuring Services” or “Configuring policy”.

Re-read those steps.
Additionally:

Check that you use the same audiovm name as me: “sys-audio”

I mention the path “/usr/lib/python3.11/site-packages/qubesadmin/tools/qvm_start_daemon.py”, it will be “/usr/lib/python3.12/site-packages/…” in more recent template, check the python version used on your system.


To debug, you probably want to see the output of “qvm-start-daemon” in sys-audio.
In sys-audio, kill the existing process “qvm-start-daemon”, and launch it manually

qvm-start-daemon --all --watch

You will get some informations on stdout

1 Like

I was able to follow the guide up until Disabling audio for qubes that doesn’t need it however, I don’t understand how to get the other qubes to use the sys-audio. They all have the sys-audio as their audiovm but they don’t seem to detect any audio sources. for the Policy I copied the entire document you linked on git-hub I wasn’t sure if I should have done that or needed to update all lines by hand.

sys-audio qvm-start-daemon --all --watch Results

[user@sys-audio ~]$ qvm-start-daemon --all --watch
app: Failed to handle event: None, connection-established, {}
Traceback (most recent call last):
File “/usr/lib/python3.11/site-packages/qubesadmin/base.py”, line 232, in getattr
property_str = self.qubesd_call(
^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/site-packages/qubesadmin/base.py”, line 76, in qubesd_call
return self.app.qubesd_call(dest, method, arg, payload,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/site-packages/qubesadmin/app.py”, line 893, in qubesd_call
raise qubesadmin.exc.QubesDaemonAccessError(
qubesadmin.exc.QubesDaemonAccessError: Service call error: Request refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.11/site-packages/qubesadmin/events/init.py”, line 259, in handle
handler(subject, event, **kwargs)
File “/usr/lib/python3.11/site-packages/qubesadmin/tools/qvm_start_daemon.py”, line 688, in on_connection_established
self.xid_cache[vm.name] = vm.xid, vm.stubdom_xid
^^^^^^^^^^^^^^
File “/usr/lib/python3.11/site-packages/qubesadmin/base.py”, line 239, in getattr
raise qubesadmin.exc.QubesPropertyAccessError(item)
qubesadmin.exc.QubesPropertyAccessError: Failed to access ‘stubdom_xid’ property
^C[user@sys-audio ~]$

Linux Personal Qube pavucontrol Response

[user@personal ~]$ qubesdb-read -w /qubes-audio-domain-xid
20
[user@personal ~]$ load-module module-vchan-sink domid=20
bash: load-module: command not found
[user@personal ~]$ pavucontrol

(pavucontrol:2381): Gdk-CRITICAL **: 13:05:58.542: gdk_atom_intern: assertion ‘atom_name != NULL’ failed

(pavucontrol:2381): Gdk-CRITICAL **: 13:05:58.542: gdk_atom_intern: assertion ‘atom_name != NULL’ failed

The error message you have indicate that the policy file have not be setup correctly.
In dom0, can you check the content of ‘/etc/qubes/policy.d/50-sys-audio.policy’ ?
sudo cat /etc/qubes/policy.d/50-sys-audio.policy

I think I’m getting the same error now (sorry for the delay, been otherwise occupied and only now getting back round to this)

Outputs:

[user@sys-audio ~]$ qvm-start-daemon --all --watch
Another GUI daemon process (with PID 1109) is already running
[user@sys-audio ~]$ 
user@personal:~$ qubesdb-read -w /qubes-audio-domain-xid
21
user@personal:~$ load-module module-vchan-sink domid=21
bash: load-module: command not found
user@personal:~$ pavucontrol

(pavucontrol:10097): Gdk-CRITICAL **: 22:00:32.352: gdk_atom_intern: assertion 'atom_name != NULL' failed

(pavucontrol:10097): Gdk-CRITICAL **: 22:00:32.353: gdk_atom_intern: assertion 'atom_name != NULL' failed

policy:

admin.Events                            *                               sys-audio       @adminvm                allow   target=dom0
admin.Events                            +domain-stopped                 sys-audio       @tag:audiovm-sys-audio  allow   target=dom0
admin.Events                            +domain-shutdown                sys-audio       @tag:audiovm-sys-audio  allow   target=dom0
admin.Events                            +domain-start                   sys-audio       @tag:audiovm-sys-audio  allow   target=dom0
admin.Events                            +connection-established         sys-audio       @tag:audiovm-sys-audio  allow   target=dom0

admin.vm.CurrentState                   *                               sys-audio       @adminvm                allow   target=dom0
admin.vm.CurrentState                   *                               sys-audio       @tag:audiovm-sys-audio  allow   target=dom0
admin.vm.List                           *                               sys-audio       @adminvm                allow   target=dom0
admin.vm.List                           *                               sys-audio       @tag:audiovm-sys-audio  allow   target=dom0

admin.vm.property.Get                   +audiovm                        sys-audio       @tag:audiovm-sys-audio  allow   target=dom0
admin.vm.property.Get                   +xid                            sys-audio       @tag:audiovm-sys-audio  allow   target=dom0
admin.vm.feature.CheckWithTemplate      +audio                          sys-audio       @tag:audiovm-sys-audio  allow   target=dom0
admin.vm.feature.CheckWithTemplate      +audio-model                    sys-audio       @tag:audiovm-sys-audio  allow   target=dom0
admin.vm.feature.CheckWithTemplate      +supported-service.pipewire     sys-audio       @tag:audiovm-sys-audio  allow   target=dom0
admin.vm.feature.CheckWithTemplate      +audio-low-latency              sys-audio       @tag:audiovm-sys-audio  allow   target=dom0
admin.vm.property.Get                   +stubdom_xid                    sys-audio       @tag:audiovm-sys-audio  allow   target=dom0

The only thing I can see personally is that I’ve spaced mine more than the one in your code to make it easier for me to read, but could this be causing a problem?

I wasn’t sure how to create the policy so I just copied it pasted into a document and moved it to dom0 maybe I need to give it permissions or the formatting was create wrong? Random S**** · GitHub

Seems to be some copy paste error ? target=dom050 should be target=dom0

1 Like

Can you show the content of “/usr/lib/python3.12/site-packages/qubesadmin/tools/qvm_start_daemon.py” in you “sys-audio” ?

Also, in your sys-audio, kill the running qvm-start-daemon process

sudo kill 1109

and restart it manually

qvm-start-daemon --all --watch

You will see interesting things

1 Like