Page 1 of 1

[solved] waveform and audio out of sync

PostPosted: Thu Jan 12, 2023 3:39 am
by ashic.mahtab
I'm running Resolve Studio 18.1.2 Build 6 on Linux. After having issues on a project, I seem to have triangulated the problem with the waveform viewer / audio player. It appears that the audio player inside resolve is playing things *after* the point where the waveform shows it should.

For a minimal reproduction, I created a new project, and put mp3 and wav files into a media bin. Without any timelines or video or anything else added, I played the audio from within the bin. This shows the waveform and plays the audio. In the waveform, a beat starts where the red marker is, but it should start a bit earlier.
capture.png
waveform
capture.png (126.17 KiB) Viewed 2087 times


This seems to be consistent for me across various audio files.

I first noticed this when working on a project. I'd noticed that the waveform peaks happened a bit earlier (visually) than when sounds would play in the preview. After syncing the video clip cuts to the music, when I rendered it, I was surprised to see that in the final render, the audio happens according to what the waveform shows, rather than when the preview plays them. As such, if clips are aligned to music in the preview, in the final render, they're all over the place.

So, I think for whatever reason, the audio player inside my Resolve is playing audio with a bit of delay. This is not drift (i.e. it's even at the start of the audio files), and the final render seems to correspond to the waveform. I've tried mp3 files from youtube audio library, bensound, etc. These tend to be 44.1khz. I've tried converting them to wav, and also converting to wav with 48k. The same issue persists. The audio file used for the attached waveform is https://www.bensound.com/royalty-free-music/track/dreams-chill-out

I'm running on an AMD 5950X with a 3090 GPU and 64GB of ram and an NVME SSD.

Re: waveform and audio out of sync

PostPosted: Thu Jan 12, 2023 9:13 am
by Daz Wood
What's it like if you start a new project by first add video file with audio and let resolve set the video frame rate if it asks, then try adding an audio file?

Re: waveform and audio out of sync

PostPosted: Thu Jan 12, 2023 9:43 am
by ashic.mahtab
Hey Daz, it's the same. In fact, that's how I first found the problem. The timeline waveform was out of sync with the preview player. I then tried to play just from the media bin in an existing and new project. It appears that it's the preview audio player that's lagging as the final rendered output is in sync with the waveform.

Re: waveform and audio out of sync

PostPosted: Thu Jan 12, 2023 11:52 am
by ashic.mahtab
Update: I tried with Studio 17 and 18 on a Mac M1 Pro, and that does NOT have the audio player lag in respect to the waveform (using the exact same mp3 files). So it seems to be something related to either my desktop hardware or Linux.

Re: waveform and audio out of sync

PostPosted: Thu Jan 12, 2023 5:08 pm
by ashic.mahtab
I think I've figured out that it's to do with pipewire. I'm using pipewire-pulse and pipewire-alsa. Seems like there's a bug in there somewhere. Switching to pulseaudio-alsa gets rid of the lag, however, that doesn't work with my bluetooth headphones. I'm seeing references to pipewire and resolve, and that the latest versions should have fixed it... apparently not. But seems like that's the core issue at this point.

Re: waveform and audio out of sync

PostPosted: Fri Jan 13, 2023 10:33 am
by ashic.mahtab
I think I've managed to solve it. The issue is definitely with pipewire and alsa, and even though pipewire claims to have recently solved it, I'm seeing it on my system even with the latest versions. Maybe it's a regression. Anyhow, it appears installing pulseaudio-alsa fixed things for me. Note, while that does replace pipewire-alsa (on archlinux), it doesn't replace the whole of pipewire (which I need for LDAC connectivity to my Sony headphones). It seems to just be some config files. I managed to mess up various packages when experimenting, but the solution seems to be to keep your pipewire packages and just install pulseaudio-alsa and immediately reboot the system; simply restarting the pipewire service, or resolve doesn't seem to work.

In summary, install pulseaudio-alsa, then reboot. Resolve's audio player lag issue should go away.