Bug 228298 - 48khz sound stuttering
Summary: 48khz sound stuttering
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.1-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-multimedia (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-16 16:01 UTC by SF
Modified: 2018-06-03 09:25 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SF 2018-05-16 16:01:29 UTC
I always recognised some very hard stuttering within some games using wine and i found out this is caused by the sound-implementation of freebsd.

To be specific:

48khz sample rate means no stuttering within grim dawn for e.x.
192khz sample rate means very hard stuttering within grim dawn for e.x.

I wasn't able to test this on all games yet but i assume its alot more games or even all games being affected by it.
Comment 1 SF 2018-05-16 17:02:09 UTC
Changing kernel-behaviour to always choose the last cpu/thread for soundprocessing should solve this.
Comment 2 Jan Beich freebsd_committer freebsd_triage 2018-05-16 18:12:46 UTC
Does the issue affect only Wine? Can you attach .wav sample?

Try a different audio backend instead e.g., ALSA or PulseAudio. Maybe Wine developers don't test OSS backend enough (if at all).

Try changing buffering latency i.e., hw.snd.latency and hw.snd.latency_profile.

(In reply to SF from comment #1)
> Changing kernel-behaviour to always choose the last
> cpu/thread for soundprocessing should solve this.

Do you mean pthread_setaffinity_np(3)? It's up to an application or the sound daemon.
Comment 3 SF 2018-05-16 18:22:39 UTC
dev.pcm.0.play.vchanrate=192000

This affects performance within games very much, but as far as i know it should affect any program on freebsd because the processing is done on cpu1. This should be switched to the last cpu. I recognised some interactions of this several times, putting this on cpu1 is not good.

If oss is the default sound-implementation then this should be changed.
Comment 4 Gerald Pfeifer freebsd_committer freebsd_triage 2018-05-27 22:01:25 UTC
I'm afraid I cannot contribute to this.
Comment 5 David Naylor freebsd_committer freebsd_triage 2018-06-02 16:29:43 UTC
I'm not sure how to test this, but I changed all my PCM devices to 192k (e.g. dev.pcm.0.play.vchanrate=192000) and didn't encounter any sound issues with either Wine or VLC.  

If this is the correct way of testing then perhaps something else is the problem besides Wine?