I have followed neowutran’s sys-audio guide
my audio works fine but I am having issue with auto starting the sys-audio qube on boot.
The points below are what I have observed. I am trying to figure out the conflicts as whenever I implement neowutran’s HVM workaround sys-usb, sys-net wont run at all (i believe due to stubdom changes combined with pci/usb conflicts) and I have to add qubes.skip_autostart to the grub menu to get qubes to load (I only have usb keyboard and mouse). So I have done a fresh install of Qubes OS and before implimenting the HVM workaround makign sure everything is in order.
If I configure 00:1f.3 Audio device: Intel Corporation WITH the “no strict reset” option then sys-audio qube can’t start automatically but will run if I start manually after boot.
If I configure 00:1f.3 Audio device: Intel Corporation WITHOUT the “no strict reset” option I get a “Can’t reset” error and it will not start automatically and I can’t start it manually.
If I try to attach device 01:00.1 (NVIDIA Audio device) WITHOUT the “no strict reset” option sys-audio won’t start automaticlly or manually because 01:00.0 (NVIDIA VGA Controller/GPU) is on the same bus.
If I try to attach device 01:00.1 (NVIDIA Audio device) WITH the “no strict reset” option sys-audio won’t start automaticlly but will start manually after booting (I’m guessing) because 01:00.0 (NVIDIA VGA Controller/GPU) is hidden from dom0 for GPU passthrough.
sys-audio actually works without these devices but it seems like as they are audio devices I should attach them? I also saw neowutran had both of these devices attached in their screenshot.
Also as a side note sys-usb is logging an error for not being able to reset 00:14.0 (USB Controller) but still starts automaticlly.
If you only add 00:1f.3 PCI device to sys-audio with no-strict-reset and set it to autostart then what will be the error in dom0 journalctl when it’ll try to start at boot?
vm.sys-audio: Start failed: usb device sys-usb:2-5.3 not available
Did you persistently attached the USB device to your sys-audio?
It will fail if the USB device is not available at the time when sys-audio starts.
You can configure it like this:
That’s strange. I never noticed that before but it still boots. I guess it eventually acquires it but everything else dependent on it can’t run?
I wanted to try to get it working without the work around so I entered qubes.skip_autostart to the grub menu on boot. Then I detached and reattached the USB controller persistently with strict reset but then sys-usb devices wouldn’t start up on next boot.
So in order to implement the work around you suggested I went back in via qubes.skip_autostart and detached the USB controller then reattached persistently with no-strict-reset
I have implemented the workaround you suggested. I am not sure which variable(s) I need to change in the bash script and what value(s) to put there.
It’s not a problem with PCI USB controller attached to sys-usb.
It’s a problem with USB device that you’ve persistently attached from sys-usb to sys-audio using:
Since sys-usb is not started yet and it didn’t initialize the USB device sys-usb:2-5.3 to make it available for attachment before sys-audio is attempting to start then sys-audio start fails.
Thank you for the explanation that makes sense. I didn’t understand why sys-usb was giving an error related to the USB controller.
I implemented the work around and it didnt seem to work with the USB device ID or description. I tried with and without quotes around the VM Name and making the USB device persistent and not persistent on sys-audio
Did you uncheck “Start qube automatically on boot” for sys-audio in its Settings?
Do you have two USB devices attached persistently to sys-audio? Then it’s better to fix the script to add the check for second USB device availability.
And did you reboot the Qubes OS after making these changes (adding the hook script /etc/libvirt/hooks/libxl)?
vm.sys-audio: Start failed: usb device sys-usb:2-4 not available
It’s failing to attach sys-usb:2-4 USB device.
What’s the output of this command in dom0?
qvm-usb list sys-audio
Are you able to start sys-audio manually after the Qubes OS start?
Try to autostart sys-audio without sys-usb:2-4.
Detach sys-usb:2-4 USB device from sys-audio and leave sys-usb:2-5.3 attached, then change the guest_usb_dev1_id="sys-usb:2-4" to guest_usb_dev1_id="sys-usb:2-5.3" in the script and reboot Qubes OS.
The output of that command Did show both USB devices 2–4 and 2-5.3 Before I detached 2–4.
After detaching 2–4 I tried changing dev usb id 1 to 2-5.3. So then I had two entries for 2–5.3 But now sys-usb won’t start.
I thought maybe you meant to invert the two so I tried switching that the 2-4 entry to the second dev usb is and 2–5.3 to the first dev usb I’d but sys-usb wouldn’t load. So I need to enter cubes period skip underscore auto start in the boot grub menu. And then try and reattach 2–4 I get the error message
I want to confirm that these devices are only attached to sys-audio and not to some other autostarting qube as well.
I meant like this:
#!/bin/bash
guest_name="$1"
libvirt_operation="$2"
timeout=60
guest_to_start_on_usb=sys-audio
guest_usb_dev1_id="sys-usb:2-5.3"
guest_usb_dev2_id="sys-usb:2-5.3"
if [ "$guest_name" = "sys-usb" ] && [ "$libvirt_operation" = "started" ]; then
(
exec 0</dev/null
exec 1>/dev/null
exec 2>/dev/null
for i in $(seq 1 $timeout);
do
if qvm-ls --running $guest_name | grep -q Running; then
usb_list=$(qvm-usb list -q $guest_to_start_on_usb | awk '{ print $1 }')
if echo "$usb_list" | grep -Fxq "$guest_usb_dev1_id" && echo "$usb_list" | grep -Fxq "$guest_usb_dev2_id"; then
qvm-start --skip-if-running -q $guest_to_start_on_usb
break
fi
fi
sleep 1
done
) & disown
fi
Detaching USB device from sys-audio or editing the script shouldn’t have affected sys-usb start.
Can you once again edit the script to be the one in this post, detach sys-usb:2-4 from sys-audio, make sure that it’s detached in qvm-usb list and then reboot. If something fails to start then provife the dom0 journalctl log.