How to improve audio quality in HVM?

Hi, I’m struggling with poor audio quality in a HVM appvm.

I need to run a HVM appvm with web video conferencing (reasons are mostly irrelevant - it needs to be in Ubuntu LTS and a couple more requirements, so can’t be a regular appvm I think).

I’ve managed to attach a good USB webcam (Logitech BRIO), and get the video/audio working by doing

qvm-features <vm-name> stubdom-qrexec 1
qvm-features <vm-name> audio-model ich6

but the audio quality is … not great. There seems to be a lot of cracking and noise in general. Per some suggestions I found on this forum I did:

qvm-features <vm-name> timer-period 1000
qvm-features <vm-name> out.latency 10000
qvm-features <vm-name> out.buffer-length 4000

and I think it helped a bit, but the quality is still noticeably worse than when using the webcam directly.

Does anyone have some other suggestions what to try? I did try poking at the various qvm-features values (e.g. different audio-model values), but I haven’t noticed any obvious change.

I’m on Qubes 4.2, btw.

Have your tried attaching the whole usb hub controller as a pci device to your HVM? Maybe that helps.

At multiple occasions i experienced bandwidth issues with USB on pretty good hardware. You are using a 4K Webcam, maybe that’s just too much for the qubes usb piping?

I have not tried assigning the whole usb hub (or rather controller), because I only have one, AFAIK. On the desktop workstation that might be solvable by adding a second one (as an extra card), but on my laptop that’s not an option.

I’ll try reducing the webcam resolution. I don’t think the resolution was very high when I was messing with this, but I haven’t paid much attention to that so I don’t really know.

Sadly this is an ongoing issue

I’m sure the qubes team knows about the problem by now:

There seems to be no way around this

Unfortunately I require 1 windows app for work that only runs on windows and requires audio input. I tried installing the app on Linux using Wine (an option for you?) but that didn’t work. So I’ve been through tons of troubleshooting with this same problem, as I also only have one USB pci. My final and only acceptable solution was to pass the internal microphone through to the Windows HVM which comes with a lot of background noise from the laptop fan and keyboard typing and such. I then install an app called SteelSeries gg using the built in Sonar noise suppression part of the app. It makes a VM wide audio input background noise suppression. The apps free and pretty simple to set up.
But if you don’t have an internal mic I’ve got no solutions for you.

I also considered the idea of virtual wifi mic with things like wo-mic, sound wire, pulseaudio network streaming, etc. Run the mic in a appvm and pass it through virtually to the HVM. But I didn’t really attempt this too seriously. I think it might work though.

Edit: I see your using an Ubuntu HVM not windows. So my Wine suggestion is probably worthless but maybe it’s a shot if there’s a windows version of your app.

I can’t do this using Wine - without going into details, I’m 100% sure that’s not feasible / possible. I believe HVM is the only way forward - it might be Ubuntu or Windows VM. I prefer Ubuntu, which is why I tried that first. It seems a bit weird having to run an app to remove audi noise. However, why would that work only in Windows? Isn’t there a similar noise-reduction app for Linux?

I’m not sure I understand the internal vs. USB microphone think. I have two machines - a desktop workstation and a laptop. Obviously, I’d like to make this work on both, but the desktop obviously does not have an internal microphone. So that’s not gonna work :frowning:

Also, in an ideal case I’d like to use a (wireless) headset., and that clearly is not an internal microphone.

At least for me sys-usb handles USB mics and internal mics differently. For some reason USB mics constantly cut out and miss parts of the input. If you record a 1 minute clip using a USB mic the best I’ve been able to get was 58 seconds worth of capture and 2 seconds where the mic cut out.
However using an internal mic gets passed through on my laptop without a problem. It picks up 100% of the input. The problem is just since it’s a small mic inside your laptop, right next to your fan, and keyboard it tends to pick up a lot of background noise. But if your laptop is fanless and you use an external keyboard you might not need a background noise suppression app. Also a lot of video and voice calling apps already have noise suppression built in, for example zoom. That’s why I use it. If steelseries gg sonar isn’t available for Linux there are alternatives like noisetorch.
Finally as mentioned the only possible solution I personally have thought of (but not attempted) is to use something like pulseaudio network stream to take the audio input on a PV VM and then transmit that audio over the local network to the HVM as a remote mic. Something like this video I just found

I don’t use webcams but I’d certainly try all other available audio models, and different OS’s in HVM’s.

Are the developers aware that this is a problem and trying to work on this or is this the best it will be?

I believe they’re aware, but it’s not very high on the TODO list. Which is fine, I’m sure there’s plenty other more important stuff to work on.

I wish this were very high on the to do list. This makes Qubes much less usable as a daily driver.

It would be good if Qubes team let users know if they are working on this or if it not possible to change or and if faster processors and RAM change problem or if problem is a result of latency that cant not be reduced.

If you are conferencing via web browser, try Brave.