3DxWare SDK Version 3

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

jwick
Moderator
Moderator
Posts: 3336
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: 3DxWare SDK Version 3

Post by jwick »

MarkusSenseGraphics wrote:I would like to have one window receiving events from multiple connected SpaceNavigators but differ between them by the device Id.
Just for our information, what are you planning on doing with multiple, simultaneous devices?
MarkusSenseGraphics
Posts: 11
Joined: Tue Nov 27, 2012 2:39 am

Re: 3DxWare SDK Version 3

Post by MarkusSenseGraphics »

Sorry for the late reply, I must have missed this entry even though I subscribe to the post.
The company I work for have an open source API (H3DAPI) with support for 3dconnexion devices and it would be nice to update it to have support for multiple devices.

Some more questions.
Are there any examples in which handling SI events is done in a separate thread, leaving the main thread free to do other stuff than GetMessage processing? We have a version in which this is done by creating a hidden window which works fine with the new API as well, as long as user do not disconnect/reconnects the device. In my tests the following occurred. Can SIInitalize be called in the main thread and the rest of functions in separate thread?
- Is device index 0 and SI_ANY_DEVICE considered the same when using SiOpen? If device index 0 i used in our test application (H3DViewer) diconnecting and reconnecting while application is running will result in garbage values for motion events. This problem goes away if application is restarted. I implemented a version in which a separate thread is used by hacking the 3DxTest you include. Using that application there are no more values at all after connecting when running the application. If SI_ANY_DEVICE is used both applications work as they should.
- In our test application SI_DEVICE_CHANGE_EVENT are never caught. In the modified 3DxTest they are. I can for the life of me not figure out why. Both applications are tested on the same system and should therefore use the same driver and connections.
I also, just to make sure, tested our API using the siappMT.lib versions (since I assume that refer to the MultiThreaded propery of runtime settings in visual studio). The results are the same.

And my final question, as I read the license that comes with the installer distributing headers and libraries are fine as long as none of your dlls are distributed, dlls should be installed by users using your installers.
jwick
Moderator
Moderator
Posts: 3336
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: 3DxWare SDK Version 3

Post by jwick »

MarkusSenseGraphics wrote:Some more questions.
Are there any examples in which handling SI events is done in a separate thread, leaving the main thread free to do other stuff than GetMessage processing?
Nothing now, but that's a good suggestion for a future SDK.
MarkusSenseGraphics wrote:We have a version in which this is done by creating a hidden window which works fine with the new API as well, as long as user do not disconnect/reconnects the device. In my tests the following occurred. Can SIInitalize be called in the main thread and the rest of functions in separate thread?
Probably. It may be a question of where the events from the driver will go. They need to go to the winproc you are listening on.
MarkusSenseGraphics wrote:- Is device index 0 and SI_ANY_DEVICE considered the same when using SiOpen?
No. You need to use one or the other. SI_ANY_DEVICE is the "I don't care, I'm not going to open multiple devices, just fold all the data together for me", (legacy) option. If you want to handle multiple devices, you should open 0, then each of the connected devices with SiOpen. You will then get events when devices come and go.
MarkusSenseGraphics wrote:If device index 0 i used in our test application (H3DViewer) diconnecting and reconnecting while application is running will result in garbage values for motion events.
On device 0, or the others? Device 0 shouldn't get motion events. It is for notifications only.
MarkusSenseGraphics wrote:This problem goes away if application is restarted. I implemented a version in which a separate thread is used by hacking the 3DxTest you include. Using that application there are no more values at all after connecting when running the application.
The events may be going to a different window.
MarkusSenseGraphics wrote:If SI_ANY_DEVICE is used both applications work as they should.
But then you can't address individual devices.
MarkusSenseGraphics wrote:In our test application SI_DEVICE_CHANGE_EVENT are never caught. In the modified 3DxTest they are. I can for the life of me not figure out why. Both applications are tested on the same system and should therefore use the same driver and connections.
Use Spy to see where the events are going.
MarkusSenseGraphics wrote:I also, just to make sure, tested our API using the siappMT.lib versions (since I assume that refer to the MultiThreaded propery of runtime settings in visual studio). The results are the same.
That just indicates which CRT gets used.
MarkusSenseGraphics wrote:And my final question, as I read the license that comes with the installer distributing headers and libraries are fine as long as none of your dlls are distributed, dlls should be installed by users using your installers.
Right. That is so we can fix things in the DLLs and make changes for future devices, etc. The end-users should use the driver/DLLs that comes with his device.
MarkusSenseGraphics
Posts: 11
Joined: Tue Nov 27, 2012 2:39 am

Re: 3DxWare SDK Version 3

Post by MarkusSenseGraphics »

Thank you for your answer.

As it is now support using 3DxWare SDK Version 3 will not make it into our release since there are too many things I have to test with it.
I will look at it after the release is done however.
Deweg
Posts: 1
Joined: Tue Feb 26, 2013 9:48 am

Re: 3DxWare SDK Version 3

Post by Deweg »

Hi,

I tried running the demo applications in VS10. Release mode works fine, but debug mode throws an error message. The build in debug mode succeeds, its just that annoying error message.

Image

Is there any solution for this? What I saw in earlier replies, there was a suggestion to reinstall VS10. Anything beside it?
imnumberone
Posts: 7
Joined: Mon Jul 08, 2013 2:24 am

Re: 3DxWare SDK Version 3

Post by imnumberone »

You need to install VS2008 express edition, because we need some headers and libraries from this version
ngomes
Moderator
Moderator
Posts: 3330
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: 3DxWare SDK Version 3

Post by ngomes »

imnumberone wrote:You need to install VS2008 express edition, because we need some headers and libraries from this version
I don't think so. It appears the error comes up because of how the project is converted.
MarkusSenseGraphics
Posts: 11
Joined: Tue Nov 27, 2012 2:39 am

Re: 3DxWare SDK Version 3

Post by MarkusSenseGraphics »

Hello,

It is me again after many months.
I installed 3DxWare 10 Beta 16 (64-bit) on my system.
As well as 3DxWare SDK 3.02 r7538. Which seems to be the one I used before and also the one that can be obtained from 3DLabs.

There is an issue however, that shows up in both our product and 3DxTest. It used to be that I could specify either SI_ANY_DEVICE or device index 0 (if only one device) to get a connected device. This seems to not work anymore.

Am I using the wrong versions?
Or am I simply using it incorrectly. I was under the impression that I could use SiOpen with either SI_ANY_DEVICE or 0 to connect to a device, and I am quite sure it used to work, although not perfect.

Thank you for your reply.
jwick
Moderator
Moderator
Posts: 3336
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: 3DxWare SDK Version 3

Post by jwick »

Device #0 is just a notification device. It will tell you when devices come and go. You won't get axis/button events from it because it isn't a real device.

There are two ways of opening devices:

1) Legacy: SI_ANY_DEVICE opens whatever device is connected. If multiple devices are connected all the data streams are folded together. If the devices have different number of buttons, you will be told about the device with the most buttons. This is probably misleading for the other devices. Connection/disconnection is transparent to you.

2) Multiple-device-aware: Open each device individually (1-NumberOfDevices). You get individual handles for each device so you can do whatever you want with them. Say multi-handed control. Or just show the correct device to your end-user.
MarkusSenseGraphics
Posts: 11
Joined: Tue Nov 27, 2012 2:39 am

Re: 3DxWare SDK Version 3

Post by MarkusSenseGraphics »

Thank you.

I am stumped however.
3DxTest that comes with 3DConnexion works fine. With SI_ANY_DEVICE or 0 I get the SI_DEVICE_CHANGE_EVENT just fine. With SI_ANY_DEVICE I of course also get motion events.
However whenever I try to get this in our application it fails. SI_ANY_DEVICE gives motion events just fine. but no SI_DEVICE_CHANGE_EVENT. Using index 0 gives no SI_DEVICE_CHANGE_EVENT either.

I have tried the following:
- Our application did initialization in a separate thread. So I modified 3DxTest to do the same. In 3DxTest it worked fine.
- I modified our application to call the setup in main thread using the main window. That did not work either. still not catching SI_DEVICE_CHANGE_EVENT.
- I made sure both projects were using the same project settings (in visual studio). PREDEFINES, subsystem types, compile as C++ everything there is. No change in behavior for either project.
- I have checked and double checked that the same dlls are loaded and that they link against the same libraries.

The only difference I can still think of are:
- In our setup the initialization code is in a dll that is loaded by an exe-file. The exe file calls an exported symbol directly but maybe something goes bad anyways.

Can anyone think of anything else that might be the issue?
jwick
Moderator
Moderator
Posts: 3336
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: 3DxWare SDK Version 3

Post by jwick »

Did you create a profile for your application using the 3DxWare SDK template?
The default profile that is used if your application doesn't have a profile, has

<SendDeviceChangeEvent>false</SendDeviceChangeEvent>

so it doesn't send DeviceChange Events.
MarkusSenseGraphics
Posts: 11
Joined: Tue Nov 27, 2012 2:39 am

Re: 3DxWare SDK Version 3

Post by MarkusSenseGraphics »

Thank you for your answer.
Did you create a profile for your application using the 3DxWare SDK template?
Of course not, shame on me again. Always the fool I am.

To continue my folly. I can't find the following line
<SendDeviceChangeEvent>false</SendDeviceChangeEvent>
in C:\Users\markus\AppData\Roaming\3Dconnexion\3DxWare\Cfg\h3dload.xml (which is the file changed by the profile). I assume this is the file to modify. Where in this file should I add the line? Or where can I find information about the XML structure for the beta release? I also did not find any checkbox in the GUI. I will look a bit better there.

Some follow up questions regarding this.
- Can I somehow check in C++ that this option is enabled for the profile loaded when my application loads? It looks like I can use the functions in SiCfg.h. I will test those unless you tell me otherwise.
- We have a toolkit library and usually use one or two different loader programs to test this toolkit. However, we do have other exe-files. So, is the first argument to siOpen the name I should use for the config file? Or must a user create one profile for each loader that uses our toolkit? (In my case > 8 different profiles. Debug and release as well as 32 and 64 bit since the location and or name of the application exe might differ ).
- From which version number of 3DxWare can I use this functionality (the devicechange event)
- If I build our toolkit against the beta sdk. Will it work with the latest released 32 and 64 bit drivers (with the exception of the DeviceChange event of course) or must our users install the beta drivers?
MarkusSenseGraphics
Posts: 11
Joined: Tue Nov 27, 2012 2:39 am

Re: 3DxWare SDK Version 3

Post by MarkusSenseGraphics »

Sorry about the double post.
I tested with the new profile. Without editing it sends the correct events.
It looks like I have to create one profile for every program though. Since H3DLoad_d.exe does not send the event.
However, H3DLoad.exe works no matter where it is started from it seems like.
jwick
Moderator
Moderator
Posts: 3336
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: 3DxWare SDK Version 3

Post by jwick »

You currently need a profile for each application.

This SDK can be used with the previous releases but features implemented for 3DxWare 10 won't be there. You lose multiple-device support and Plug-n-Play (the DeviceChangeEvent). Normally you don't need to worry about the DeviceChangeEvent. Users usually don't bounce the driver. And if you use SI_ANY_DEVICE, the library will take care of driver bounces and PnP for you.
MarkusSenseGraphics
Posts: 11
Joined: Tue Nov 27, 2012 2:39 am

Re: 3DxWare SDK Version 3

Post by MarkusSenseGraphics »

Just one more (round of) question(s).

- We also have a test implementation which goes directly to the windows messaging system and handles the connections by reacting to WM_INPUT and other messages which are sent by the base driver. Apart from the issue of not getting the scale and min/max values (because those are kept in the config files I assume) we do have an issue with the driver sending HIDMouse_Wheel events (I enabled the service log) even though the profile (both the xml-file and the GUI) for the program is set to send HIDMultiAxis_Rx(y/z) events. Is this something you have seen? It looks like a bug to me. When using the 3DxWare SDK we do not get the mouse events.
This SDK can be used with the previous releases but features implemented for 3DxWare 10 won't be there. You lose multiple-device support and Plug-n-Play (the DeviceChangeEvent). Normally you don't need to worry about the DeviceChangeEvent. Users usually don't bounce the driver. And if you use SI_ANY_DEVICE, the library will take care of driver bounces and PnP for you.
I am perfectly fine with this as long as it starts and don't act all funny with incorrect move-events and such.
Post Reply