Audio dropouts and stutter

It was i915 driver problem.
For that either disabling composition or different driver.

What audio driver are you using?

I have not installed any additional drivers. Simply using whatever Fedora provides (all sys-qubes and dom0 are Fedora)

You might try kernel-testing in sys-usb.
Did you upgraded to fedora 42?

Yes, I have migrated to Fedora 42 some time back.

@Atrate I tried to increase the scheduling priority for the qube playing audio, but unfortunately even after changing the grub parameters I am getting this:

image

Do you know what is missing? I executed “xl list” to get the correct domain id, but it does not work.

By the way, again, after reboot, the issue is gone :slight_smile:

The default scheduling algorithm in Qubes is now credit2. The command you’re looking for will be:

sudo xl sched-credit2 -d DOMAIN_NAME -w 512

PS: I’ve made a script that automatically sets weights for VMs when they’re launched, if there’s interest I can publish it along with my other utils.

Ok, thanks! Will try tomorrow then when issue reappears :slight_smile:

Hi all,

based on all the comments here I have implemented my own version of CPU pinning and am evaluating now if it helps. As you can see in this screenshot

sys-usb and personal are pinned to the performance cores of my processor (https://www.intel.de/content/www/de/de/products/sku/236847/intel-core-ultra-7-processor-155h-24m-cache-up-to-4-80-ghz/specifications.html). My understanding of this whole CPU pinning ist still limited, here are a few questions I have, maybe somebody can answer:

  • why does the list only show “even” processors being pinned? Is it because all of them have 2 cores?
  • why does Domain-0 in my case have all the cores pinned to it? I was assuming this is limited to 4?
  • what is the difference between hard/soft affinity?
  • why do I see a CPU index of 21? My processor has 16 cores only, not 21
  • what are these “-dm” domains? Does it make sense to pin them also?

@Atrate

I initially wanted to use your script but I realized that it does not work with the default dom0 installation (not sure what i3 is though… :)). Therefore I followed the approach to implement a “while” loop in bash that runs every half a second (sleep 0.5) and extracts the current vm from these calls:

Maybe it helps to make your script work for the default dom0 configuration.

I will report back if the audio problem occurs again of if it gets solved with the CPU pinning. In case it is not there are few other hints in the comments above, will try those also if required.

Thanks all for reading/commenting here!

A lot of your questions about affinity be answered by: https://wiki.xenproject.org/wiki/Tuning_Xen_for_Performance

As for the even CPUs and the 21 index it’s because of hyperthreading. The indices you see are assigned to threads. Qubes disables hyperthreading (SMT), so the cores that could be hyperthreaded will show up as 1 thread while skipping the other index (so your p-cores are “even” only).

About dm domains: https://wiki.xenproject.org/wiki/Device_Model_Stub_Domains . I haven’t checked what pinning/unpinning them does, but they should only show up for HVM domains or ones with PCI passthrough (one of those conditions, I don’t remember which).

I initially wanted to use your script but I realized that it does not work with the default dom0 installation (not sure what i3 is though… :)).

i3 is a tiling window manager, an alternative to Qubes’s default XFCE. Thanks for providing the snipped, but I’d like to find a way to implement this in XFCE without polling (every half second) but instead watching for events. If that’s not possible, it’s going to have to be polling, but I haven’t had time to research this.

@Atrate that was a quick answer, thanks!

Not sure I understand the statement “so your p-cores are “even””. Is the range I am pinning (0-5) wrong then? Should it be something like “0,2,4,6”?

Pinning a range works, the odd numbered cores are disabled so Xen won’t use them.

Ok, yes, but the question is, what is the range (in my processors case) to pin to ALL performance cores? Theoretically, if odd ones are skipped, it should be “0-10”? My CPU has 6 performance cores.

The correct range is 0-11 to have all P cores, you have 0, 2, 4, 6, 8, 10 and their hyperthreading siblings 1, 3, 5, 7, 9, 11.

Without hyper threading (it’s disabled by default anyway), you could use 0-10 too with the same result.

Great, thank you, will adjust my logic then :slight_smile:

Not fully sure you’re correct about the 155H. From my research, the layout is weirder than that:

Oh, that is really weird… But thanks for the info, should be easy to map it though :slight_smile:

@Atrate I have asked for a possibility to listen to focus change events in xfce and the first link in this answer Any way to listen to events? / General discussion / Xfce Forums points to this:

xprop -spy -root -notype _NET_ACTIVE_WINDOW

It basically prints the property change which then in turns can be read, parsed and transformed to the current domain via

xprop -id "$WINDOW" -notype _QUBES_VMNAME

Maybe this is an option for you, without a loop and polling :slight_smile:

1 Like

@Talkabout

If you want to automatically set the credit2 scheduling for Qubes, I’ve just uploaded the script I use for that purpose.

@Atrate for your CPU pinning script, have you considered to add an option to pin to performance cores only when machine is ac powered? In case it is in battery mode it might not be expected to “waste” battery life by only using the “non-optimized” cores.
I will research today a little bit how this can be achieved and will report back.