Author Topic: DOS VDM - USB and Game port Gamepad support  (Read 147671 times)

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #105 on: January 13, 2022, 08:42:08 am »
DLL versions I'm using,
Code: [Select]
[K:\work\hidapi\libusb]bldlevel w:\usr\lib\usb100.dll
Build Level Display Facility Version 6.12.675 Sep 25 2001
(C) Copyright IBM Corporation 1993-2001
Signature:       @#bww bitwise works GmbH:1.0.24#@##1## 12 Jan 2022 18:44:44
 ECS26154618::::0::@@usb-1.0
Vendor:          bww bitwise works GmbH
Revision:        1.00.24
Date/Time:       12 Jan 2022 18:44:44
Build Machine:   ECS26154618
File Version:    1.0
Description:     usb-1.0

[K:\work\hidapi\libusb]bldlevel w:\os2\dll\USBCALLS.dll
Build Level Display Facility Version 6.12.675 Sep 25 2001
(C) Copyright IBM Corporation 1993-2001
Signature:       @#Arca Noae LLC:12.10#@##1## 19 Nov 2021 14:53:38     DAZAR1
 ::::::@@USBCALLS DLL for OS/2 (c) 2021 Arca Noae LLC
Vendor:          Arca Noae LLC
Revision:        12.10
Date/Time:       19 Nov 2021 14:53:38
Build Machine:   DAZAR1
File Version:    12.10
Description:     USBCALLS DLL for OS/2 (c) 2021 Arca Noae LLC

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #106 on: January 13, 2022, 08:59:55 am »
Ok, then it is most likely hidapi itself (the BWW repo is pulled straight from the official repo) or you using the AN USB stack (Wim and me have been testing with my USB stack).
I tried to be compatible with the AN USB stack but that one is closed source, I therefore don't have a clue of what they are doing.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #107 on: January 13, 2022, 09:05:01 am »
About usb100.dll: I don't understand why pulling the stuff from the BWW repo and building yourself works better than what is put in Netlabs. The only thing that Silvan did was to build it, likely with optimization.
Remember the NEW libusb is in Netlabs EXP and not (yet) in Netlabs REL !

Edit: sorry, did not read all postings, you are using the correct DLLs.

Still don't understand. My own built libusb DLL works as good as the one from Netlabs repo. I cannot spot any functional difference.
« Last Edit: January 13, 2022, 10:37:48 am by Lars »

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #108 on: January 13, 2022, 10:40:42 am »
Whoops, committed patches are attached. Jochen commited my first patch.

Where did Jochen commit your first patch?

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #109 on: January 13, 2022, 06:39:59 pm »
https://github.com/josch1710/hidapi
I'll try booting to my netlabs-exp partition later and test there. Maybe a reboot is needed as I can't think of why things would be different here then there.
What architecture are you using? Here, libusb1 is Pentium4 and the Yum installed usbcalls-dev is i686. It shouldn't matter but you never know.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #110 on: January 13, 2022, 07:20:54 pm »
Rebooted to my netlabs.exp install, after upgrading and installing hidapi, things work as expected. Now to figure out what is different.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #111 on: January 13, 2022, 07:31:17 pm »
https://github.com/josch1710/hidapi
I'll try booting to my netlabs-exp partition later and test there. Maybe a reboot is needed as I can't think of why things would be different here then there.
What architecture are you using? Here, libusb1 is Pentium4 and the Yum installed usbcalls-dev is i686. It shouldn't matter but you never know.

libusb: pentium 4
usbcalls-devel: n/a as I am using my stuff from the USB stack build tree ("leftovers", so to say)

But at least for usbcalls-devel, it should not matter. It's just a bunch of text files and 2 import libraries whose format is not dependant on processor architecture.

By the way: the "usbcalls" package might be the culprit. Unless you are using AN, the dependencies try to install a USBCALLS (20140416-1) that is by far older than what comes with AN or with my USB stack. Just stumbled over this problem. What I did was to just delete \usr\lib\usbcalls.dll which will reinstate the proper file in \os2\dll.

Silvan Scherrer

  • Full Member
  • ***
  • Posts: 200
  • Karma: +1/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #112 on: January 13, 2022, 07:42:50 pm »
Rebooted to my netlabs.exp install, after upgrading and installing hidapi, things work as expected. Now to figure out what is different.
which hidapi version do you have? as I just uploaded the last available one 0.11.2
it includes your fixes as well. even done a bit different

regards
Silvan
kind regards
Silvan
CTO bww bitwise works GmbH

Please help us with donations, so we can further work on OS/2 based projects. Our Shop is at https://www.bitwiseworks.com/shop/index.php

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #113 on: January 13, 2022, 08:24:01 pm »
Just to state: I just pulled the latest hidapi stuff from rpm.netlabs.org and installed the RPMs manually.
It now works exactly as the static build from Dave. I rebuilt "hidapitester" with some changes to the makefile to link to hidapi dynamically. I also built with "-Zhigh-mem" as I know that the whole chain (libusb, usbcalls) works just well with high memory.

Regards,
Lars
« Last Edit: January 13, 2022, 08:25:43 pm by Lars »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #114 on: January 14, 2022, 06:06:23 am »
Should have looked in popuplog.os2. Problem is the pthread library being newer in netlabs-exp.
Code: [Select]
01-13-2022  20:34:18  SYS2070  PID 0065  TID 0001  Slot 0081
K:\WORK\HIDAPITESTER\HIDAPITESTER.EXE
USB100->PTHR01._pthread_condattr_init
127
Threw me off as I expected something like,
Code: [Select]
[K:\work\hidapitester]hidapitester  --list
A non-recoverable error occurred.  The process ended.
Which is the result after I upgraded USBCALLS.DLL to 12.11. No trp, no entry in popuplog.

Edit: Above was with netlabs-rel. Upgrading usbcalls.dll on a netlabs-exp install things do work. The only USBCALLS.DLL installed here is in \os2\dll.
« Last Edit: January 14, 2022, 06:37:28 am by Dave Yeo »

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #115 on: January 14, 2022, 10:17:32 am »
Should have looked in popuplog.os2. Problem is the pthread library being newer in netlabs-exp.
Code: [Select]
01-13-2022  20:34:18  SYS2070  PID 0065  TID 0001  Slot 0081
K:\WORK\HIDAPITESTER\HIDAPITESTER.EXE
USB100->PTHR01._pthread_condattr_init
127
Threw me off as I expected something like,
Code: [Select]
[K:\work\hidapitester]hidapitester  --list
A non-recoverable error occurred.  The process ended.
Which is the result after I upgraded USBCALLS.DLL to 12.11. No trp, no entry in popuplog.

Edit: Above was with netlabs-rel. Upgrading usbcalls.dll on a netlabs-exp install things do work. The only USBCALLS.DLL installed here is in \os2\dll.

  • SYS2070: this almost always means that some DLL is missing an entry point. If that is the case, then you have an outdated pthread installed. Sorry but you will need to upgrade to the one in the Netlabs EXP repo. Please note that I have not knowingly used some pthread functionality that is "too new" but rather the rest of "libusb" that I did not touch uses that functionality. In short: we don't have a choice.
  • USBCALLS 12.11 ? I did not even know that version 12.11 of the USB stack already exists (I cannot see it in my AN subscription). Maybe it is not a good idea to test with something nobody else has available  ;)

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #116 on: January 14, 2022, 04:50:01 pm »
Configure likely found the new function in pthreads, which I don't want to update on the one install as if distributing software, it is a good idea if it works with netlabs-rel.
As for testing the new usbcalls, it is good to try it to see if there are issues to report.
It is interesting that it changed the failure on the netlabs-rel install.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #117 on: January 14, 2022, 11:10:20 pm »
So what are you trying to prove? That hidapi is not working properly? Or libusb? Or USBCALL version 12.11?
Just to make things clear: I am not actively using OS/2 any more. And I am not going to put any effort into something that is not approached systematically.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #118 on: January 15, 2022, 12:03:32 am »
Just that the usbcalls update doesn't break anything

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #119 on: January 15, 2022, 10:50:27 am »
What if any was changed from USBCALLS/USBRESMG version 12.10 to version 12.11?
If would be helpful if AN or you would share that secret with us. Otherwise, on the long run, it will become impossible to implement anything using USBCALLS .