Jerky playback of Kodi test videos on Pi3

Hi. New forum member here, but I’ve been using Raspbmc for years and have recently swapped to OSMC on my new Pi3. Great stuff - thanks to everyone who has made it possible!

I’ve noticed that various movies seem to skip a frame about once a second on my Pi3 running the latest OSMC release. I’ve read up on this topic, and have observed that when I disable LIRC the problem goes away.

Before I start creating logs and posting more detailed information, I just want to check that this LIRC-related problem is definitely supposed to be fixed in the most up-to-date release?

Thanks,
David

It’s fixed in the latest version (since around April).

When you say ‘disable LIRC’, are you actually disabling the LIRC service, or changing something in My OSMC?

Sam

Well, after some more testing, I don’t know what’s going on…

My up-to-date OSMC Pi3 is connected using Ethernet to a Windows SMB server. I notice playback jerks during camera panning scenes (the rest of my family don’t notice that, by the way).

Firstly, disabling LIRC (from within the OSMC Pi Settings screen) doesn’t affect the jerkiness now. I thought it did before; now it doesn’t.

For a bit of repeatability I downloaded some of the H264 1080p test files from http://kodi.wiki/view/Samples#Codecs.2C_Framerates_and_Subtitles and can see that they are all consistently jerky pretty much all the time. Noticeably much worse than real-world movies. The files with different framerates are all equally jerky - I can’t tell them apart.

My Videos Playback settings are “Adjust display refresh rate: Always” and “Sync Playback to Display: On (Method: Adjust PLL)” But changing these settings results in no playback change (better or worse) that I can see.

The only change I can see is when I turn off Hardware Acceleration. This results in the 25fps file being much smoother (almost perfect), and the 24fps and 23.976fps files showing what I would describe as “skipped frames”. Why would hardware acceleration make playback smoothness so consistently jerky?

It looks to me like the display framerate isn’t being changed to suit the files. My TV (a few-year-old Sony, HDMI connected through a Sony AV receiver) doesn’t seem able to display the framerate of the source, but it does say “1080i” all the time, which I think is wrong. At the weekend I might try connecting up a monitor instead of the TV.

Does anybody have any likely explanation for what I’m seeing? Should I live with it until Krypton (as I understand there are many playback-related changes to come)?

Thanks for reading this…

That sounds like the key point. If the TV doesn’t support the framerates you want (23.97 is the most common one for videos) then you won’t get perfectly smooth video.

Interlaced modes (like 1080i) are never chosen by kodi unless there are no alternatives.
Run “tvservice -m CEA” to see what resolution/framerates are supported by TV.

Also note that some TV’s won’t report their capabilities unless the TV is powered on and switched to right input before Pi is booted. (There is a way of resolving that), but for now be aware that behaviour may be different depending on the order you power on Pi and TV.

Thanks for all that advice. After more testing, here’s what I’ve learned:

  1. When the Pi3’s HDMI cable is connected to my Sony AV receiver, “tvservice -m CEA” lists a different set of modes (in which 1080i is “preferred”) than when the HDMI cable is connected to the Sony TV directly.
  2. I did the “sudo tvservice -d edid.dat” thing, and tweaked my config,txt. Now the TV does indicate display modes such as “1080p24” and “1080p50” when movies are played, instead of “1080i”. And this is still true even though the HDMI cable is connected to the AV receiver.
  3. The “jerks” I noticed during camera panning in movies (which is the thing that originally got me started on this…) have now gone, which is great!
  4. The Kodi test videos are all still really jerky, but are now slightly different to each other in jerkiness. When I turn OFF hardware acceleration in OMXplayer, all the 50fps and below videos become completely smooth - only the 60fps ones are jerky. If someone told me that the hardware acceleration on/off switch was inverted, I would believe them because to me, the jerkiness looks like the type of thing I might expect of a non-accelerated struggling processor.

So, this has been quite interesting, and it seems very strange that the hardware acceleration / test videos behave in the way I’ve described. If anyone has any ideas I’m keen to hear them. But I’m now completely satisfied with the playback quality of real movies.

Note that by default omxplayer is disabled on Pi2/Pi3 as that is recommended.
Video is still hardware accelerated using MMAL by default.

omxplayer acceleration is mostly useful for Pi1 users due to its lower CPU.
omxplayer disabled with mmal is much more advanced and fully featured.

Ahhh, well that’s something else I’ve learned :slight_smile:. I wonder why mine was enabled - I probably turned it on myself and forgot!

So I suppose the change in jerkiness on the Kodi sample videos when I switch OMXplayer on/off must be due to Kodi changing between OMX and MMAL for some reason, depending on the switch position, and OMXplayer not making as good a job of playback.

I’ve now left OMXplayer switched off - I’ll keep a lookout for any more jerkiness though I doubt there will be any.

Thanks again for your assistance popcornmix :+1:

Can you point at a specific video you see the problem with using omxplayer?
I can have a look just in case there is an easy fix.

Any of the following from http://kodi.wiki/view/Samples#Codecs.2C_Framerates_and_Subtitles:

  • H.264 1080p/23.976 (MKV)
  • H.264 1080p/24.000 (MKV)
  • H.264 1080p/25.000 (MKV)
  • H.264 1080p/50.000 (MKV)

And this one is still jerky for me even using MMAL (but I doubt whether I have any 60fps movies, so it doesn’t bother me):

  • H.264 1080p/60.000 (MKV)

Let me know if you want me to submit a log - tell me what test conditions too please.

Thanks again.

H.264 1080p/60.000 (MKV) with MMAL is smooth for me on my own master build. Have you tried with a Krypton build?
With omxplayer I do see judders.

No, not yet. I will update to Krypton when it’s released but I don’t want to incur the wrath of the rest of the family by being a beta-tester I’m afraid…

Good… I mean it’s good that your system behaves the same as mine in this respect.

1 Like