koying / SPMC

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

Video playback is not smooth anymore in 16.5.0 #541

Closed showmak closed 7 years ago

showmak commented 7 years ago

Unfortunately and for some reasons I lost the great version 16.4.2 which was upgraded by 16.5.0.

In SATV with firmware 3.3, the 16.4.2 was amazing, even with Adjust Display Refresh Rate turned Off, I was playing my movies in 23.976 and haven't noticed any stutter or judder, the motions in the movies were just perfectly smooth... My Shield HDMI resolution is always set to 1080p 60Hz.

But after upgrading to 16.5.0, the playback is not smooth anymore, dose not matter if Adjust Display Refresh Rate is On or Off.

However, The playback of the latest nightly of Kodi Krypton is still smooth, no sign of stutter or judder, with Adjust Display Refresh Rate is set to Off.

@koying please do something as I don't want to loose my database and settings by uninstalling 16.5.0.

radioactivetoy commented 7 years ago

Same here on SATV too, what logs can we provide to help solve this?

showmak commented 7 years ago

Good news for 16.5.0 users... I uninstalled SPMC and installed a fresh 16.5.0 and now the video playback is smooth as butter with Adjust Display Refresh Rate turned Off too. Thank you @koying for the great work. I will test it more and report back the findings.

dan1son commented 7 years ago

I'm having this same issue. Only with 1080i mpeg2 content from a tvheadend backend coming from an hdhomerun extend box. Same stutter with h.264 encoding turned on.

I know there's an open bug in kodi for some livetv issues. http://trac.kodi.tv/ticket/17069 http://trac.kodi.tv/ticket/16578

For me this happens with both live and pre-recorded from the tvheadend. I do have tvheadend setup to basically record straight to ts files since it seems to work better for ff/rw recordings being live recorded so it's possible if I messed around with the DVR settings on that end it wouldn't happen on recorded stuff, but only live.

The weird thing is the playback on spmc 16.4.x seems to work very well. This is on both the 1st and 2nd gen fire tv stick. I switched from kodi to spmc on the sticks since its playback was smoother for OTA content, but now with the new 16.5 versions it's not anymore. It runs smooth for several seconds, then choppy, then smooth again, etc. indefinitely. Mediacodec surface/mediacodec/sw only seems to all yield identical results (and same CPU usage so I'm guessing even though it says amc-blah it's actually software decoded). Tried with and without sync to display, same issue. No combination of available settings seem to work anymore. On 16.4.x I run with both accelerations on and de-interlace set to bob and it's smooth and looks nice. De-interlace on 16.5 gives funky shaky lines and similar choppiness as without it.

Kodi krypton betas also have choppy playback for this content only, although with de-interlace on there's a very significant framerate drop continuously.

I'm stuck running the old versions for now. Just wanted to share my experience. We use these sticks in the living room and bedroom where most OTA TV is consumed.

koying commented 7 years ago

@dan1son I happen to be working on PVR. If you have recorded sample to share, I'd be grateful

dan1son commented 7 years ago

@koying I grabbed something for ya. I'll send you a PM with a link.

I re-installed 16.5.2 on my fire tv stick 2 which updated to the new Fire OS last night. Now it seems when I play back the recorded version of the file that it stays smooth throughout, but still has no deinterlacing with surface on and very poor (bob) or slow (bob inverted) deinterlacing with surface off. Also "auto" seems to always have de-interlacing off, even for clearly 1080i content like this file.

This same content was choppy/smooth/choppy/smooth when watching it live through tvheadend on 16.5.2, but doesn't seem to have that when watching it back from the recorded/recording file.

I can possibly setup my tvheadend box for external access if you want to attempt to mess with the live aspect. We can PM back and forth to set that up. I have gigabit internet, so it might work fast enough externally... never tried.

dan1son commented 7 years ago

Here's a debug log for playing back live TV (at the end).

spmc.txt

I did notice when debug logging was on that I didn't notice the same choppy/smooth/choppy/smooth so maybe there's some info in between the debug being on and off at the end that'll explain a difference there too. Or it might've just been the content was harder to tell at the time since if there's minimal movement it's not always as obvious.

koying commented 7 years ago

There is a "fixpvr" test build cooking. Please give it a shot and report. Thanks.

dan1son commented 7 years ago

I'll check it out this evening. Should it show up in the releases section of github? I see a new branch, but I don't have a dev environment or anything setup.

edit: I found it. http://download.semperpax.com/spmc/android-arm/SPMC-fixpvr-fef50e7-armeabi-v7a.apk

dan1son commented 7 years ago

@koying I loaded the new build side by side with the other 16.5.2 on my fire tv stick 2, copied over my settings and gave it a short play of some live 1080i content. Looks great now. I'm not seeing any of the stuttering/choppiness I was getting before. I haven't tested it extensively, but on a quick pass it looks like you took care of my issue. Playing the same material on the older build had immediate and very noticeable stuttering. So there was a very significant side by side improvement, and hopefully complete elimination of the problems that have plagued me to some degree on those devices for a while.

On a side note, I also noticed framerate switching on my old Sony SXRD TV to 1080p/24 when I tried a movie (not sure when that worked, I don't think it was with 16.4.2). Amazing to have that working well on such a cheap device! My main viewing room has a dedicated PC running Kodi so I can get features like that and uncompressed hd audio passthrough. Any idea if the fire tv stick 2nd gen supports dts-hd? Might have to yank it upstairs and give it a go if it does.

Thanks again. You and Davilla have been my xbmc/kodi saviors for a long time now. Good to see you both still doing your thing.

koying commented 7 years ago

@dan1son Good. Please try to give it extensive testing. The moment you'll likely get hiccups is when the stream changes format (eg 1080p->720p or 16:9 -> 4:3).

radioactivetoy commented 7 years ago

On a Xiaomi Mi Android RV (Amlogic s905x) this makes the mpeg2 streams of my IPTV provider (Movistar Spain) Hardware accelerated again, removing all shuttering due high deinterlacing cpu usage. I will try to see if there are problems on format changes, but it's difficult as nearly all content is 16:9 and my provider uses only 1080 or SD fixed per channel.

koying commented 7 years ago

It has been suggested by fernetmenta that it'd happen on commercial breaks, but I don't know if it's (still?) a fact...

radioactivetoy commented 7 years ago

In my case Xiaomi Mi Android TV with 16.5.2 IPTV mpeg2 stream uses software decoding from the start. Same version on the SATV on same stream is decoded on hw. Seems that it only happens on Amlogic. I installed the pvrfix version and stream starts hw decoded from the start on Amlogic.

dan1son commented 7 years ago

@koying I have three young kids so I won't be able to really give it a more thorough test until this weekend. We also usually only watch live TV for sports on the weekends anyway. I'll load the pvrfix version onto my fire tv stick 1s, adt-1, kindle fires, and whatever other android phones/tablets are laying around and see how it fairs on all of them for live TV. I'll let you know how it goes.

I don't believe any of the stations here still switch formats on the fly like they used to when HDTV was new. Different channels and sub-channels definitely have different resolutions/refresh/aspect ratio but once you select a channel I don't believe I'll see any live changes anymore. Most TVs would have a significant delay if that were to happen with an antenna too.

The most common occurrence of that used to be during storms and such when they had to put weather overlays on the screen. The resolution/aspect would drop down to SD since the old weather systems couldn't overlay at full resolution. Even that hasn't been the case for years from my experience. It might still be that way in some smaller markets that haven't replaced the old equipment, but I have no way to test that.

koying commented 7 years ago

Yeah. If your WE shows no showstoppers, I'll just go with this solution until someone complains ;)

dan1son commented 7 years ago

@koying I've seen no issues on any devices with the dvrfix branch. We watched live TV (American football, news, car racing, etc.), H.264 movies, pre-recorded stuff,, and whatever else throughout the weekend on the Fire TV stick 1 and 2, ADT-1, and fire tablets without issue. The playback seems far more solid than it has in the past.

The only oddity I saw was some weird stutter when a specific commercial was playing before a Family Guy episode came back on. It seemed to cause something to have to resync, but it corrected itself in short enough time to not effect the show (so not a deal breaker by any stretch). I saw no change in format at that time so I'm not sure what was the cause there. Could just be a one off.

I'd say go for it.

koying commented 7 years ago

Cool. Thanks much for the feedback.

Don't hesitate to upload a log and ping back if you encounter hiccups.

rbronco21 commented 7 years ago

Does this fix have anything to do with artifacts during mpeg2 acceleration? I'm having issues with certain TV shows and can test this out to see if I can expect a fix on 16.6.