Bluetooth earphone lags a lot

After tweaking for days, I was finally able to get my Bluetooth devices to connect.
Now the issue is that the sound lags a lot on my Bluetooth earphones. I have looked around a bit but haven’t been able to solve this problem. Note that it works perfect on windows.

Ok.

(my answer is just as detailed as your question is)

Please, tell me what details you need.

Just recently I got me some bluetooth headphones.
During research I quickly stumbled upon an issue with lagging sound due to some (otherwise rather good and modern) codec that some more recent headphones use.
It’s often the slightly higher priced ones.
That codec … compresses the audio before it is sent - and the headphones decompress it.
While the codec is good - it always has that inherent lag.
Doesn’t matter if listening to music - but rather annoying when video and accompanying audio are out of sync.

pulseaudio has an option to adjust for lag - also via GUI.
Perhaps that helps.

Are you talking about offset setting in pulseaudio? My issue is that the sound lag is random - sometimes it’s completely fine and then it would just randomly start to lag and then back to being completely fine.

yes
If it’s random … I have no solution.

How did you pair/connect the headphones?
I used the command line approach as described in the Arch wiki:
https://wiki.archlinux.org/index.php/bluetooth_headset#Setting_up_auto_connection
The “Configuration via CLI” section is just above that.

That way, my headphones connect automatically as soon as I turn them on - and the sound is switched from the speakers to the headphones.

Mine also connect automatically. That is not the problem.

Maybe this can help then - or provide clues:
https://wiki.archlinux.org/index.php/bluetooth_headset#LDAC/aptX
about LDAC/aptX codec
the same wiki page
I think that is the name of the codec I mentioned earlier.
Other than that - I can’t help further.