Page MenuHomeFreeBSD

snd_hdspe(4): Per device sysctl for period.
ClosedPublic

Authored by dev_submerge.ch on Jan 20 2024, 7:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 19, 7:52 PM
Unknown Object (File)
Mon, May 13, 6:25 AM
Unknown Object (File)
Mon, May 13, 3:10 AM
Unknown Object (File)
Thu, May 9, 9:32 AM
Unknown Object (File)
Thu, May 9, 12:34 AM
Unknown Object (File)
Apr 19 2024, 1:50 AM
Unknown Object (File)
Apr 5 2024, 8:31 PM
Unknown Object (File)
Mar 16 2024, 2:32 PM
Subscribers

Details

Summary

Let the user choose a period (interrupt cadence in samples), in the
official RME drivers this setting is available as "Buffer Size".
Override the period propagated through blocksize by pcm channel latency
settings (see sound(4)), since these are unreliable and differ between
playback and recording channels.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

@br I changed the default period from 128 to 256, compared to the port version of snd_hdspe_alt. That should be closer to the playback blocksize given by the pcm latency settings by default. Could you please test this in your HDSPe AIO setup and make sure the system defaults (vchanformat=s16le:2.0, vchanrate=48000, latency=2, latency_profile=1) work fine?

In extreme settings this sysctl can produce gaps and stuttering, e.g. a period of 4096 and playing 48kHz 16bit audio with vchan conversion to 96kHz 32bit. But for typical settings I want it to work by default.

Seems to work. I hear gaps and stuttering when I force period to 4096. On default (32 to 256) it works very well, even up to 2048.

Could you commit it if there are no other issues? Thank you!

The stuttering with 4096 period seems to come from vchan conversion, it's neither present in bitperfect mode nor when the playback format and vchan settings match the device (no conversion). Setting a lower hw.snd.latency may also help. But 4096 is an extreme setting, there's a warning in the man page for that reason.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 28 2024, 8:23 PM
This revision was automatically updated to reflect the committed changes.