Open Tatsh opened 1 year ago
And what if you set the audio synchronisation to timestretch? I mean I'm not sure why you expect the audio to be synced when forcefully turning off the synchronisation...
Just to note, I exited Easy Effects before running this.
Latency settings:
(Lots of crackling with above settings.)
With these settings, it is off by a single beat. The audio is running about 6 frames behind.
Can you do the same comparison with your PS2? does the game have latency adjustment?
This game unfortunately does not have adjustment. It's predecessor FreQuency also does not. Some games feature this, but most of them do not go far enough in terms of negative offset. And most of the time they do not show what the numbers on their adjustment scale actually mean.
I run my PS2 through RetroTINK 5x-Pro via SCART RGB and optical audio and I set my receiver to Direct audio mode for most music games (removes 7.1 emulation, runs stereo only, no/minimal processing). With this setup, the sync is not perfect but it's close enough to be usable. It's basically minimal lag given the circumstances of not using a CRT.
Would like to see PCSX2 do the same or better, plus it has graphics enhancements I can't do on my real PS2 or RetroTINK 5x-Pro. In the past, PCSX2 would have random speed changes that made the audio sync change while the game was running. But with recent versions PCSX2 audio seems stable, so the only thing needed is a fixed delay.
Just for comparisons sake, it would be nice to see/hear a recording from both so we can see exactly how different it is, cos obviously we're never going to get better than the PS2, and there will be some measure of delay since we can't do audio at the same time like the PS2 has, and as your configuration says, it will be about 40ms, which is about 2.5 frames worth of lag, and if you're already crackling, trying to lower that is going to be a problem.
Here is a video I recorded on my phone but it's stable although slightly sideways.
Based on my inputs vs the TV, it seems like my setup is off by about 3 frames at best, 6 frames at worse.
In the previous post I said it was 6 frames behind in PCSX2 but I meant to say 12 (~400 ms). If you set this video to play with a -400 ms audio delay in mpv or similar, it will be the same as the PCSX2 video.
Edit: Use yt-dlp if you want to see the 4K version of the video. At least for me it won't give me the option in my browser.
What does the log report the minimum latency as? This might be unique to Linux.
$ rg laten
emuLog.txt
130:(Cubeb) Minimum latency: 25.00 ms (1200 audio frames)
131:(Cubeb) Minimum latency is above requested latency: 1200 vs 960, adjusting to compensate.
1184:(Cubeb) Minimum latency: 25.00 ms (1200 audio frames)
1185:(Cubeb) Minimum latency is above requested latency: 1200 vs 960, adjusting to compensate.
Might be game specific then.
Edit: I guess one way to determine that is to remove the output from the equation. Create a video capture within PCSX2 (not with an external tool), enabling both video and audio capture. See if it's out of sync there.
The recorded video from PCSX2 is close enough to synced.
Interesting. I guess it's getting delayed somewhere in the output then.
None synchronization definitely will cause issues, and once it lags behind, never catches up. But timestretch should stick to the target latency.
Maybe it's happening somewhere else in the pipeline. Need to get someone to check Windows and see if it manifests there.
Seems fine on Ubuntu 23.04 from what I can tell (using default audio settings). I'm not great at discerning input/audio lag, but there's definitely no multi-hundred-millisecond delay.
I can try this out on my other machine to see what happens.
I tried this on another machine with a near-identical setup (Gentoo, same build) and the audio syncing was still about the same. I did the test with the laptop's built-in speakers and left settings to default. The system has maximum refresh rate of 60 so now I know I cannot blame the 144 Hz display on my other system.
Also tried the Flatpak build and got similar results.
Seems fine on Ubuntu 23.04 from what I can tell (using default audio settings). I'm not great at discerning input/audio lag, but there's definitely no multi-hundred-millisecond delay.
I would imagine you're seeing the same result as me with my second machine, where it's closer but still not right.
Can this be checked on latest nightly ?
I have nightly v1.7.5214. Is that recent enough?
On v1.7.5214 I am still getting the same issue as described above.
Wonder if it's something funky with the Pulse wrapper. I've seen all kinds of strange audio behaviour when using pulse with VMWare.
If I have time/remember, might see about adding a pipewire API to cubeb. Have to do this ourselves, because cubeb has gone down the meme language path for any new backends, which makes it unusable for us.
Edit: I guess that's something you can try - switch the backend from pulse to alsa in settings.
Video is playing too ahead of the sound is the main issue. If there was a way to delay the video that would be amazing.
I reset all settings and set the output backend to ALSA. I also used a wired controller and wired headphones to eliminate all sources of lag as much as possible.
It's very close but just not right.
Edit: Of course with the above latency settings there is a lot of clipping.
Set it to timestretch. "None" synchronization should never be used, because any speed fluctuation is going to add extra delay in the buffer, and it makes no attempt to reduce it once the delay gets added.
as of v1.7.5380 , seems fine here with defaults
@Tatsh can this be rechecked
Tested 1.7.5835 and it's the same. Using defaults besides upping graphics quality. Software mode also acts the same.
I also tried without Bluetooth and this definitely brings the timing closer but it's still not close enough. The difference is about -0.12 seconds, meaning the audio is behind by this much.
Reference video recorded with PCSX2:
https://github.com/PCSX2/pcsx2/assets/724848/d71bd39c-9ed5-4311-8de2-807d06df0c55
To see the correct output, play this in mpv or VLC with the delay set to -0.12
(mpv: --audio-delay=-0.12
). You will hear a metronome ticking in the background and when the correct audio delay is applied, the circle indicators will align near-perfectly with the targets.
Perhaps a cheat/patch can fix the timing but I don't know enough about that subject.
Describe the Bug
Audio is off by about -250 ms, meaning the audio is playing slightly before the corresponding video.
I tried to change settings a bit but nothing has really changed the behaviour.
Reproduction Steps
Expected Behavior
Game should be in sync, or there should be a better way to fix this since there is no in-game option to fix synchronisation.
As far as I can tell, there is currently no simple way to tell the video to delay by some amount, or to tell the audio to jump ahead. Or vice versa.
PCSX2 Revision
1.7.4624
Operating System
Linux (64bit) - Specify distro below
If Linux - Specify Distro
Gentoo
CPU
i9-11900K
GPU
RTX 3080 Ti
GS Settings
No response
Emulation Settings
No response
GS Window Screenshots
If you play the video with an audio delay of -250ms, this is how it should look when playing.
Logs & Dumps
No response