#16887 closed Bugs (Fixed)

Unstable audio pitch when "sync playback to display" is enabled, pitch correction disabled

Reported by: Groschi Owned by: FernetMenta
Priority: 4 - Normal
Component: Video playback (inc. audio in video and codecs) Version: 17.0 "Krypton" Beta1
Severity: Normal Keywords:
Cc: fritsch Blocked By:
Blocking: Platform: All


Since i updated from LibreElec 8 alpha 4 to LE alpha 5 with Kodi beta 1, audio behaves kinda weird. Older LibreElec builds worked just fine.

When playing back PAL (25fps) video (which gets slowed down to 24fps, to match the display refresh rate of 120Hz) with "sync playback to display" enabled and pitch correction disabled, every few seconds the audio pitch rises aprubtly for like a quarter second. Sounds somewhat like a worn out warbling audio tape. As if the audio is played back at the right (~4% slowed down) rate most of the time, then for a short moment jumps back to the original PAL playback speed. This happens with every 25FPS video.

Also, i noticed the video stutters at roughly the same intervals when i activate pitch correction, so this might be related. I noticed the pitch correction option was just added recently, so maybe it's a quirk with that?

My hardware is a Nvidia Ion based PC, audio playback via S/PDIF.

Here's a recent logfile with an affected video playing for 1-2 minutes at the end: http://paste.ubuntu.com/23149115/

Here's an audio recording of the problem, to illustrate what i'm talking about: http://onetwoxu.de/wp-content/uploads/2016/09/kodi-audio-pitch-problem.mp3

Change History (26)

comment:2 Changed at 2016-09-08T10:28:21+01:00 by FernetMenta

can you provide a short sample video to reproduce?

comment:4 Changed at 2016-09-08T11:50:36+01:00 by FernetMenta

does LE map a key for the debug screen? if not can you do this and open the debug screen while playing this video. watch the rr value. does is stay stable? (it does on my systems)

here is how I mapped the action:

<?xml version="1.0" encoding="UTF-8"?> <keymap>



<o mod="ctrl">PlayerDebug</o>




comment:5 Changed at 2016-09-08T12:19:34+01:00 by Groschi

rr fluctuates a little, the values are roughly between 0,95980 and 0,96150.

Last edited at 2016-09-08T12:24:12+01:00 by Groschi (previous) (diff)

comment:6 Changed at 2016-09-08T12:52:47+01:00 by FernetMenta

  • Cc fritsch added

rr ist stable then, it is just displayed with a too high precision. means audio speed does not change due to resampling. btw: this video is not very well suited to track down such kind of issues. the music is droning by itself :)

why do you force resampling to 192khz. this makes no sense. can you change this and try again?

comment:7 Changed at 2016-09-08T13:02:10+01:00 by Groschi

I set it that way just to see if it helps. If i set the output to "best match" (which should set the sampling rate at 48KHz for DVD audio) it behaves the same.

I'll try to find a video sample with calmer music, just gimme some minutes.

comment:9 Changed at 2016-09-08T13:14:49+01:00 by fritsch

Can you by chance please upgrade to the latest Milhouse build before we continue searching this bug. After Beta1 a lot of changes came into kodi.

You find the latest build here: http://forum.kodi.tv/showthread.php?tid=269815 (top of the list).

Also please always post a debuglog and describe a bit when (time) you roughly see / hear the issue, please.

comment:10 Changed at 2016-09-08T13:34:30+01:00 by Groschi

I installed the latest milhouse build, the issue is still there

In this recording you can hear it loud and clear at around seconds 3, 9, 15 and so forth...


comment:11 Changed at 2016-09-08T13:36:47+01:00 by fritsch

Also please your debuglog for that file, please - as we cannot reproduce yet.

comment:12 Changed at 2016-09-08T13:46:18+01:00 by Groschi

A fresh log with the video playing for some minutes: http://paste.ubuntu.com/23150034/

comment:13 Changed at 2016-09-08T13:57:13+01:00 by fritsch

From the log you played it for 4 seconds? Could you please let it run for 2 or 3 minutes while not extracting thumbs?

comment:14 Changed at 2016-09-08T14:02:51+01:00 by Groschi

Really? The video ran for 2 minutes and that's what the log shows. 14:41 -> 14:44

comment:15 Changed at 2016-09-08T14:04:36+01:00 by Groschi

I'll try to deactivate all thumbnail-related settings and try again.

comment:16 Changed at 2016-09-08T14:09:45+01:00 by Groschi

What setting do i need to adjust to keep kodi from extracting thumbs?

comment:17 Changed at 2016-09-08T14:14:11+01:00 by Groschi

So far i found the "extract metadata", "extract chapter thumbs" and "download actor portraits" (sorry, don't know what exactly the options are called in the english language GUI, have it set on german). What else did i miss?

comment:18 Changed at 2016-09-08T14:37:44+01:00 by FernetMenta

there is only a single change I can think of that can cause this. we prepare a test build

comment:19 Changed at 2016-09-08T14:38:44+01:00 by fritsch

Nothing you missed, this is what we get when debugging this:

15:29:49 T:139919011612416  NOTICE: ----- error: -3.219460, rr: 1.039332, prop: -0.001610, int: -0.000725
15:29:50 T:139919011612416  NOTICE: ----- error: -2.863293, rr: 1.039510, prop: -0.001432, int: -0.000725
15:29:51 T:139919011612416  NOTICE: ----- error: -0.605277, rr: 1.040639, prop: -0.000303, int: -0.000725
15:29:52 T:139919011612416  NOTICE: ----- error: -0.187266, rr: 1.040848, prop: -0.000094, int: -0.000725
15:29:53 T:139919011612416  NOTICE: ----- error: 0.769327, rr: 1.041326, prop: 0.000385, int: -0.000725
15:29:54 T:139919011612416  NOTICE: ----- error: -0.137999, rr: 1.040872, prop: -0.000069, int: -0.000725
15:29:55 T:139919011612416  NOTICE: ----- error: 0.065499, rr: 1.040974, prop: 0.000033, int: -0.000725
15:29:56 T:139919011612416  NOTICE: ----- error: 1.357092, rr: 1.041620, prop: 0.000679, int: -0.000725
15:29:57 T:139919011612416  NOTICE: ----- error: -0.426406, rr: 1.040728, prop: -0.000213, int: -0.000725
15:29:58 T:139919011612416  NOTICE: ----- error: 0.830296, rr: 1.041356, prop: 0.000415, int: -0.000725
15:29:59 T:139919011612416  NOTICE: ----- error: 0.904024, rr: 1.041393, prop: 0.000452, int: -0.000725
15:30:00 T:139919011612416  NOTICE: ----- error: -0.229817, rr: 1.040826, prop: -0.000115, int: -0.000725

As you see, perfect and perfect and perfect. Milhouse will provide a testbuild for you - that will log quite verbose things. Let's see.

comment:20 Changed at 2016-09-08T14:59:30+01:00 by Groschi

For the time being, this is the cleanest log i could get. Doesn't look like there's much helpful stuff in it though. http://paste.ubuntu.com/23150244/

comment:22 Changed at 2016-09-08T15:13:50+01:00 by Groschi

Awesome. That was quick.

comment:23 Changed at 2016-09-08T15:21:19+01:00 by fritsch

Please verify never the less. We had a reason doing that other patch back in time.

comment:25 Changed at 2016-09-08T15:58:08+01:00 by Groschi

Audio is fine now. Also, when pitch correction is enabled, the the video runs smooth again.

Log: http://paste.ubuntu.com/23150451/

comment:26 Changed at 2016-09-08T18:19:45+01:00 by FernetMenta

  • Resolution set to Fixed
  • Status changed from new to closed

fix was merged.

Note: See TracTickets for help on using tickets.