Kodi Community Forum
RetroPlayer Test Builds (updated for Nexus) - 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: RetroPlayer Test Builds (updated for Nexus) (/showthread.php?tid=173361)



RE: RetroPlayer Test Builds (updated for Isengard) - Montellese - 2015-07-01

(2015-07-01, 04:06)garbear Wrote:
(2015-07-01, 02:43)garbear Wrote:
(2015-06-30, 23:23)Montellese Wrote: Would be nice if we could first test this on linux and osx before creating a PR for it.
I'm on it

The add-on builds successfully on ubuntu and OSX. Runtime tested on OSX, roms still load

Great, I'll PR the changes to your repositories.


RE: RetroPlayer Test Builds (updated for Isengard) - Scourge - 2015-07-01

(2015-06-30, 23:17)garbear Wrote: can you post a debug log?

joystick support has been moved into an addon called peripheral.joystick. Kodi must not be loading this add-on

Quick FYI: I just tried your latest build on a different Windows machine and I got the same error. Will post logs later today.


RE: RetroPlayer Test Builds (updated for Isengard) - zbuzanic - 2015-07-01

(2015-06-30, 21:37)garbear Wrote:
(2015-06-27, 14:24)zbuzanic Wrote: 1. When first started I don't see anything under Games. After closing Kodi, and starting again, Files and Game addons will show up.

Haven't been able to reproduce yet. I'l keep trying

I think this is related to my setup, so ignore this, on other PC it works fine.

(2015-06-30, 21:37)garbear Wrote:
(2015-06-27, 14:24)zbuzanic Wrote: 2. Setting up Xbox 360 was a pain, as sometimes button will not get accepted (if ESC is pressed will that erase button assignment or assign ESC to button?)

ESC can't be mapped. it's used to cancel the configuration process. (btw moving the mouse will also cancel the current prompt.)

ATM the configuration GUI is the raw minimum needed to map keys. I'd like to improve it, so if you have any ideas, let me know! the thread for this is the Input thread: http://forum.kodi.tv/showthread.php?tid=211138

Ok, I have some ideas for configuration Smile

(2015-06-30, 21:37)garbear Wrote:
(2015-06-27, 14:24)zbuzanic Wrote: 5. Didn't manage to start any game for now Smile as I don't know if smc files are recognized by nestopia. I did add path but not sure how to proceed next.

You can check the supported extensions in the add-on manager. I've made an effort to list supported extensions in the description. (and I think .smc is Super Nintendo games)
Silly me...sorry for this.


RE: RetroPlayer Test Builds (updated for Isengard) - Montellese - 2015-07-01

(2015-06-30, 21:36)garbear Wrote:
(2015-06-30, 21:01)Montellese Wrote: I also tried to get my NES30 controller to work but didn't see any recognized input.

If the controller doesn't support XInput it should fall back to DirectInput. This can also be tested with XInput controllers by removing this line: https://github.com/kodi-game/peripheral.joystick/blob/dd98977/CMakeLists.txt#L113 (controller will fall back to DirectInput) . Does the controller get detected in the debug log?

Looking a bit at the joystick code is it possible that the following log message from CJoystickInterfaceDirectInput::EnumJoysticksCallback() is the reason why this (or any other) controller might not be detected with DirectInput:
Code:
AddOnLog: Joystick Support: ********** HWND: 00000000

Because the code then returns early even though pdidInstance contains information that looks correct like the name being "Bluetooth Wireless Controller" (which is what I see in win7's game controller window.

NVM: That only happens at the beginning (probably because the window doesn't exist yet during boot). The next scan works but it then throws an exception when trying to initialize the discovered joystick. Will investigate further.

EDIT: OK I think I found the issue. At https://github.com/kodi-game/peripheral.joystick/blob/master/src/api/directinput/JoystickInterfaceDirectInput.cpp#L84 you first copy all the detected CJoystickDirectInput pointers from m_scanResults into the joysticks output parameter (see https://github.com/kodi-game/peripheral.joystick/blob/master/src/api/JoystickInterfaceCallback.cpp#L32) and then you clean up m_scanResult by deleting every CJoystick pointer it contains but since you previously copied those pointers to another vector you just destroyed the objects that you are later trying to initialize.

Removing the logic that deletes the pointers in m_scanResults gets me further and the joystick is successfully initialized but during the next scan it is recognized again and initialized again and then Kodi freezes.

EDIT2: Looks like a deadlock between the main thread in CPeripheralBusAddon::GetPeripheralsWithFeature() and the thread responsible for scanning for new devices which is stuck at CPeripheralBusAddon::UnregisterRemovedDevices() callin CPeripherals::OnDeviceDeleted().

EDIT3: And the reason why the controllers that are constantly detected never match the ones that have previously been detected is because the call to CJoystickDirectInput::Initialize() which is performed later changes the button, hat and axis count but the comparison is done between an uninitialized and an initialized CJoystickDirectInput object which will most likely always fail.


RE: RetroPlayer Test Builds (updated for Isengard) - garbear - 2015-07-01

(2015-07-01, 21:13)Montellese Wrote: Looking a bit at the joystick code is it possible that the following log message from CJoystickInterfaceDirectInput::EnumJoysticksCallback() is the reason why this (or any other) controller might not be detected with DirectInput:
Code:
AddOnLog: Joystick Support: ********** HWND: 00000000

Because the code then returns early even though pdidInstance contains information that looks correct like the name being "Bluetooth Wireless Controller" (which is what I see in win7's game controller window.

NVM: That only happens at the beginning (probably because the window doesn't exist yet during boot). The next scan works but it then throws an exception when trying to initialize the discovered joystick. Will investigate further.

I remember running into this problem now. The window isn't created yet so GetMainWindowHandle() returns NULL. Peripheral buses are re-scanned every 5 seconds so it should work once the window is created. I'll probably also do this to force a scan when a USB device is attached.

(2015-07-01, 21:13)Montellese Wrote: EDIT: OK I think I found the issue. At https://github.com/kodi-game/peripheral.joystick/blob/master/src/api/directinput/JoystickInterfaceDirectInput.cpp#L84 you first copy all the detected CJoystickDirectInput pointers from m_scanResults into the joysticks output parameter (see https://github.com/kodi-game/peripheral.joystick/blob/master/src/api/JoystickInterfaceCallback.cpp#L32) and then you clean up m_scanResult by deleting every CJoystick pointer it contains but since you previously copied those pointers to another vector you just destroyed the objects that you are later trying to initialize.

Removing the logic that deletes the pointers in m_scanResults gets me further and the joystick is successfully initialized but during the next scan it is recognized again and initialized again and then Kodi freezes.

I pushed a fix for this: https://github.com/kodi-game/peripheral.joystick/commit/7643538 .

The next crash is probably due to logic here, which I copied from Kodi's peripherals subsystem. It breaks down when we can't differentiate between joysticks. The problem is, if two identical joysticks are attached and one is detached, how do we know which one?


RE: RetroPlayer Test Builds (updated for Isengard) - garbear - 2015-07-01

(2015-07-01, 21:13)Montellese Wrote: EDIT2: Looks like a deadlock between the main thread in CPeripheralBusAddon::GetPeripheralsWithFeature() and the thread responsible for scanning for new devices which is stuck at CPeripheralBusAddon::UnregisterRemovedDevices() callin CPeripherals::OnDeviceDeleted().

I fixed a different deadlock in CPeripheralBusAddon yesterday: https://github.com/garbear/xbmc/commit/71f1a9b . Looks like it wasn't the only one

(2015-07-01, 21:13)Montellese Wrote: EDIT3: And the reason why the controllers that are constantly detected never match the ones that have previously been detected is because the call to CJoystickDirectInput::Initialize() which is performed later changes the button, hat and axis count but the comparison is done between an uninitialized and an initialized CJoystickDirectInput object which will most likely always fail.

I had this same problem in Cocoa: https://github.com/kodi-game/peripheral.joystick/commit/22223d3 . I'll see if I can duplicate the fix


RE: RetroPlayer Test Builds (updated for Isengard) - Montellese - 2015-07-01

(2015-07-01, 23:00)garbear Wrote:
(2015-07-01, 21:13)Montellese Wrote: Looking a bit at the joystick code is it possible that the following log message from CJoystickInterfaceDirectInput::EnumJoysticksCallback() is the reason why this (or any other) controller might not be detected with DirectInput:
Code:
AddOnLog: Joystick Support: ********** HWND: 00000000

Because the code then returns early even though pdidInstance contains information that looks correct like the name being "Bluetooth Wireless Controller" (which is what I see in win7's game controller window.

NVM: That only happens at the beginning (probably because the window doesn't exist yet during boot). The next scan works but it then throws an exception when trying to initialize the discovered joystick. Will investigate further.

I remember running into this problem now. The window isn't created yet so GetMainWindowHandle() returns NULL. Peripheral buses are re-scanned every 5 seconds so it should work once the window is created. I'll probably also do this to force a scan when a USB device is attached.
Yeah it works fine during the next scan so not really a problem. BTW this is a bluetooth controller I'm trying to get to work so rescanning on new USB devices isn't gonna help.

(2015-07-01, 23:00)garbear Wrote:
(2015-07-01, 21:13)Montellese Wrote: EDIT: OK I think I found the issue. At https://github.com/kodi-game/peripheral.joystick/blob/master/src/api/directinput/JoystickInterfaceDirectInput.cpp#L84 you first copy all the detected CJoystickDirectInput pointers from m_scanResults into the joysticks output parameter (see https://github.com/kodi-game/peripheral.joystick/blob/master/src/api/JoystickInterfaceCallback.cpp#L32) and then you clean up m_scanResult by deleting every CJoystick pointer it contains but since you previously copied those pointers to another vector you just destroyed the objects that you are later trying to initialize.

Removing the logic that deletes the pointers in m_scanResults gets me further and the joystick is successfully initialized but during the next scan it is recognized again and initialized again and then Kodi freezes.

I pushed a fix for this: https://github.com/kodi-game/peripheral.joystick/commit/7643538 .

The next crash is probably due to logic here, which I copied from Kodi's peripherals subsystem. It breaks down when we can't differentiate between joysticks. The problem is, if two identical joysticks are attached and one is detached, how do we know which one?
I have no idea about XInput or DirectInput so I'm just throwing ideas out there but isn't there some kind of unique identifier for each device. You have to have a way to know from which device a button press came from right?


RE: RetroPlayer Test Builds (updated for Isengard) - Montellese - 2015-07-01

After a quick look at the XInput and DirectInput documentation maybe something like this would work: https://github.com/kodi-game/peripheral.joystick/compare/master...Montellese:joystick_comparison
For CJoystickDirectInput it remembers the device's GUID which is always the same. And for CJoystickXInput it already knows the controller ID / index. And then we provide customized implementations of CJoystick::Equals() and there are no more problems because the equality check relies on values that are not modified by any class method.


RE: RetroPlayer Test Builds (updated for Isengard) - garbear - 2015-07-02

nice. I haven't looked at the DInput documentation, I think this code was copied from Kodi's existing joystick code. I'll take a deeper look, because it'd be nice to record PID and VID for our buttonmap database

check back tmrw morning, i'll see if I can get DInput joysticks working tonight


RE: RetroPlayer Test Builds (updated for Isengard) - garbear - 2015-07-02

(2015-07-01, 09:17)Scourge Wrote:
(2015-06-30, 23:17)garbear Wrote: can you post a debug log?

joystick support has been moved into an addon called peripheral.joystick. Kodi must not be loading this add-on

Quick FYI: I just tried your latest build on a different Windows machine and I got the same error. Will post logs later today.

I checked this out, and the peripheral add-on isn't exporting the function symbol. I'll try forcing a rebuild of libKODI_game

EDIT: new build is up for windows


RE: RetroPlayer Test Builds (updated for Isengard) - Montellese - 2015-07-02

(2015-07-02, 00:07)garbear Wrote: nice. I haven't looked at the DInput documentation, I think this code was copied from Kodi's existing joystick code. I'll take a deeper look, because it'd be nice to record PID and VID for our buttonmap database

check back tmrw morning, i'll see if I can get DInput joysticks working tonight

IDirectInputDevice8::GetProperty with DIPROP_VIDPID (see https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getproperty(v=vs.85).aspx) should provide the vendor and product IDs.


RE: RetroPlayer Test Builds (updated for Isengard) - Scourge - 2015-07-02

(2015-07-02, 05:06)garbear Wrote:
(2015-07-01, 09:17)Scourge Wrote:
(2015-06-30, 23:17)garbear Wrote: can you post a debug log?

joystick support has been moved into an addon called peripheral.joystick. Kodi must not be loading this add-on

Quick FYI: I just tried your latest build on a different Windows machine and I got the same error. Will post logs later today.

I checked this out, and the peripheral add-on isn't exporting the function symbol. I'll try forcing a rebuild of libKODI_game

EDIT: new build is up for windows

Thanks. I just installed this build over the last one, but I still get the error message. I'll dive into this tonight (am at work atm).


RE: RetroPlayer Test Builds (updated for Isengard) - bugherbert - 2015-07-02

Hi,

the last two pre-releases 2af73de and 475ec37 show an error message on my computer.
MSVCP120D.dll is missing. a520121 was not showing this message. from what i googled so far the last two releases where maybe build in debug mode.

System:Windows 7 64Bit

Rgds


RE: RetroPlayer Test Builds (updated for Isengard) - garbear - 2015-07-02

(2015-07-02, 15:28)bugherbert Wrote: Hi,

the last two pre-releases 2af73de and 475ec37 show an error message on my computer.
MSVCP120D.dll is missing. a520121 was not showing this message. from what i googled so far the last two releases where maybe build in debug mode.

System:Windows 7 64Bit

Rgds

something must be linking to MSVCP120D.dll. I'll try cleaning and building on a few other windows boxes, i've found that this sometimes fixes things


RE: RetroPlayer Test Builds (updated for Isengard) - CrispyXUK - 2015-07-02

I've noticed my Harmony remote no longer functions under OS X on a Mac mini, still works fine with Plex Home Theatre. I also have trouble starting Kodi with gamepads connected so sometimes have to disconnect them.

Kodi also crashes on quit every time.

Don't suppose there are any other cores to test anytime soon are there?