Page 1 of 1

VLC changes pitch/playrate randomly on audio playback

Posted: 04 Sep 2008 20:29
by Xpenetrator
Hi,

I think I found a funny but serious glitch: Audio file playback is changing the playrate slightly upwards at times. Being a musician, I'm probably a bit more sensitive to variations in pitch and wondered why VLC sounds sometimes like a broken record player. Now I had this phenomenon again on the 4th computer with a clean VLC 0.8.6i install and decided to document that.

I recorded a 2 minute test tone in my DAW software and rendered it as MP3 (160kBit/s CBR). Then I played the file back in VLC and recorded its output to the next track in the DAW. Here's what it sounds if I playback the two tracks together at the same level:

http://shup.com/Shup/60333/VLC_TestTone_1k_Drift.mp3

Here's the nominal pitch of the test tone (MIDI playable tone generator, hence not exactly 1kHz) played back by VLC:

Image

And here is what happens after a while on VLC playback:

Image

As you can see, the pitch drifts up by 10Hz which is not neglectable.
This does not happen always and it comes at random, but always somewhat into the file, mostly near the end. And it drives me nuts when it happens. :mrgreen: I'm sure the most basic job - playing back audio files (it happens on WAV as well) - is supposed to be working flawlessly and hence I call it a "serious glitch". Since it happens on Windows XP here I posted it in this forum, I hope that was right.

XPenetrator

Re: VLC changes pitch/playrate randomly on audio playback

Posted: 04 Sep 2008 22:07
by Jean-Baptiste Kempf
Hello,

Interesting post ...

Have you tried VLC 0.9.x builds ?

Re: VLC changes pitch/playrate randomly on audio playback

Posted: 04 Sep 2008 23:29
by Xpenetrator
Good idea! I just tried 0.9.2 Grishenko (Woo! Cool new GUI!), alas with the same results.
I'm not sure but I think it started somewhere with the latest versions of 0.8.5 but unfortunately I didn't use VLC so much for music at that time and I thought that might be a problem on my side too, so I didn't pay much attention to it.

If I can do something to help busting this little bugger, let me know! :)

Re: VLC changes pitch/playrate randomly on audio playback

Posted: 05 Sep 2008 03:03
by Jean-Baptiste Kempf
Well, 0.8.5 is old and dead. So, let's focus on 0.9.2

You should try the pitch correction module, named scaledtempo in the preferences.

Re: VLC changes pitch/playrate randomly on audio playback

Posted: 05 Sep 2008 04:58
by Xpenetrator
I think I can narrow it down now:

VLC seems to use DirectX as default output module. The problem doesn't seem to arise when I select the "waveout extension output" instead. So the culprit is probably in the DirectX output module or maybe even in DirectSound itself, who knows... :)

Re: VLC changes pitch/playrate randomly on audio playback

Posted: 05 Sep 2008 07:12
by Jean-Baptiste Kempf
This is an interesting bug then. Fill it in trac.

Re: VLC changes pitch/playrate randomly on audio playback

Posted: 07 Sep 2008 16:49
by Lotesdelere
VLC seems to use DirectX as default output module. The problem doesn't seem to arise when I select the "waveout extension output" instead. So the culprit is probably in the DirectX output module or maybe even in DirectSound itself, who knows... :)
DirectSound is the default sound output module on NT based systems, WaveOut is still available for compatibilty reasons but it's poorly implemented and should be used as the output module on Windows 9x/ME only.

However I experienced some really audible pitch issues (several tones down) with a MKV video containing H264/AVC video (encoded with x264) and AC-3 audio. Looks like the video was running at normal speed though.
But it's a 23.976 FPS video and the default setting for the H264 and VC-1 demuxers is set to 25 FPS so maybe that's the reason why ?

Re: VLC changes pitch/playrate randomly on audio playback

Posted: 08 Sep 2008 11:18
by VLC_help
I don't think audio decoders use video FPS because they don't need it. Audio doesn't has FPS concept.

Re: VLC changes pitch/playrate randomly on audio playback

Posted: 08 May 2021 14:13
by brezik.ad
On multiple Android phones vlc slows the rate a bit after starting playback and then speeds up a bit, most probably to compensate. Then it goes back to normal. I've tried every friggin setting there is in the application, yet to no avail.

Also, the last version update on windows started to lose rate every time I use skip and the effect stacks until I stop the playback and stay out again. It stacks heavy. 🤘🏻 But if it stacks some too many times (probably 25 cents or even more) then it goes back up after some 3 seconds.

Both these drive me crazy and also the fact this is the best player for Android, having only usable eq I've found. On win, I used to go Winamp even all these after the support ended, but lately I'm having some crashes and window control issues with multiple screens, so I considered switching to vlc as my primary audio player. Not any more. I'm going back to those crashes and window control issues. The clear playback with no performance problems is my top priority. And also the adorable modern skin.... 🥲

Re: VLC changes pitch/playrate randomly on audio playback

Posted: 24 Oct 2021 05:50
by wilsonhenley
(please forgive in advance my bad english, I'm french-canadian)

Oh wow... :(
Thank you for your thorough analysis of the problem. SO glad to see I'm not alone and it's not my ears degenerating. I noticed it a while back but didn't make much of it. I'm a musician too and I like to listen in loop to my recordings - when the songs starts again, it's off-pitch enough for me to scratch my head and wonder if I'm becoming senile - or is my mix total crap?!

After years of this I suddenly decided to google "song offpitch after restart in VLC" and this post was the first one above.

Its. A. Real. Problem. :shock:
I'm using VLC 3.0.16 Vetinari and the problem is OBVIOUS if you take the time to listen correctly. Ayayaye.

Thank you again for your enlightening me,
Wilson H.

Re: VLC changes pitch/playrate randomly on audio playback

Posted: 24 Oct 2021 11:02
by Lotesdelere
when the songs starts again, it's off-pitch

https://forum.videolan.org/viewtopic.php?f=14&t=156965