HQ USB audio random noisy clicks & pops

Hi,
Despite obviously FreeBSD audio stack being top-notch, I'm unable to get rid of small random clicks & pops caused by the kernel which are quite annoying. I can rule out HW issues because other OSes don't do that.

HW/SW stack I use:
  • FreeBSD 14.1-RELEASE-p4
  • Intel Xeon based Lenovo P1, 64 GB RAM
  • USB audio Topping DX3 Pro+, 32 bit, 44.1/48 kHZ mode
When I play some high quality streams (e.g. flacs or decent mp3s) I occasionally hear random pops & clicks which do not come from the audio bitstream itself.
The simplest way how to reproduce that is to get a terminal (no Xorg), run e.g. mpv <audio file> (OSS output) on some terminal and then change to the other terminal via Alt-<num>. This action very often generates the same type of clicks & pops I also experience when doing normal work (logged into X, coding, browser etc.). I have quite decent headphones so I'm able to hear majority of them without any issue.

I already experimented with scheduler tweaks, giving audio players lower nice values or even putting them into real-time area. No change, clicks & pops still there. Also hw.snd.latency has no perceivable effect on this issue. Also /dev/sndstat report does not show any issues at all.

Any ideas, please?

Code:
jb@p1 ~> sysctl hw.snd
hw.snd.maxautovchans: 16
hw.snd.default_unit: 3
hw.snd.version: 2009061500/amd64
hw.snd.default_auto: 0
hw.snd.verbose: 3
hw.snd.vpc_mixer_bypass: 1
hw.snd.feeder_rate_quality: 4
hw.snd.feeder_rate_round: 25
hw.snd.feeder_rate_max: 2016000
hw.snd.feeder_rate_min: 1
hw.snd.feeder_rate_polyphase_max: 183040
hw.snd.feeder_rate_presets: 100:8:0.85 100:36:0.92 100:164:0.97
hw.snd.feeder_eq_exact_rate: 0
hw.snd.feeder_eq_presets: PEQ:16000,0.2500,62,0.2500:-9,9,1.0:44100,48000,88200,96000,176400,192000
hw.snd.basename_clone: 1
hw.snd.compat_linux_mmap: 0
hw.snd.syncdelay: -1
hw.snd.usefrags: 0
hw.snd.vpc_reset: 0
hw.snd.vpc_0db: 45
hw.snd.vpc_autoreset: 1
hw.snd.timeout: 5
hw.snd.latency_profile: 1
hw.snd.latency: 7
hw.snd.report_soft_matrix: 1
hw.snd.report_soft_formats: 1

Code:
jb@p1 ~> sysctl dev.pcm.3
dev.pcm.3.feedback_rate: 47999
dev.pcm.3.mixer.mute_1.desc:
dev.pcm.3.mixer.mute_1.max: 1
dev.pcm.3.mixer.mute_1.min: 0
dev.pcm.3.mixer.mute_1.val: 0
dev.pcm.3.mixer.vol_0.desc:
dev.pcm.3.mixer.vol_0.max: 0
dev.pcm.3.mixer.vol_0.min: -32512
dev.pcm.3.mixer.vol_0.val: 0
dev.pcm.3.mode: 3
dev.pcm.3.bitperfect: 0
dev.pcm.3.buffersize: 0
dev.pcm.3.play.vchanformat: s32le:2.0
dev.pcm.3.play.vchanrate: 48000
dev.pcm.3.play.vchanmode: fixed
dev.pcm.3.play.vchans: 1
dev.pcm.3.hwvol_mixer: vol
dev.pcm.3.hwvol_step: 5
dev.pcm.3.%parent: uaudio0
dev.pcm.3.%pnpinfo:
dev.pcm.3.%location:
dev.pcm.3.%driver: pcm
dev.pcm.3.%desc: Topping DX3 Pro+
 
hi mate

i had audio popping issues with chromium
the issue only happened with chromium with hardware acceleration enable

turns out i was missing gpu firmware and once i installed the missing package it fixed the issue

Code:
sudo pkg install gpu-firmware-intel-kmod-kabylake

have a look at your dmesg output and see if you have any errors for the gpu

Code:
sudo dmesg > dmesg
 
have a look at your dmesg output and see if you have any errors for the gpu

Code:
sudo dmesg > dmesg
Interesting, unfortunately - (am I really saying that? :-) ), no GPU related errors are present at all. This machine has a dedicated NVIDIA GPU which after some love works perfectly with nvidia-drm-kmod. Everything related to GPU seems to be settled and pops are there regardless Xorg running or not.
 
i have a dell xps 15 2019 with and nvidia gpu

you could compare your config to mine and see if anything stands out

heres my root config files


directory structure of my root config

 
Sometimes noises come from internal buses. From your mixer (mixer, mixertui, ...) try to set "igain" to zero (if you have this slot), or any audio input to zero. I fix this issue on my laptop with this small trick.
 
Sometimes noises come from internal buses. From your mixer (mixer, mixertui, ...) try to set "igain" to zero (if you have this slot), or any audio input to zero. I fix this issue on my laptop with this small trick.
All I see is:
Code:
$ mixer
pcm3:mixer: <Topping DX3 Pro+> on uaudio0 (play) (default)
    vol       = 1.00:1.00     pbk
    pcm       = 1.00:1.00     pbk

And it's a USB DAC, so not much else to play with... What I really don't understand is, why e.g. changing terminals causes this clicks/pops/stutters.
 
Did you try setting a higher value for hw.usb.uaudio.buffer_ms (see snd_uaudio(4))?

Also try with dev.pcm.3.bitperfect = 1 and dev.pcm.3.play.vchans = 0.

Run # service mixer restart after changing setup before testing.
The only missing point was having vchans > 0, thanks. Before, I increased buffer_ms to 8 ms as this is the greatest supported value on my system.
But in the end, I guess that bitperfect = 1 did the trick. I've been using that for a couple of days and I cannot hear those distortions anymore. Still interesting though, why the clicks were there before despite /dev/sndstat did not show any buffer issues.
 
...anyway, it still amazes me how good the FreeBSD audio stack is. Incomparable. Love it. :)
 
Back
Top