Windows VM Audio Crackling

QEMU only supports 48KHz or it has to resample, and a maximum of 65535Hz (or, 65.5KHz) due to it’s design, so you’re best to just go with 48KHz

If you are getting “random noise” at > 48KHz you have a broken sound card or bad drivers. Coming from an electronics engineering background, increasing the sample rate can not induce “random nose”, all increasing the sample rate does is allow you to sample higher frequency audio that is outside of the human hearing range and only makes sense if you’re doing professional audio work (aka, mastering).

Humans average range is 20 Hz to 20 kHz, in order to faithfully reproduce 20kHz we need to sample at a minimum 2x that, at 40kHz (see: Nyquist frequency - Wikipedia). Some people can hear slightly higher frequencies so we sample at 44.1kHz to give some headroom and a few other technical reasons (see: 44,100 Hz - Wikipedia).

In short, if you can hear “random noise” when you sample at higher rates, then you have faulty hardware as any additional noise being captured should be outside of the range of human hearing.

An extra tidbit of information, 48kHz is the industry professional audio standard, not 192kHz as people would have you believe.

2021-10-01-230051_610x89_scrot
https://www.aes.org/publications/standards/search.cfm?docID=14

Yeah, I am unfortunately one of those people. Sometimes this becomes highly annoying because people’s homes and the offices are hella noisy to me. At other times it is funny since my reaction to those noises is the same as a dog to a dog whistle; flip a switch or plug in a power brick and my head tilts to the side.

By slightly higher I mean 21-22Khz, it’s literally only a tiny amount, not enough to warrant > 48KHz sample rates.

Yeah, those higher frequencies can be ear splitting and painful. I only can recall hearing something like that in music a few times.

During the time that schools were banning cell phones in schools, some of the kids that I tutored would use the high frequency tones as alerts to let them know that they got a message so that they could secretly check their phones. The kids were surprised that I could hear that; “Olds” are not supposed to hear that range.

Sorry for getting off topic.

depends what your recording mate.
if i record my guitar from the katana amp via usb, i will get electrical noise from the single coils pickups if im anywhere near the amp or pc.
the humbuckers while not as bad still introduce high frequency noise that disappears if i use 48000.

but im not an electrical engineer so im just going of what ive found as a user. :slight_smile:

No, depends on the quality of your device and its noise rejection. If it’s picking up noise because its sample rate has been increased your device is either faulty or poorly designed. In either case, I would toss it and get something that doesn’t have such a bad flaw. There is no excuse for a DAC designed for low frequency (audio) to pickup noise just because you increased the sample rate > 48KHz. You’re literaly just hiding the problem by dropping it back to 48KHz somewhat, in your own words “not as bad”… aka, you still have an issue.

ok. not gonna start arguing with some one who knows more about my kit than i do…
so im out coz this aint helping the guy.

I couldn’t find anything in that reddit post that seemed to work. I’m a bit new with this, and completely new to pipewire and jack. I tried to follow this arch wiki article and got no luck. I could get pipewire.service and pipwire-media-session.service going. But I can’t seem to get pipewire-pulse.service started. It gives this output.

systemctl --user start pipewire-pulse.service                                                      
Failed to start pipewire-pulse.service: Unit pipewire-pulse.service not found.

I was also unable to really find out how to exactly configure this section of the audio in xml for my system.

    <audio id="1" type="jack">
      <input clientName="vm-win10" connectPorts="your-input"/>
      <output clientName="vm-win10" connectPorts="your-output"/>
    </audio>

The Arch Wiki mentioned I should use Carla to find the inputs and outputs but I can’t seem to figure out how.
Update: When trying to install pipewire-pulse it appears to want to replace pulseaudio but almost every major application in my system requires pulseaudio. Is there some way I can get past this without uninstalling all of these applications?

sudo pacman -S pipewire-pulse                                                                      
resolving dependencies...
looking for conflicting packages...
:: pipewire-pulse and pulseaudio are in conflict. Remove pulseaudio? [y/N] y
:: pipewire-pulse and pulseaudio-bluetooth are in conflict. Remove pulseaudio-bluetooth? [y/N] y
error: failed to prepare transaction (could not satisfy dependencies)
:: removing pulseaudio breaks dependency 'pulseaudio=15.0-1' required by pulseaudio-equalizer
:: removing pulseaudio breaks dependency 'pulseaudio=15.0-1' required by pulseaudio-jack
:: removing pulseaudio breaks dependency 'pulseaudio=15.0-1' required by pulseaudio-lirc
:: removing pulseaudio breaks dependency 'pulseaudio=15.0-1' required by pulseaudio-rtp
:: removing pulseaudio breaks dependency 'pulseaudio=15.0-1' required by pulseaudio-zeroconf
sudo pacman -R pulseaudio                                                                  
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing pulseaudio breaks dependency 'pulseaudio' required by gnome-settings-daemon
:: removing pulseaudio breaks dependency 'pulseaudio' required by manjaro-pulse
:: removing pulseaudio breaks dependency 'pulseaudio' required by plasma-pa
:: removing pulseaudio breaks dependency 'pulseaudio' required by pulseaudio-alsa
:: removing pulseaudio breaks dependency 'pulseaudio=15.0-1' required by pulseaudio-bluetooth
:: removing pulseaudio breaks dependency 'pulseaudio' required by pulseaudio-ctl
:: removing pulseaudio breaks dependency 'pulseaudio=15.0-1' required by pulseaudio-equalizer
:: removing pulseaudio breaks dependency 'pulseaudio=15.0-1' required by pulseaudio-jack
:: removing pulseaudio breaks dependency 'pulseaudio=15.0-1' required by pulseaudio-lirc
:: removing pulseaudio breaks dependency 'pulseaudio=15.0-1' required by pulseaudio-rtp
:: removing pulseaudio breaks dependency 'pulseaudio=15.0-1' required by pulseaudio-zeroconf

Pipewire-pulse should be a drop in replacement for pulseaudio. Don’t remove pulse audio though as it may be a soft dependency for some items that directly call it out. pipewire-pulse should detect pulseaudio and take over those sockets.

I don’t use pipewire on my system as of yet though so I am not an expert. I do run an ArchLinux install as well as a Debian install.

Could I just install Pipewire-pulse and tell it to ignore the dependencies? Or would this break my system especially from pipewire-pulse taking over the sockets like you mentioned?

Looks like there’s a package to replace pulseaudio called manjaro-pipewire available from the Manjaro package manager.
Try installing that instead.

This is how I have it configured in the libvirt xml

<sound model='ich9'>
  <codec type='micro'/>
  <audio id='1'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
</sound>
<audio id='1' type='pulseaudio' serverName='/run/user/1000/pulse/native'>
  <input mixingEngine='no'/>
  <output mixingEngine='no'/>
</audio>

I don’t use Manjaro so not sure if it “just works” or if you’ll have to configure pipewire to get sound working.

1 Like

Ah. That is interesting, on ArchLinux, there is no such package. I wonder why the Manjaro maintainers added this. I assume there is some benefit to this. I goofed and thought that we were using straight up ArchLinux. Unfortunately, they have nothing up on the Manjaro Wiki about Pipewire.

@T_Robertson852 Since Manjaro is a more new user accessible spin of ArchLinux, there may be some deviations from the ArchWiki with custom packaging. I would highly recommend reading through any instructions that you find on the ArchWiki and then ensuring that all the pieces are there in Manjaro and ensuring that there is no “Manjaro Way” to do something before committing. This is a common issue with derivative spins of a parent GNU/Linux distro.

I will try this, but I think I am going to first try it in a vm. Just to see what happens. I was thinking of going to the manjaro forums for this? They might have more distro specific information about using pipewire and jack in this way.

I’d suggest sticking with something more mainstream like Arch which has excellent documentation, or if you want something simpler, use Debian.

Manjaro is a fork of Arch which messes with tons of things, and those maintaining it do not really have a good handle on what they are pushing out to people (ie, they included my buggy, not ready for release, insecure, potentially hardware destroying kernel patch into their “secure” official kernel build).

3 Likes

I second this. I main Debian and use ArchLinux for bleeding edge gaming support.

Going with a fork or a niche distro is not a bad thing, but any distro created to shield you from the Linux-ness of GNU/Linux, there is always a disconnect and eventually, not knowing how to Linux will bite you. Once you master basic system administration tasks, then using a fork or a niche OS is pretty much okay.

1 Like

I have just recently decided to try Arch and have been doing installs on a laptop I use. I can admit there is a lot that I have missed out on learning.

No worries, that is what the forvm is here for, To level up your knowledge. In my 20 plus years of using Unix-like OSes, the common pitfall that I see is new users using a derivative distribution or niche distribution because of a few killer features made easy, but the rest of the system is not easily accessible or or deviates far from the norm. When a problem arises, and no one can really help and or the maintainers take a “you break it you buy it” mentality, those people then write off unix like distros as a whole.

I have not used manjaro but I have assisted a lot of people fix their issues and I always revert back to ArchWiki and doing things the ArchLinux way because they are the parent distro. A lot of it translates back and forth but there are some packaging differences and ideological differences that separates Manjaro from Arch enough where you get stuck with Manjaro only issues from time to time.

It is a strange balance. On one hand I don’t have to spend as much time configuring and maintaining on Manjaro. But with Arch I definitely get more functionality, and consistency. Like with a hardened kernel which I am really enjoying, I can’t seem to find a hardened kernel or a zen kernel in Manjaro. I guess long term Arch is preferable.

1 Like