Severe sound lag in wine #233

Closed
opened 2020-12-15 21:35:04 -06:00 by 65a · 6 comments
65a commented 2020-12-15 21:35:04 -06:00 (Migrated from github.com)

I'm using the latest wine from git.
I'm using the latest faudio from git locally, with gstreamer/libav support enabled.

Running skyrim with xaudio2_6 and xaudio2_7, the game runs as expected
Running skyrim with faudio (built-in), audio effects are delayed by 1-5 seconds

In both cases, audio quality is exceptional. The only problem I am seeing is an exceptional audio delay.

I can capture WINEDEBUG logs for this, but they are quite noisy. They do look substantially different between the versions.

I'm using the latest wine from git. I'm using the latest faudio from git locally, with gstreamer/libav support enabled. Running skyrim with xaudio2_6 and xaudio2_7, the game runs as expected Running skyrim with faudio (built-in), audio effects are delayed by 1-5 seconds In both cases, audio quality is exceptional. The only problem I am seeing is an exceptional audio delay. I can capture WINEDEBUG logs for this, but they are quite noisy. They do look substantially different between the versions.
flibitijibibo commented 2020-12-16 01:05:02 -06:00 (Migrated from github.com)

You're most likely looking at something involving PULSE_LATENCY_MSEC and SDL, not FAudio itself - we just write to the OS output buffer that SDL gives us, we don't dig any deeper than that.

You're most likely looking at something involving PULSE_LATENCY_MSEC and SDL, not FAudio itself - we just write to the OS output buffer that SDL gives us, we don't dig any deeper than that.
65a commented 2020-12-16 01:08:30 -06:00 (Migrated from github.com)

I tested with alsa and pulse backends, with and without pipewire. The problem follows only faudio/xaudio, not backend changes.

I tested with alsa and pulse backends, with and without pipewire. The problem follows only faudio/xaudio, not backend changes.
65a commented 2020-12-16 01:13:41 -06:00 (Migrated from github.com)

My first thought was that this was buffer bloat in the audio framework, hence testing with multiple different ones.

I'll capture WINEDEBUG, the output is quite different between them. The audio quality is perfect, just delayed with faudio. I'd prefer to use faudio for several reasons.

My first thought was that this was buffer bloat in the audio framework, hence testing with multiple different ones. I'll capture WINEDEBUG, the output is quite different between them. The audio quality is perfect, just delayed with faudio. I'd prefer to use faudio for several reasons.
flibitijibibo commented 2020-12-16 01:21:09 -06:00 (Migrated from github.com)

You will want to check with SDL separately then - we're nothing more than a sample mixer, so any delay of any kind is always, at minimum, one level below us.

You will want to check with SDL separately then - we're nothing more than a sample mixer, so any delay of any kind is _always, at minimum_, one level below us.
65a commented 2020-12-16 01:54:55 -06:00 (Migrated from github.com)

Glad to dig more. I'm not sure if sound is actually globally delayed, which is complicated by that particular game using multiple audio systems. Some audio effects require libav decoding, not sure if the delayed ones are going in that path, which is probably another opportunity for shenanigans. Interestingly there is no delay in effects until actually playing the game using FAudio, which also makes me suspicious of multiple sound sources interacting poorly somewhere.

Glad to dig more. I'm not sure if sound is actually globally delayed, which is complicated by that particular game using multiple audio systems. Some audio effects require libav decoding, not sure if the delayed ones are going in that path, which is probably another opportunity for shenanigans. Interestingly there is no delay in effects until actually playing the game using FAudio, which also makes me suspicious of multiple sound sources interacting poorly somewhere.
flibitijibibo commented 2021-04-20 09:26:56 -05:00 (Migrated from github.com)

Doing a bit of spring cleaning...

This should be filed as an SDL bug if it's still an issue, but I would strongly recommend looking at Pipewire - even for working setups I noticed reduced latency just from using Pipewire's Pulse layer, I imagine the direct Pipewire driver in SDL 2.0.16 will be really good too. Either way, closing as NOTOURBUG.

Doing a bit of spring cleaning... This should be filed as an SDL bug if it's still an issue, but I would strongly recommend looking at Pipewire - even for working setups I noticed reduced latency just from using Pipewire's Pulse layer, I imagine the direct Pipewire driver in SDL 2.0.16 will be really good too. Either way, closing as NOTOURBUG.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-FNA-XNA/FAudio#233
No description provided.