On Thu, Mar 06, 2025 at 10:48:06AM +0100, Andrath of the Abyss wrote:
> Hello,
> 
> I was wondering if people with USB audio interfaces have the same issue
> as me. When using the microphone of my usb audio interface, the recorded
> audio starts to stutter/pop, indicating buffering problems, usually when
> I do something that causes a bit of load on the system (e.g. starting a
> browser). A good example of this happening is here:
> 
> https://youtu.be/Vbi5f1SlXZw?si=5pjaMI4aAf6Luewx&t=380 (at the 6:20
> mark, the link should take you there)
> 

This may be a uaudio(4) bug. Try to record audio during few hours with
"aucat -o" on an idle system and see if sndiod blows (remember to
disable nightly cron jobs if you test during the night).

The sound reminds the sound of usb ring buffer overruns. This often
happens when the system runs long kernel code-paths that prevent the
usb drivers from making progress timely.

I've noticed that putting the uaudio device on the root hub helps, but
this is system dependent.

Disabling kernel features that you don't need during recording also
helps (ex. access point scans if you use wired network, power-saving
features, glx if you don't need 3d rendering, unused programs that
allocate/free big amounts of memory and so on).

> This also happens while videoconferencing with platforms like Teams and
> Jitsi meet. The remote end claims I sound like a 'robot'. Reloading the
> page and/or restarting sndiod (and then reloading the page because
> browsers generally don't appreciate audio being pulled away from under
> them) alleviates the issue temporarily.
> 
> Oh this happens on both stable (7.6) and -current. Also updated to the
> latest snapshot which shows the same behaviour.
> 
> For reference:
> 
> uaudio0 at uhub2 port 1 configuration 1 interface 1 "MOTU M4" rev 2.00/1.01 
> addr 2
> uaudio0: class v2, high-speed, sync, channels: 4 play, 4 rec, 0 ctls
> audio0 at uaudio0
> uaudio1 at uhub8 port 1 configuration 1 interface 4 "Logitech Logitech BRIO" 
> rev 3.10/3.17 addr 7
> uaudio1: class v1, high-speed, sync, channels: 0 play, 2 rec, 2 ctls
> audio1 at uaudio1
> 
> This happens with the MOTU and the Logitech BRIO webcam (which works
> fine, I use it in above video)
> 
> I've already messed with the sndiod flags, currently set at:
> 
> sndiod_flags=-s default -m play,mon -s mon -r 48000 -b 24000
> 
> Which should give a buffer of 500ms (according to the OpenBSD multimedia
> page)
> 

The USB controller has its own buffers, that's why increasing the
audio(4) buffer doesn't improve usb-specific problems.

FWIW, "-z 480 -b 960" is supposed to work on a modern system.

> Throwing larger buffers at it does not seem to alleviate the issue.
> Needless to say, this makes creating videos and videoconferencing
> somewhat unfeasable.
> 
> Playback is absolutely fine however.

Surprising. Do voice-only calls work better?

Could you post a complete dmesg to show the paths of usb devices to
the host controllers?

Reply via email to