garbear / xbmc

XBMC Main Repository
http://xbmc.org
Other
132 stars 53 forks source link

Keypresses not recognized after Playback stop #106

Closed zach-morris closed 5 years ago

zach-morris commented 5 years ago

Not sure if this should reside in your branch or Kodi's at this point. Feel free to delete if it doesn't belong here.

Issue: Current Kodi v18 Beta 1 version seems like it will not give up keyboard control after a game was played and then stopped.

To recreate issue: Open up IAGL, Launch a game (Stella game in the log example), Press some keys, Bring up the OSD and select Exit. Attempting to use Enter on the keyboard after the game is exited no longer works (Note: it does in Alpha 3)

Also note this issue doesn't seem to occur if you start a game, and then bring up the OSD (with the mouse) and do not press some keys.

Additional notes after some more testing: With the latest beta, this seems to happen less often, but it does still sometimes happen. I can't find a reliable way to recreate this issue. I do notice that when this issue occurs, the viewtype of the listitems on the screen change from Folders to Icons, implying to me that Kodi is changing the listitem isFolder is being changed from True to False

Version Tested:

21:39:16.962 T:140735187836928  NOTICE: -----------------------------------------------------------------------
21:39:16.962 T:140735187836928  NOTICE: Starting Kodi (18.0-BETA1 Git:20180814-fc9faf32d5). Platform: OS X x86 64-bit
21:39:16.962 T:140735187836928  NOTICE: Using Debug Kodi x64 build
21:39:16.962 T:140735187836928  NOTICE: Kodi compiled Aug 14 2018 by Clang 9.0.0 (clang-900.0.37) for OS X x86 64-bit version 10.9.0 (1090)
21:39:16.962 T:140735187836928  NOTICE: Running on Apple Inc. MacBookPro12,1 with OS X 10.11.6, kernel: Darwin x86 64-bit version 15.6.0
21:39:16.962 T:140735187836928  NOTICE: FFmpeg version/source: 4.0.2-Kodi
21:39:16.963 T:140735187836928  NOTICE: Host CPU: Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz, 4 cores available

Log:

21:41:56.137 T:140735187836928   DEBUG: SECTION:UnloadDll(/Applications/Kodi_Retroplayer.app/Contents/Resources/Kodi/addons/game.libretro/game.libretro.1.0.38.dylib)
21:41:56.137 T:140735187836928    INFO: ADDON: Dll Destroyed - Atari - 2600 (Stella)
21:41:56.139 T:140735187836928   DEBUG: RetroPlayer[PLAYER]: Playback ended
21:41:56.139 T:140735187836928   DEBUG: OnPlayBackEnded: CApplication::OnPlayBackEnded
21:41:56.139 T:140735187836928   DEBUG: RetroPlayer[PLAYER]: Closing file
21:41:56.139 T:123145306673152   DEBUG: CAnnouncementManager - Announcement: OnStop from xbmc
21:41:56.139 T:140735187836928   DEBUG: RetroPlayer[PLAYER]: Playback ended
21:41:56.140 T:140735187836928   DEBUG: OnPlayBackEnded: CApplication::OnPlayBackEnded
21:41:56.140 T:123145306673152   DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnStop
21:41:56.140 T:140735187836928   DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
21:41:56.140 T:123145306673152   DEBUG: CAnnouncementManager - Announcement: OnStop from xbmc
21:41:56.140 T:140735187836928   DEBUG: ------ Window Deinit (VideoFullScreen.xml) ------
21:41:56.140 T:123145306673152   DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnStop
21:41:56.140 T:140735187836928   DEBUG: ------ Window Deinit (GameOSD.xml) ------
21:41:56.140 T:140735187836928   DEBUG: CGUIWindowManager::PreviousWindow: Activate new
21:41:56.141 T:140735187836928   DEBUG: ------ Window Init (MyVideoNav.xml) ------
21:41:56.141 T:140735187836928   DEBUG: Window MyVideoNav.xml was already loaded
21:41:56.142 T:140735187836928   DEBUG: Alloc resources: 0.73ms
21:41:56.142 T:140735187836928   ERROR: Control 55 in window 10025 has been asked to focus, but it can't
21:41:56.164 T:140735187836928   DEBUG: CGUIMediaWindow::GetDirectory (plugin://plugin.program.iagl/game_list/list_all/Atari_2600_Bestof_ZachMorris/1)
21:41:56.164 T:140735187836928   DEBUG:   ParentPath = [plugin://plugin.program.iagl/game_list/list_all/Atari_2600_Bestof_ZachMorris/1]
21:41:56.166 T:123145324457984   DEBUG: CAddonDatabase::SetLastUsed[plugin.program.iagl] took 2 ms
21:41:56.168 T:140735187836928   DEBUG: Loading items: 25, directory: plugin://plugin.program.iagl/game_list/list_all/Atari_2600_Bestof_ZachMorris/1 sort method: 0, ascending: false
21:41:56.170 T:123145308819456   DEBUG: Thread BackgroundLoader start, auto delete: false
21:41:56.171 T:123145317482496   DEBUG: Skin Helper Service --> Kodi_Monitor: sender xbmc - method: Player.OnStop  - data: {"end":true,"item":{"type":"unknown"}}
21:41:56.179 T:123145309970432   DEBUG: Previous line repeats 1 times.
21:41:56.179 T:123145309970432   DEBUG: ffmpeg[70000074E000]: Invalid return value 0 for stream protocol
21:41:56.179 T:123145308819456   DEBUG: Previous line repeats 1 times.
21:41:56.180 T:123145308819456   DEBUG: Thread BackgroundLoader 123145308819456 terminating
21:41:56.181 T:123145309356032   DEBUG: ffmpeg[7000006B8000]: Invalid return value 0 for stream protocol
21:41:56.181 T:123145324457984   DEBUG: Previous line repeats 1 times.
21:41:56.181 T:123145324457984   DEBUG: ffmpeg[70000151F000]: Invalid return value 0 for stream protocol
21:41:56.188 T:123145312653312   DEBUG: Previous line repeats 1 times.
21:41:56.188 T:123145312653312   DEBUG: ffmpeg[7000009DD000]: Invalid return value 0 for stream protocol
21:41:56.191 T:123145324457984   DEBUG: Previous line repeats 1 times.
21:41:56.191 T:123145324457984   DEBUG: ffmpeg[70000151F000]: Invalid return value 0 for stream protocol
21:41:56.192 T:123145309356032   DEBUG: Previous line repeats 1 times.
21:41:56.192 T:123145309356032   DEBUG: ffmpeg[7000006B8000]: Invalid return value 0 for stream protocol
21:41:56.194 T:123145309970432   DEBUG: Previous line repeats 1 times.
21:41:56.194 T:123145309970432   DEBUG: ffmpeg[70000074E000]: Invalid return value 0 for stream protocol
21:41:56.201 T:123145324457984   DEBUG: Previous line repeats 1 times.
21:41:56.201 T:123145324457984   DEBUG: ffmpeg[70000151F000]: Invalid return value 0 for stream protocol
21:41:56.203 T:123145309970432   DEBUG: Previous line repeats 1 times.
21:41:56.204 T:123145309970432   DEBUG: ffmpeg[70000074E000]: Invalid return value 0 for stream protocol
21:41:56.205 T:123145309356032   DEBUG: Previous line repeats 1 times.
21:41:56.205 T:123145309356032   DEBUG: ffmpeg[7000006B8000]: Invalid return value 0 for stream protocol
21:41:56.206 T:123145312653312   DEBUG: Previous line repeats 1 times.
21:41:56.206 T:123145312653312   DEBUG: ffmpeg[7000009DD000]: Invalid return value 0 for stream protocol
21:41:56.215 T:123145309970432   DEBUG: Previous line repeats 1 times.
21:41:56.216 T:123145309970432   DEBUG: ffmpeg[70000074E000]: Invalid return value 0 for stream protocol
21:41:56.216 T:123145324457984   DEBUG: Previous line repeats 1 times.
21:41:56.217 T:123145324457984   DEBUG: ffmpeg[70000151F000]: Invalid return value 0 for stream protocol
21:41:56.218 T:123145309356032   DEBUG: Previous line repeats 1 times.
21:41:56.218 T:123145309356032   DEBUG: ffmpeg[7000006B8000]: Invalid return value 0 for stream protocol
21:41:56.219 T:123145307209728   DEBUG: CActiveAE::ClearDiscardedBuffers - buffer pool deleted
21:41:56.219 T:123145309356032   DEBUG: ffmpeg[7000006B8000]: Invalid return value 0 for stream protocol
21:41:56.220 T:123145312653312   DEBUG: ffmpeg[7000009DD000]: Invalid return value 0 for stream protocol
21:41:56.236 T:123145318555648   DEBUG: Previous line repeats 1 times.
21:41:56.236 T:123145318555648   DEBUG: Skin Helper Widgets --> Kodi_Monitor: sender xbmc - method: Player.OnStop  - data: {"end":true,"item":{"type":"unknown"}}
21:41:56.913 T:140735187836928   DEBUG: Previous line repeats 1 times.
21:41:56.914 T:140735187836928   DEBUG: Keyboard: scancode: 0x7c, sym: 0x0113, unicode: 0xf703, modifier: 0x0
21:41:56.914 T:140735187836928   DEBUG: HandleKey: right (0xf083) pressed, action is Right
21:41:56.918 T:140735187836928   DEBUG: ------ Window Deinit (Pointer.xml) ------
21:41:56.980 T:140735187836928   DEBUG: Keyboard: scancode: 0x7c, sym: 0x0113, unicode: 0x0000, modifier: 0x0
21:41:57.181 T:140735187836928   DEBUG: Keyboard: scancode: 0x7d, sym: 0x0112, unicode: 0xf701, modifier: 0x0
21:41:57.182 T:140735187836928   DEBUG: HandleKey: down (0xf081) pressed, action is Down
21:41:57.185 T:123145312653312   DEBUG: ffmpeg[7000009DD000]: Invalid return value 0 for stream protocol
21:41:57.186 T:123145309970432   DEBUG: Previous line repeats 1 times.
21:41:57.186 T:123145309970432   DEBUG: ffmpeg[70000074E000]: Invalid return value 0 for stream protocol
21:41:57.186 T:123145309356032   DEBUG: ffmpeg[7000006B8000]: Invalid return value 0 for stream protocol
21:41:57.186 T:123145309970432   DEBUG: ffmpeg[70000074E000]: Invalid return value 0 for stream protocol
21:41:57.186 T:123145309356032   DEBUG: ffmpeg[7000006B8000]: Invalid return value 0 for stream protocol
21:41:57.188 T:123145324457984   DEBUG: ffmpeg[70000151F000]: Invalid return value 0 for stream protocol
21:41:57.195 T:123145312653312   DEBUG: Previous line repeats 1 times.
21:41:57.195 T:123145312653312   DEBUG: ffmpeg[7000009DD000]: Invalid return value 0 for stream protocol
21:41:57.199 T:123145309356032   DEBUG: Previous line repeats 1 times.
21:41:57.199 T:123145309356032   DEBUG: ffmpeg[7000006B8000]: Invalid return value 0 for stream protocol
21:41:57.200 T:123145309970432   DEBUG: Previous line repeats 1 times.
21:41:57.200 T:123145309970432   DEBUG: ffmpeg[70000074E000]: Invalid return value 0 for stream protocol
21:41:57.205 T:123145309356032   DEBUG: Previous line repeats 1 times.
21:41:57.206 T:123145309356032   DEBUG: ffmpeg[7000006B8000]: Invalid return value 0 for stream protocol
21:41:57.207 T:123145309970432   DEBUG: Previous line repeats 1 times.
21:41:57.207 T:123145309970432   DEBUG: ffmpeg[70000074E000]: Invalid return value 0 for stream protocol
21:41:57.280 T:140735187836928   DEBUG: Previous line repeats 3 times.
21:41:57.281 T:140735187836928   DEBUG: Keyboard: scancode: 0x7d, sym: 0x0112, unicode: 0x0000, modifier: 0x0
21:41:57.300 T:123145324457984   DEBUG: ffmpeg[70000151F000]: Invalid return value 0 for stream protocol
21:41:57.383 T:123145309356032   DEBUG: Previous line repeats 1 times.
21:41:57.383 T:123145309356032   DEBUG: ffmpeg[7000006B8000]: Invalid return value 0 for stream protocol
21:41:57.797 T:140735187836928   DEBUG: Previous line repeats 1 times.
21:41:57.797 T:140735187836928   DEBUG: Keyboard: scancode: 0x7b, sym: 0x0114, unicode: 0xf702, modifier: 0x0
21:41:57.798 T:140735187836928   DEBUG: HandleKey: left (0xf082) pressed, action is Left
21:41:57.930 T:140735187836928   DEBUG: Keyboard: scancode: 0x7b, sym: 0x0114, unicode: 0x0000, modifier: 0x0
21:41:58.176 T:140735187836928   DEBUG: Keyboard: scancode: 0x7d, sym: 0x0112, unicode: 0xf701, modifier: 0x0
21:41:58.176 T:140735187836928   DEBUG: HandleKey: down (0xf081) pressed, action is Down
21:41:58.180 T:123145309356032   DEBUG: ffmpeg[7000006B8000]: Invalid return value 0 for stream protocol
21:41:58.281 T:140735187836928   DEBUG: Previous line repeats 1 times.
21:41:58.281 T:140735187836928   DEBUG: Keyboard: scancode: 0x7d, sym: 0x0112, unicode: 0x0000, modifier: 0x0
21:41:58.565 T:140735187836928   DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x000d, modifier: 0x0
21:41:58.681 T:140735187836928   DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x0000, modifier: 0x0
21:41:58.681 T:140735187836928   DEBUG: HandleKey: return (0xf00d) pressed, action is Select
21:41:58.683 T:140735187836928 WARNING: CGUIMediaWindow::OnClick - updating in progress
21:41:59.564 T:140735187836928   DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x000d, modifier: 0x0
21:41:59.749 T:140735187836928   DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x0000, modifier: 0x0
21:41:59.749 T:140735187836928   DEBUG: HandleKey: return (0xf00d) pressed, action is Select
21:41:59.751 T:140735187836928 WARNING: CGUIMediaWindow::OnClick - updating in progress
21:42:00.301 T:123145324457984   DEBUG: ffmpeg[70000151F000]: Invalid return value 0 for stream protocol
21:42:00.304 T:140735187836928   DEBUG: Previous line repeats 1 times.
21:42:00.304 T:140735187836928   DEBUG: ------ Window Init (Pointer.xml) ------
21:42:00.470 T:140735187836928   DEBUG: ------ Window Deinit (Pointer.xml) ------
21:42:01.438 T:123145312653312   DEBUG: ffmpeg[7000009DD000]: Invalid return value 0 for stream protocol
21:42:03.805 T:123145309970432   DEBUG: Previous line repeats 1 times.
21:42:03.805 T:123145309970432   DEBUG: ffmpeg[70000074E000]: Invalid return value 0 for stream protocol
21:42:05.488 T:123145309356032   DEBUG: Previous line repeats 1 times.
21:42:05.488 T:123145309356032   DEBUG: ffmpeg[7000006B8000]: Invalid return value 0 for stream protocol
21:42:07.636 T:140735187836928   DEBUG: Previous line repeats 1 times.
flipside101 commented 5 years ago

I am having the same issue with the 27 August build on both Android versions

garbear commented 5 years ago

I've tracked down the issue - in the log this shows up as:

WARNING: CGUIMediaWindow::OnClick - updating in progress

This occurs because the update guard (held while the window's list is updating) isn't released, so OnClick actions are ignored. You'll notice that browsing elsewhere (and causing the window's items to update, resetting the guard) fixes the problem.

I think this occurs because xbmcplugin.endOfDirectory() (here) isn't called until after the modal blocks and then closes, so it's probably ignored. @zach-morris can you try moving the call to xbmcplugin.endOfDirectory() to the beginning of the function so Kodi doesn't think we're updating all the while that the modal is open? We should tell Kodi that the list is done updating as soon as possible to release the guard blocking clicks, certainly before opening other windows and launching games.

zach-morris commented 5 years ago

Doh! Thanks @garbear, that seems to have fixed it. Apologies for the issue