2015-07-05, 15:11
I managed to fix the DISC_FOREGROUND issue and the CAnomalousTriggerFilter but there is still heavy stuttering in NES (couldn't try any other) games whenever the peripherals system scans for new joysticks.
Furthermore I was finally able to reproduce the freeze again when connecting my Xbox 360 controll while Kodi is running that I reported a while ago. The deadlock is between the main thread
and the thread that is scanning for new peripheral devices
I've had a closer look and the problem is that CPeripherals::OnDeviceAdded() and ::OnDeviceRemoved() both try to get the CGUIDialogPeripheralManager instance from the window manager while holding a lock whereas CGUIWindowManager:rocess() tries to access CPeripherals (through CApplication::IsMuted()) while holding a lock.
The problem is solved by https://github.com/Montellese/xbmc/commi...69879dfb1f which simply uses an asynchronous message to update CGUIDialogPeripheralManager instead of explicitly retrieving the active instance from the window manager.
Furthermore I was finally able to reproduce the freeze again when connecting my Xbox 360 controll while Kodi is running that I reported a while ago. The deadlock is between the main thread
Code:
Kodi.exe!CSingleLock::CSingleLock(const CCriticalSection & cs) Line 39 C++
> Kodi.exe!PERIPHERALS::CPeripheralBusAddon::GetPeripheralsWithFeature(std::vector<PERIPHERALS::CPeripheral *,std::allocator<PERIPHERALS::CPeripheral *> > & results, const PERIPHERALS::PeripheralFeature feature) Line 211 C++
Kodi.exe!PERIPHERALS::CPeripherals::GetPeripheralsWithFeature(std::vector<PERIPHERALS::CPeripheral *,std::allocator<PERIPHERALS::CPeripheral *> > & results, const PERIPHERALS::PeripheralFeature feature, PERIPHERALS::PeripheralBusType busType) Line 216 C++
Kodi.exe!PERIPHERALS::CPeripherals::IsMuted() Line 642 C++
Kodi.exe!CApplication::IsMuted() Line 4451 C++
Kodi.exe!CGUIDialogMuteBug::UpdateVisibility() Line 37 C++
Kodi.exe!CGUIDialog::DoProcess(unsigned int currentTime, std::vector<CDirtyRegion,std::allocator<CDirtyRegion> > & dirtyregions) Line 122 C++
Kodi.exe!CGUIWindowManager::Process(unsigned int currentTime) Line 912 C++
Kodi.exe!CApplication::FrameMove(bool processEvents, bool processGUI) Line 2524 C++
Kodi.exe!CXBApplicationEx::Run() Line 140 C++
Kodi.exe!WinMain(HINSTANCE__ * hInst, HINSTANCE__ * __formal, char * commandLine, int __formal) Line 238 C++
Code:
> Kodi.exe!PERIPHERALS::CPeripheralBusAddon::Register(PERIPHERALS::CPeripheral * peripheral) Line 160 C++
Kodi.exe!PERIPHERALS::CPeripherals::CreatePeripheral(PERIPHERALS::CPeripheralBus & bus, const PERIPHERALS::PeripheralScanResult & result) Line 316 C++
Kodi.exe!PERIPHERALS::CPeripheralBus::RegisterNewDevices(const PERIPHERALS::PeripheralScanResults & results) Line 117 C++
Kodi.exe!PERIPHERALS::CPeripheralBus::ScanForDevices() Line 128 C++
Kodi.exe!PERIPHERALS::CPeripheralBus::Process() Line 212 C++
Kodi.exe!CThread::Action() Line 221 C++
Kodi.exe!CThread::staticThread(void * data) Line 134 C++
I've had a closer look and the problem is that CPeripherals::OnDeviceAdded() and ::OnDeviceRemoved() both try to get the CGUIDialogPeripheralManager instance from the window manager while holding a lock whereas CGUIWindowManager:rocess() tries to access CPeripherals (through CApplication::IsMuted()) while holding a lock.
The problem is solved by https://github.com/Montellese/xbmc/commi...69879dfb1f which simply uses an asynchronous message to update CGUIDialogPeripheralManager instead of explicitly retrieving the active instance from the window manager.