post-sleep, Kodi crashes on playback when using "Adjust display refresh rate"
#1
## Bug report
### Describe the bug
Here is a clear and concise description of what the problem is:
<!--- Provide a more detailed introduction to the issue itself, and why you consider it to be a bug -->
<!--- A bug report that is not clear will be closed -->
<!--- Put your text below this line -->
Following PC sleep, Kodi crashes when starting playback with "Adjust display refresh rate" set to "On Start/stop".
The crashing does not occur if just sleep/wake the PC, but I use a harmony remote to sleep/wake my PC, TV and amp in a single button press. After the crash occurs, I can open Kodi again, and the playback will start correctly.


## Expected Behavior
Here is a clear and concise description of what was expected to happen:
<!--- Tell us what should happen -->
<!--- Put your text below this line -->
Kodi sets the refresh rate according to the media file and starts playback


## Actual Behavior
<!--- Tell us what happens instead -->
<!--- Put your text below this line -->
Kodi crashes

Here is the sequence of events correlated to the log file:

I put the PC only to sleep with Kodi still open
I wake the PC only
I start playback - Line 713
No problem, stop playback.
I put the whole system (PC, TV and amp) to sleep with Kodi still open
I wake the whole system (PC, TV and amp)
I start playback - Line 1591
Kodi attempts to start playback and then crashes

Comparing the successful and unsuccessful attempts, it's line 850 onwards that is not executed on the unsuccessful attempt i.e. "DEBUG: DX:Big GrineviceResources::ReleaseBackBuffer: release buffers." and beyond


## Possible Fix
<!--- Not obligatory, but suggest a fix or reason for the bug -->
<!--- Put your text below this line -->
Seems related to the resolution/refresh rate detection/setting. Presumably Kodi can be prevented from crashing given that when restarting Kodi, all works correctly, so nothing OS-wise or driver has needed to be reset as such.

Edit: after some messing around, it seems as though refresh rate switching seems to have gotten busted on my setup out of nowhere (assume windows update must have caused it), i've always had "use fullscreen window" unticked in order to get smooth playback with passthru audio and refresh rate switching. It seems that now, refresh rate switching isnt working at all with that setting unticked. Ticking it seems to have fixed the issue... touch wood... still not ideal that Kodi can outright crash with no explanation in this scenario.

### To Reproduce
Steps to reproduce the behavior:
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
<!--- Put your text below this line -->
With "Adjust display refresh rate" set to "On Start/stop":
1. Put PC to sleep with Kodi still running (i do this with my harmony remote which also switches off the tv and my amp)
2. Wait a short period for client to fully sleep
3. Wake client (i am using harmony remote which powers on the tv and amp and client in quick succession)
4. Attempt to play media
*Kodi crashes*


### Debug Log
<!--- Put your text below this line -->
<!--- A Debug Log is always mandatory when creating an issue. Provide one! -->
The Debug Log can be found here:
https://www.mediafire.com/file/hyc7axrxx...i.zip/file
orx
https://paste.kodi.tv/qujuzaxaro.kodi

## Additional context or screenshots (if appropriate)
Here is some additional context or explanation that might help:
<!--- How has this bug affected you? What were you trying to accomplish? -->
<!--- Put your text below this line -->



### Your Environment
Used Operating system:
<!--- Include as many relevant details about the environment you experienced the bug in -->
<!--- Put your text below this line. Checkboxes can easily be ticked once issue is created -->
 - [ ] Android
 - [ ] iOS
 - [ ] Linux
 - [ ] OSX
 - [ ] Raspberry-Pi
 - [X] Windows
 - [ ] Windows UWP

 - Operating system version/name: Windows 10 - fully updated
 - Kodi version: 18.6 (also reproduced on 18.4 and 26.03 nightly)



<!--- End of this issue -->
Reply
#2
There is no large errors in the debug, and noting Intel® HD Graphics 4000 a mobile integrated graphics solution by Intel, launched in May 2012 depending on shared memory, this stands out and is the likely source of your irritation. Kodi is graphically intensive and the way windows handles a process that has locked the shared memory for sleep mode would be the issue. FTL: Using Windows 8+ workaround for refresh rate 24 Hz and then Unable to retrieve registry settings for Windows which appears you have entered sleep mode in a non desktop format (try using windowed mode prior to sleep). Rolling back the driver seems to work for some. Better control over the gfx allocation and protection of shared memory might be the solve, I have heard this issue many times from shared memory set-ups and from my point of view this is an o/s with hardware problem, that works for some and not for others.
Reply
#3
(2020-03-26, 18:42)PatK Wrote: There is no large errors in the debug, and noting Intel® HD Graphics 4000 a mobile integrated graphics solution by Intel, launched in May 2012 depending on shared memory, this stands out and is the likely source of your irritation. Kodi is graphically intensive and the way windows handles a process that has locked the shared memory for sleep mode would be the issue. FTL: Using Windows 8+ workaround for refresh rate 24 Hz and then Unable to retrieve registry settings for Windows which appears you have entered sleep mode in a non desktop format (try using windowed mode prior to sleep). Rolling back the driver seems to work for some. Better control over the gfx allocation and protection of shared memory might be the solve, I have heard this issue many times from shared memory set-ups and from my point of view this is an o/s with hardware problem, that works for some and not for others.
Thanks for the detailed reply!
Reply
#4
(2020-03-26, 18:42)PatK Wrote: There is no large errors in the debug, and noting Intel® HD Graphics 4000 a mobile integrated graphics solution by Intel, launched in May 2012 depending on shared memory, this stands out and is the likely source of your irritation. Kodi is graphically intensive and the way windows handles a process that has locked the shared memory for sleep mode would be the issue. FTL: Using Windows 8+ workaround for refresh rate 24 Hz and then Unable to retrieve registry settings for Windows which appears you have entered sleep mode in a non desktop format (try using windowed mode prior to sleep). Rolling back the driver seems to work for some. Better control over the gfx allocation and protection of shared memory might be the solve, I have heard this issue many times from shared memory set-ups and from my point of view this is an o/s with hardware problem, that works for some and not for others.

Hi PatK, just discovered that is caused by simple turning the TV power off and then back on while Kodi is still running. As soon as I go to play something after doing so, Kodi crashes. Heres a debug log where i opened kod,turned off tv, waited a little, turned on tv, tried to play a movie, kodi crashesi: https://www.mediafire.com/file/kpkj39fp6...4.zip/file

I can see jellyfin adds some noise to the log, so I can do it again with a clean userdata folder if preferred
Reply
#5
(2020-05-03, 21:30)ears1991 Wrote: jellyfin adds some noise to the log
Yes quite a bit, but I now suspect your issue is one of HDCP with the lose of handshaking, Kodi sets up graphics in default on the lose of handshaking and that default is no longer compatible with the TV.
(2020-05-03, 21:30)ears1991 Wrote: TV power off and then back on while Kodi is still running
If you power up the TV then run Kodi; all is well? I no longer recommend the pin #19 fix, but there are other work-rounds. I suggest you either don't turn off the TV or re-start Kodi P.S. Use one of the public paste bins for logs, I end up with a gambling page on download .zjps
Reply
#6
(2020-05-04, 00:30)PatK Wrote:
(2020-05-03, 21:30)ears1991 Wrote: jellyfin adds some noise to the log
Yes quite a bit, but I now suspect your issue is one of HDCP with the lose of handshaking, Kodi sets up graphics in default on the lose of handshaking and that default is no longer compatible with the TV.
(2020-05-03, 21:30)ears1991 Wrote: TV power off and then back on while Kodi is still running
If you power up the TV then run Kodi; all is well? I no longer recommend the pin #19 fix, but there are other work-rounds. I suggest you either don't turn off the TV or re-start Kodi P.S. Use one of the public paste bins for logs, I end up with a gambling page on download .zjps 

Thanks for the reply, sorry about that, I couldnt get paste.kodi.tv to work yesterday, here is a log of the same but with a fresh userdata folder: https://paste.kodi.tv/ukumazasix.kodi

Yes all is fine if i power up the tv and then run Kodi. I found this thread: https://forum.kodi.tv/showthread.php?tid=251833 seems a bit of a nightmare though!
Reply
#7
(2020-05-04, 09:00)ears1991 Wrote: Yes all is fine if i power up the tv and then run Kodi.
OK you got the drill, sadly for some users a fix was never found and developers are aware, defeating HDCP is not in the cards. Some users have hardware that doesn't have the issue (yet) and the old pin #19 used to work until new hardware started to enter the market. Might try white lising only res you use and the TV default, pehaps you can force the issue as a default.
Reply

Logout Mark Read Team Forum Stats Members Help
post-sleep, Kodi crashes on playback when using "Adjust display refresh rate"0