English Amiga Board

Go Back   English Amiga Board > Support > support.WinUAE

Thread Tools
Old 17 October 2018, 15:23   #1
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 420
Synchronize to native audio rate in lagless vsync mode

Hi Toni,

In the current Lagless Vsync (Beamraced) mode audio is resampled to keep audio in line with vsync of the host PC. This is a perfect method to keep audio and video in sync, at the "cost" of having the audio pitch vary slightly from a real Amiga (to the degree the PC host screen refresh rate is differing from the native Amiga refresh rate).

It got me thinking whether it would would be possible to add an additional synchronization method that just generates audio at the native Amiga Paula rate, i.e. there's NO pitch shift, and to keep video in sync with audio it would skip or halt on a single frame slice every now and then. The benefit of this would be Amiga audio at its native pitch at the cost of some (invisible?) tearing of a slice every now and then.

So with the current method we have beamraced vsync at the cost of slight (inaudible?) pitch shift of native Amiga audio. (At least for most user cases where refresh rate is 50hz, instead of native Amiga long or short field mode rate.)

With the additional method we would have beamraced sync with perfect native Amiga audio (zero pitch shift) at the cost of having (invisible?) tearing of a frameslice every now and then.

I don't know what you think of this, maybe it could be worthwhile to investigate whether or not this could be a viable (additional) synchronization method?

Last edited by Dr.Venom; 17 October 2018 at 15:38.
Dr.Venom is offline  
Old 17 October 2018, 15:41   #2
Toni Wilen
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,212
It is not possible without resampling. Native Paula rate does not exist.

Each Paula channel can have different sample rate and when rate is changed (which can be all the time when playing for example mod music), change needs to be very accurate.
Toni Wilen is online now  
Old 17 October 2018, 15:58   #3
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 420
I see. I think I need to untangle it a bit more (for my own understanding at least).

So there are two issues:

1. Paula audio channels (different rates per channel) are mixed and resampled to a single PC audio output rate (mostly 48Khz). This most surely causes aliasing but it does not cause in itself any pitch shift of the audio.

2. On top of the above Lagless Vsync (Beamraced) resamples the audio rate to a level that speedwise corrects for the difference [PC host screen refresh / Amiga video refresh]. This causes a shift in audio pitch, i.e. audio plays at a different pitch (speed) than native Amiga audio, to keep audio in sync with the host PC video refresh rate.

I think it is number 2 that I want to avoid with the alternative synchronization method. Does that make more sense?
Dr.Venom is offline  

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vsync Fullscreen and Double Buffer, incorrect frame rate? rsn8887 support.WinUAE 1 07 April 2011 21:43
Unstable display in Native mode. Ed Cruse support.WinUAE 8 09 June 2009 17:08
VSync delays audio mr.vince support.WinUAE 11 26 November 2008 22:15
VSync in windowed mode andreas request.UAE Wishlist 4 08 January 2008 20:54
When i Enable Vsync, audio is not synchronized cybermat support.WinUAE 5 07 January 2008 23:10

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 15:20.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.06501 seconds with 15 queries