Lipsync issue

Unfortunately not. There seems to be a strange character in your logs/setup.

Guess you would need to find another way (email, Google Drive,…) to give it to @tanio99


HyhIT4UP
An error occurred while grabbing Kodi Log:
 UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 4781: invalid start byte

Where can I find the log files?

They are at /home/osmc/.kodi/temp/kodi.log

I sent a message with a wetransfer-link to tanio99

@tanio99 not sure if you still need them but took some logs over the weekend.

Watched a few programs fine with no lip sync issues then the lip sync problems came back. Put it in debug mode and took logs:

Last played item had lip sync issues as soon as played - https://paste.osmc.tv/ruruyakewe.xml

Reboot, watched the same program, no lip sync issue - https://paste.osmc.tv/ferulajuca.xml (had to cut log because too big)

From what I can observed it doesn’t seem to be related to encoding issue but rather something to do with how long either the OSMC device has been up or been playing video files. Once rebooted the device seems to fix the lip sync issue for a period of time then it starts to drift.

Thanks for the logs. One can clearly see how the lipsync issue gets bigger and bigger by watching those lines:

2024-03-09 15:49:27.191 T:2947    debug <general>: PrepareNextRender: frameOnScreen: 637848918.021350 renderPts: 637930189.213161 nextFramePts: 637664500.000000 -> diff: 265689.213161  render: true forceNext: false
2024-03-09 15:49:27.233 T:2947    debug <general>: PrepareNextRender: frameOnScreen: 637891476.646350 renderPts: 637972747.838161 nextFramePts: 637684500.000000 -> diff: 288247.838161  render: true forceNext: false
2024-03-09 15:49:27.260 T:2947    debug <general>: PrepareNextRender: frameOnScreen: 637917596.854350 renderPts: 637998868.046161 nextFramePts: 637704500.000000 -> diff: 294368.046161  render: true forceNext: false

Here you can see two log lines showing that Kodi prepares the next frame. When you diff the timestamps then you can see that there are about 42 ms between the first and second message and 27 ms between the second and third. That’s bad because the interval should be constant and it depends on the fps rate of the selected video. That’s one reason for the lipsync issues.

But you can also see the logged diff value that increases from 265689.213161 us to 294368.046161 us. This is the lipsync delay. You’ve got 0.265 seconds delay at the first line and 0.294 seconds on the 3rd line. If you’re watching all those lines over the time than you can see how the lipsync issue evolves.

You can also see that the nextFramePts values increase by a 20 ms interval, which is related to the 50 fps rate of the video that you play. Since that’s not synchron with Kodi’s playback speed you get the lipsync issue at the end.

If you look at the same messages in the other log where you didn’t experience the lipsync issue, then you see this:

2024-03-09 15:52:04.763 T:2911    debug <general>: PrepareNextRender: frameOnScreen: 750079904.254000 renderPts: 750179078.692226 nextFramePts: 750204500.000000 -> diff: -25421.307774  render: false forceNext: false
2024-03-09 15:52:04.772 T:2911    debug <general>: PrepareNextRender: frameOnScreen: 750088344.046000 renderPts: 750187518.484226 nextFramePts: 750204500.000000 -> diff: -16981.515774  render: false forceNext: false
2024-03-09 15:52:04.780 T:2911    debug <general>: PrepareNextRender: frameOnScreen: 750096691.962000 renderPts: 750195866.400226 nextFramePts: 750224500.000000 -> diff: -28633.599774  render: false forceNext: false

Here, the Kodi playback interval is more or less constant. Every 8 to 9 ms a frame will be prepared. The diff values also stay more or less the same. Negative values mean that the frame is a bit too early, positive values indicate that the frames are too late.

The question is: why is the playback interval not constant in the first log?

I’ve already fixed some issues and I get perfect intervals now. But unfortunately, I’m now struggling a bit with dropped frames. As soon as I’ve fixed that we will provide a test build.

1 Like