koying / SPMC

fork of xbmc/kodi
Other
634 stars 257 forks source link

Surface vs. mediacodec #539

Open ghost opened 7 years ago

ghost commented 7 years ago

Does the change in 16.5.0 to using surface as the default provide better quality or performance than using mediacodec?

Forgive my ignorance; I have been following this change in the 16.5.0 RC thread, and I couldn't figure out which provides better quality. From the change, it would appear that surface is now preferred. Also, I read that the high quality scalers are disabled with surface, so a change to the Wiki page about preferred settings for 4K on Nvidia Shield would be appreciated.

classicjazz commented 7 years ago

What I have seen in my own testing is: Surface On: more fluid motion particularly on panning scenes. Softer picture (no upscaling). Surface Off: more judder, crisper video quality due to upscaling

Initially I thought there was better lipsync with surface on. But, with further testing, I see lipsync drift with surface both on and off, when using passthrough to an AVR.

@Koying Is there a way to get you better data about the judder? It's not due to dropped or skipped frames, which are 0. Surface rendering is using 30-35% of Shield TV CPUs 0 and 1 and 13% of CPU2 on a Bluray rip with amc-h264(S). With surface rendering off, Shield TV CPUs 0 and 1 are 30-40% and CPU2 is 0-13%. I don't have GPU utilization data.

bluecalx4 commented 7 years ago

With a 4k TV and 16.5, wouldn't it just be better to use your TV to upscale to 4K? You set the GUI to 1080p to do that right? TV probably has a much better upscaler anyways and there really are no 4k skins that I know of.

classicjazz commented 7 years ago

@bluecalx4 UHDTV scalers are better than Kodi/SPMC's. To limit your resolution to 1080, you must change your resolution on your Shield (HDMI > Resolution), not Kodi or Shield will still output 2160p. This is covered in detail here: https://github.com/koying/SPMC/wiki/Recommended-video-settings-for-SPMC-and-NVIDIA-Shield-TV-with-1080p-GUI

But, in doing so, you also lose a 4K SPMC GUI (useful if you have high resolution art), HDR (which is dependent on 4K video), and 4K in YouTube, Netflix, and other Android apps.

classicjazz commented 7 years ago

@koying Another data point: I don't see the judder in Kodi 17b6 with Surface on or off. But this comparison could be misleading because I also only see nearest neighbor and bilinear scaling, both with surface on and off. (Something is still broken in Kodi 17's upscaling). I am using the same userdata files with both SPMC 16.5 and Kodi 17b6 for testing. A great test sequence is the battle scene from GoT's Battle of the Bastards.

bluecalx4 commented 7 years ago

@classicjazz Thanks for the reply. I did notice there is now a resolution option within SPMC 16.5 on my Shield TV. What about setting 1080p there and leaving Shield resolution at 4k?

classicjazz commented 7 years ago

I think you are referring to the GUI resolution not the video resolution with Kodi. Since the Shield can capably handle a 2160p resolution GUI, I would recommend using that if you are keeping your video playback at 2160.

But apps (like Kodi/SPMC) cant currently change the video playback resolution on a per-app basis. So if you want any other app like YouTube or Netflix to output at 2160p (which the Shield enables by default when coupled with a UHD TV) then SPMC video playback will also be at 2160p but not using the HQ scalers if surface mode is enabled

bluecalx4 commented 7 years ago

@classicjazz No there is a new resolution option in the Video settings (under System) and then there is the GUI limit option (where you set it to Unlimited). Unless I'm being dumb and that setting has always been there.

classicjazz commented 7 years ago

16.5 shows the resolution and refresh rate information on my Shield TVs. This was not visible on this screen in 16.4.2. But I am not able to highlight/change these fields.

Until it's possible to tell Shield's Android OS--on a per video basis--to output video playback at a lower resolution than 2160p (as reflected on your UHD TV's menu) then your TV's upscaler won't kick in and there wouldn't be a benefit. Even then, there will be the issue of OSD needing to be rendered at the same resolution as the video being played.

classicjazz commented 7 years ago

@koying Please take a look at pytmlie3i.

I am seeing jerky playback even on DVDs with Dolby Digital playback when surface is disabled and hardware acceleration is enabled. If surface is enabled, no problem. If software decoding (FFMPEG) is used, no problem. I think this is tied not only to the discussion above but also other similar issues. And my point is that it isn't bitrate or resolution specific but rather non-surface mediacodec (hardware acceleration) specific.

It's also not upscaler specific--you can use bilinear, nearest neighbor, etc. All have issues.

bluecalx4 commented 7 years ago

@classicjazz I can highlight and change these fields on my Shield. When I click on Resolution in Video Output under System, i have 3 options, 2 1080p options and a 2160p option. There is even an option to change the refresh rate. Check it out. I swear I am not crazy.

koying commented 7 years ago

@bluecalx4 That would be a bug, really. Shield doesn't support resolution switching (yet?)

classicjazz commented 7 years ago

@koying I am even seeing issues with Surface now. I uploaded a debug that starts with prjn (the rest is stretched out vertically/horizontally like the picture I sent before).

Kodi 17beta6 is working smoothly with the same exact userdata files, with surface on or off. But it only seems to support bilnear and nearest neighbor scaling.