Kodi Community Forum
v21 RPI4 - Kodi crashes when exiting games - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Game support (https://forum.kodi.tv/forumdisplay.php?fid=292)
+--- Thread: v21 RPI4 - Kodi crashes when exiting games (/showthread.php?tid=378071)



RPI4 - Kodi crashes when exiting games - goodlander - 2024-07-02

Hello,

I'm running Rpi4 on LibreElec 12 (Omega 21) and am running Pcsx-rearmed to attempt to play PS1 games.  I'm successfully able to load and play some games, and things seem to be running well. 

However, Kodi crashes every time when choosing to *exit* the game.  This happens if a press Select+Start on the controller, or if I use the Exit command from the popup menu. 

Here are the logs from a recent attempt when playing Crash Team Racing.  This happens for every game that I have, not just the one from the logs. And it happens whether playing a CHD file or Bin/Cue, it doesn't seem to matter:
https://paste.libreelec.tv/selected-lamprey.log

Here's the screenshot from right before I triggered the crash:
Image


I've been struggling for a while to get my old PSX collection working with Kodi and I feel so close after the upgrade to Omega!  Let me know what other information I can provide and I'm happy to do so.


RE: RPI4 - Kodi crashes when exiting games - garbear - 2024-07-06

In the log I see:

Code:

RetroPlayer[PLAYER]: Closing file

I think this means that PCSX closes successfully without crashing, so the problem is likely in Kodi.

Code:

PERIPHERALS: Event lock handle registered

This is the last line before the crash, and the event lock is for input events, so it could be an input bug that's crashing Kodi.

Code:

Thread 1 (Thread 0x7fb0253040 (LWP 1692)):
KODI::GAME::CPortInput::~CPortInput() ()
?? ()
?? ()
KODI::GAME::CGameClientInput::CloseJoystick(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::unique_ptr<PERIPHERALS::CEventLockHandle, std::default_delete<PERIPHERALS::CEventLockHandle> >&) ()
KODI::GAME::CGameClientInput::CloseJoysticks(std::unique_ptr<PERIPHERALS::CEventLockHandle, std::default_delete<PERIPHERALS::CEventLockHandle> >&) ()
KODI::GAME::CGameClientInput::Stop() ()
KODI::GAME::CGameClient::CloseFile() ()
KODI::RETRO::CRetroPlayer::CloseFile(bool) ()
CApplicationPlayer::ClosePlayer() ()
CApplication::StopPlaying() ()
CApplication::OnAction(CAction const&) ()
CApplication::ExecuteXBMCAction(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std:Confusedhared_ptr<CGUIListItem> const&) ()
CApplication::OnMessage(CGUIMessage&) ()
CGUIWindowManager::SendMessage(CGUIMessage&) ()
CGUIAction::ExecuteActions(int, int, std:Confusedhared_ptr<CGUIListItem> const&) const ()
CStaticListProvider::OnClick(std:Confusedhared_ptr<CGUIListItem> const&) ()
CGUIBaseContainer::OnClick(int) ()
CGUIWindow::OnAction(CAction const&) ()
CGUIWindowManager::HandleAction(CAction const&) const ()
CGUIWindowManager::OnAction(CAction const&) const ()
CApplication::OnAction(CAction const&) ()
CInputManager:TonguerocessQueuedActions() ()
CInputManager:Tonguerocess(int, float) ()
CApplication::FrameMove(bool, bool) ()
CGUIWindowManager:TonguerocessRenderLoop(bool) ()
CGUIDialog::Open_Internal(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
KODI::RETRO::CGameWindowFullScreen::TriggerOSD() ()
KODI::RETRO::CGameWindowFullScreen::OnAction(CAction const&) ()
CGUIWindowManager::HandleAction(CAction const&) const ()
CGUIWindowManager::OnAction(CAction const&) const ()
CApplication::OnAction(CAction const&) ()
CInputManager:TonguerocessQueuedActions() ()
CInputManager:Tonguerocess(int, float) ()
CApplication::FrameMove(bool, bool) ()
CApplication::Run() ()
main ()

This shows where the problem happens - after the game is closed, Kodi tries to deinitialize the game's input ports, and it looks like something happens in the wrong order and things blow up.

I did a lot of work on input for Kodi v21 / LE 12, but clearly there's still a problem in my code. To fix the crash I'll have to reproduce it and step through to see what isn't working right. I'm leaving for vacation soon so I'm not sure when I can look into this, but I really want to get input fully working so I'm adding this to my list of bugs to fix. I'll post back here when I have results.


RE: RPI4 - Kodi crashes when exiting games - garbear - 2024-07-11

So I did some investigating and I can reproduce the crash even without controllers attached (and the input code isn't run).

My guess is that there's memory corruption in the PCSX rearmed core.

A bug for exactly this was just committed and released in game.libretro version 21.0.7: https://github.com/kodi-game/game.libretro/pull/126

Can you give game.libretro version 21.0.7 a try? I'll send a PR now to get it on the LE mirrors.


RE: RPI4 - Kodi crashes when exiting games - goodlander - 2024-07-14

Yes, I will try as soon as I'm able. I just checked now and the update doesn't appear to be available yet via the standard add-on update route.  Is there anything special I can do to receive the update and check it out more quickly, or should I just wait for a few days and the update will land?


RE: RPI4 - Kodi crashes when exiting games - garbear - 2024-07-15

The new version should hit the mirrors after https://github.com/LibreELEC/LibreELEC.tv/pull/9085 is merged, which as you suspect will get the packages on the mirrors in the next few days most likely.


RE: RPI4 - Kodi crashes when exiting games - goodlander - 2024-07-19

Okay,

I was able to pull down the latest versions, which gave me 21.0.7.1 of Libretro and 24.0.0.58.1 of PCSX ReArmed.  Then I followed the same set of steps as last time by launching Crash Team Racing and immediately going to exit.  Unfortunately, it still triggers an immediate crash of Kodi.

Here is the latest log file:
https://paste.libreelec.tv/fine-troll.log

Let me know if there is any other information I can provide or things I can try,


RE: RPI4 - Kodi crashes when exiting games - MervynStevens - 2024-07-25

(2024-07-02, 06:20)goodlander Wrote: Hello,

I'm running Rpi4 on LibreElec 12 (Omega 21) and am running Pcsx-rearmed to attempt to play PS1 games.  I'm successfully able to load and play some games, and things seem to be running well. 

It's great to hear that you have your RPi4 running LibreElec 12 (Omega 21) and are successfully playing PS1 games with Pcsx-rearmed! If you have any questions or need assistance with anything related to your setup, feel free to ask. Whether it's about optimizing performance, troubleshooting issues, or anything else, I'm here to help.


RE: RPI4 - Kodi crashes when exiting games - garbear - 2024-07-25

@MervynStevens Write me a python script to solve the navier-stokes fluid flow equations for a zero vorticity boundary.


RE: RPI4 - Kodi crashes when exiting games - RitaGill - 2024-08-02

Great


RE: RPI4 - Kodi crashes when exiting games - garbear - 2024-08-04

Haha it was a reference to this: https://www.reddit.com/r/OpenAI/comments/18kjwcj/why_pay_indeed/

MervynStevens is clearly a chatbot, so I thought it was worth a try!

Image