I'll start at the beginning:
I had a video card rx6750 xt, and it recorded the screen perfectly until the driver version "Adrenalin 23.5.2 (WHQL Recommended)", on the next version, the sound started lagging behind, or on the contrary, it was ahead of the video sequence.
I thought, ok, maybe it's a problem with the video card. After some time, I bought a rx7900 xtx, and on the driver version "Adrenalin 23.9.1 (WHQL Recommended)", the same problem appeared (I have windows 10).
I'm not exactly sure, but maybe the problem is with my system, but again, on past driver versions, the recording works fine.
My system configuration:
Case : ZALMAN Z3 Iceberg
Power Supply : EVGA GQ 850W 80 PLUS Gold
MotherBoard : Z590 PG Velocita
Processor : Intel Core i9-10900K
Thermal paste : Arctic mx-6
Processor cooling :
Memory : VENGEANCE® RGB RT 32GB (2x16) 3600 (3800) MHz C16
Graphic Card : AMD Radeon™ RX 7900 XTX Phantom Gaming 24GB OC
Storage :
M.2 SSD (1TB) - Samsung 980 PRO PCI-E 4.0 NVMe™
M.2 SSD (1TB) - Kingston NV2 PCI-E 4.0 M.2 NVMe™
HDD (2 TB) - Seagate Barracuda ST2000DM008