Device enumerating related errors

Hi devvvs,

I’m currently playing around with the Oculus Rift, and a plugin is ready, but there are issues.

Basically, a connection to the device is established, I get values and it reports that it’s connected, but I don’t get sensor values out of it.

I found a rather strange workaround which leads me to the conclusion that there is some bug in vvvv, as the code is coming from the Unity3D code provided by Oculus and I also tested it in a commandline C# application (both works without any problems).

Currently it only works if

  • some other application has a Rift connection open
  • I start vvvv
  • I close the other application
  • I load the Rift patch

If no other device has a connection open (just regularily starting vvvv), it does not work (connection gets established, but no sensor values reported).

The Rift SDK seems to not be able to report values to more than one process (it runs some kind of background thread, as it seems). Thus, for my Unity and Console applications, if I stop one, the other works again immediately; as long as vvvv is opened (without ever loading my patch or even the dll) neither works.

Can I somehow prevent vvvv from enumerating/doing whatever it does with the device? Or does any of you devvvs understand what I’m talking about and has an idea?
For me, it looks like vvvv does kind of “lock” the device on startup, preventing both itself as well as all other applications from properly accessing the sensors. Thus, if another application already did that, the vvvv code works properly by accessing the device on pressing the “Enable” pin.

any errors in tty/startup log? vvvv does enumerate your hid devices on startup. this oculus rift is a hid device too - reporting your head’s movement i guess. we use a library to do that device enumeration stuff. there’ve been issues in the past, so could be we hit one again. we moved to a newer version of it in a test branch but moved back to the old one for now as there’s no new stable release available yet. but you could try it with that build using the newer version. it should also report a little more to your startup log if an error occurs when enumerating the hid devices.
see daily/develop-jvcl-trunk/

No error is returned. Is there some way to see console outputs of embedded dlls? (I saw them in a c# test application I made, but they don’t end up in tty).

I will try this other version in the next days. For reference, here is my related thread on the Oculus forums asking whether the problem might be on their side (locking to the first application enumerating it, not the first one using it): https://developer.oculusvr.com/forums/viewtopic.php?f=34&t=1043.

No luck with the jvcl-trunk version, unfortunately.
And I don’t even see some info about the HID “Tracker DK” in the startup:

[13:48:56.643](13:48:56.643) everything you know is wrong
[13:48:56.643](13:48:56.643) Adding lib\thirdparty\x86 to PATH.
[13:48:56.652](13:48:56.652) creating SplashScreen
[13:48:56.657](13:48:56.657) creating GClock
[13:48:56.665](13:48:56.665) creating GMainloop
[13:48:56.665](13:48:56.665) creating GLog
[13:48:56.666](13:48:56.666) creating GApplication
[13:48:56.666](13:48:56.666) creating GGlobals
[13:48:56.666](13:48:56.666) installing mouse hook for render windows
[13:48:56.666](13:48:56.666) creating global keyboard for render windows
[13:48:56.666](13:48:56.666) creating global mouse for render windows
[13:48:56.666](13:48:56.666) creating global mouse
[13:48:56.666](13:48:56.666) creating global keyboard
[13:48:56.666](13:48:56.666) creating device listener
[13:48:56.666](13:48:56.666) creating HID device controller
[13:48:56.693](13:48:56.693) creating GNodeFactory
[13:48:56.694](13:48:56.694) creating Gex9Base
[13:48:56.697](13:48:56.697) Direct3D9 initialized.
[13:48:56.715](13:48:56.715) ExceptionDialog is enabled.
[13:48:56.724](13:48:56.724) enumeratig Game Devices...
[13:48:56.761](13:48:56.761) found Game Devices: "3Dconnexion KMJ Emulator","Unified Virtual HID","Cyborg V.1"
[13:48:56.761](13:48:56.761) enumerating Midi Input Ports...
[13:48:56.761](13:48:56.761) found Midi Input Ports: 
[13:48:56.761](13:48:56.761) enumerating Midi Output Ports...
[13:48:56.762](13:48:56.762) found Midi Output Ports: "Microsoft GS Wavetable Synth"
[13:48:56.763](13:48:56.763) enumeratig TAPI Devices...
[13:48:56.763](13:48:56.763) found TAPI devices: 
[13:48:56.765](13:48:56.765) enumeratig Audio Renderer Devices...
[13:48:56.774](13:48:56.774) found Audio Renderer Devices: "Default DirectSound Device","Default WaveOut Device"
[13:48:56.774](13:48:56.774) enumeratig Midi Renderer Devices...
[13:48:56.774](13:48:56.774) found Midi Renderer Devices: "Default MidiOut Device","Microsoft GS Wavetable Synth"
[13:48:56.775](13:48:56.775) enumeratig External Renderer Devices...
[13:48:56.775](13:48:56.775) found External Renderer Devices: 
[13:48:56.776](13:48:56.776) enumeratig Audio Input Devices...
[13:48:56.777](13:48:56.777) found Audio Input Devices: "Mikrofon (4- Logitech Microphon","Stereomix (Realtek High Definit"
[13:48:56.778](13:48:56.778) enumeratig Video Input Devices...
[13:48:56.782](13:48:56.782) found Video Input Devices: "Logitech QuickCam Fusion"
[13:48:56.802](13:48:56.802) creating MainForm
[13:48:56.832](13:48:56.832) creating AddonHost
[13:48:57.477](13:48:57.477) creating NodeBrowser, WindowSwitcher, Kommunikator
[13:48:57.481](13:48:57.481) creating HIDDeviceController
[13:48:57.505](13:48:57.505) scanning for Externals
[13:48:58.794](13:48:58.794) vvvv is up and running

while it appears in the HID list afterwards:

it would only log errors while enumerating - see line creating HIDDeviceController. hmm, plug it out, start vvvv, open tty and plug it back in?

This is the tty output for plug out, start vvvv, plug in:

00:00:17  -  : enumerating game devices
00:00:17  -  : Hid (Human Interface Devices) DeviceController - OnDeviceChange
00:00:17  -  : Hid (Human Interface Devices) DeviceController - OnDeviceChange

(Yes, two OnDeviceChange messages)

Note that with this, the Oculus still not works (does not return sensor values). So the only way I’ve found to made it work is to start another application which accesses the device, then start vvvv, close the other application, then load the patch.

See also this contribution, where I uploaded the current state.
http://goo.gl/pV33V (Shortened because forum messes up URL)

Here is an answer from one of the Oculus developers; I think we already know that, but can we do anything about it?

turns out to be our fault. a handle wasn’t closed properly. fixed in upcoming.

Hi guys,

I’m quite new to the vvvv scene in terms of HIDs.

I’m trying to build an interactive game that tracks a user’s movements and uses them to recreate a sporting activity (100m sprint, for example).

I’m using an ASUS ProLive camera for the tracking - based on PrimeSense, very similar to Microsoft Kinect (it uses the Kinect (Devices OpenNI) node). One problem I’m having is that if I open the patch and the computer hasn’t detected the camera, or if I open it without the camera connected at all, my TTY Renderer gets flooded with errors - below is what seems to be repeatedly outputted:

00:00:33 ERR : OpenNI.StatusException in OpenNI.Net: Can't create any node of the requested type!

Stacktrace:
   at OpenNI.UserGenerator.Create(Context context, Query query, EnumerationErrors errors)
   at VVVV.Nodes.Skeleton2OpenNI.Evaluate(Int32 SpreadMax)

00:00:33 ERR : OpenNI.StatusException in OpenNI.Net: Can't create any node of the requested type!

Stacktrace:
   at OpenNI.UserGenerator.Create(Context context, Query query, EnumerationErrors errors)
   at VVVV.Nodes.Users.Evaluate(Int32 SpreadMax)

00:00:33 ERR : OpenNI.StatusException in OpenNI.Net: Can't create any node of the requested type!

Stacktrace:
   at OpenNI.ImageGenerator.Create(Context context, Query query, EnumerationErrors errors)
   at VVVV.Nodes.Texture_Image.Evaluate(Int32 SpreadMax)

If I delete the Kinect node the errors stop, but my problem is that the errors affect the rest of the program and seem to cause it to crash.

I have tried putting the context outlet through a Switch (Node Input) and that reduces the TTY Renderer to:

00:13:41 ERR : OpenNI.StatusException in OpenNI.Net: Can't create any node of the requested type!

Stacktrace:
   at OpenNI.UserGenerator.Create(Context context, Query query, EnumerationErrors errors)
   at VVVV.Nodes.Users.Evaluate(Int32 SpreadMax)

Does anyone know if there is a definitive way to stop all the Kinect information being passed through the patch if the device is not detected?

Any help would be really appreciated, thank you!

Calum

hei calum,
this is likely not related to this topic (which already has been solved) so please start a new topic next time.

it looks to me like a specific kinect/openni problem that would need some debugging. but sounds quite doable… sources are up here:
https://github.com/vvvv/vvvv-sdk/tree/develop/vvvv45/addonpack/src/nodes/plugins/Devices/OpenNI

and you’d get them by following the steps in vvvv-sdk.

Hi @joreg

Thanks for the quick reply. I’m sorry about posting here, I thought it was the right place but I’ll start a fresh next time.

Thanks for the help! I’ll do my best with the links.