Kinect hangs up suddenly after working pretty well a few seconds. How can I fix it? - kinect

I tried using "Kinect for Windows" on my Mac. Environment set-up seems to have gone well, but something seems being wrong. When I start some samples such as
OpenNI-Bin-Dev-MacOSX-v1.5.4.0/Samples/Bin/x64-Release/Sample-NiSimpleViewer
or others, the sample application start and seems working quite well at the beginning but after a few seconds (10 to 20 seconds), the move seen in screen of the application halts and never work again. It seems that the application get to be unable to fetch data from Kinect from certain point where some seconds passed.
I don't know whether the libraries or their dependency, or Kinect's hardware itself is going wrong (as for hardware, invisibly broken or something), and I really want to know how to detect which is it.
Could anybody tell me how can I fix the issue please?
My environment is shown below:
Mac OS X v10.7.4 (MacBook Air, core i5 1.6Ghz, 4GB of memory)
Xcode 4.4.1
Kinect for Windows
OpenNI-Bin-Dev-MacOSX-v1.5.4.0
Sensor-Bin-MacOSX-v5.1.2.1
I followed instruction here about libusb: http://openkinect.org/wiki/Getting_Started#Homebrew
and when I try using libfreenect(I know it's separate from OpenNI+SensorKinect), its sample applications say "Number of devices found: 0", which makes no sense to me since I certainly connected my Kinect to MBA...)

Unless you're booting to Windows forget about Kinect for Windows.
Regarding libfreenect and OpenNI in most cases you'll use one or the other, so think of what functionalities you need.
If it's basic RGB+Depth image (and possibly motor and accelerometer ) access libfreenect is your choice.
If you need RGB+Depth image and skeleton tracking and (hand) gestures (but no motor, accelerometer access) use OpenNI. Note that if you use the unstable(dev) versions, you should use Avin's SensorKinect Driver.
Easiest thing to do a nice clean install of OpenNI.
Also, if it helps, you can a creative coding framework like Processing or OpenFrameworks.
For Processing I recommend SimpleOpenNI
For OpenFrameworks you can use ofxKinect which ties to libfreenect or ofxOpenNI. Download the OpenFrameworks packaged on the FutureTheatre Kinect Workshop wiki as it includes both addons and some really nice examples.

When you are connecting the Kinect device to the machine, have you provided external power to it? The device will appear connected to a computer by USB only power but will not be able to tranfer data as it needs the external power supply.
Also what Kinect sensor are you using? If it is a new Kinect device (designed for Windows) they may have a different device signature which may cause the OpenNI drivers to play-up. I'm not a 100% on this one, but I've only ever tried OpenNI with an XBox 360 sensor.

Related

Kinect 2.0 for Xbox One to PC USB 3.0 keeps disconnecting?

Does anyone here use USB 3.0, and can tell me why when I plugin my Xbox One Kinect 2.0 USB 3.0 cable into the computer, why it keeps sporadically disconnecting and reconnecting even though I downloaded all the windows updates, all the graphics card updates, all the firmware updates, etc...? And YES, I tried several different Ports. It's not broke. I got it new for Christmas.
After fighting with this for weeks, I finally found the root of my frequent disconnects. At some point, I had disabled the Xbox NUI Sensor Microphone Array to eliminate a feedback loop:
Control Panel > Hardware and Sound > Sound > Recording
After re-enabling the Kinect microphone, the Kinect stopped disconnecting.
To eliminate the feedback loop, I reduced the Kinect microphone's level setting to 0. You can get to the level setting from the Recording tab in the Sound dialog. Select the Xbox NUI Sensor Microphone Array and click the Properties button. From there, select the Levels tab.
I had a similar issue and I kept trying every thing for days, and finally the issue turned to be from the kinect AC adaptor... I tried it with the official windows sdk and developer toolkit, when I attempted one of the example codes the issue persists to appear but with a clear message asking to plug the power cord in, though the adaptor is brand new!!
I searched for some information a bout the AC adaptor and it seems that there is a problem with the adaptor, and most importantly the Kinect manual states that any unoriginal adaptors may cause the device to fail - also the manual says that original AC adaptor power output is 12V-1.1A while the one I have is rated 12V-1.08A (no big deal but who knows)
Kinect for Xbox 360 freezes and disconnects from USB after running Processing SimpleOpenNi depth image example
I had this problem,too. My system using pci-e usb 3 gen 2 and in windows 10 v1903 and kinect sdk 2 ... and all thing OK.. worked correctly .then after a date .reapetdly disconnect and restart.
at last ..I found this problem on my system...
I disabled sound using in windows setting.
I enabled this item in setting and all things became OK.
Read this, if you use an USB3.0 expansion card in a PCIe slot.
In my case I had connected the adaptor to an USB3.0 card (Transcent PDU3). After some hours research I discovered that the mainboard (MSI K9a2 Platinum) had Gen2 PCIe for the PCI-E x16 slots, but not for the PCI-E x1 I had plugged the USB card into. After switching to a PCI-E x16 slot, the constant disconnecting was over.
Don't confuse PCIe version and USB version here. For a Kinect 2.0 you need USB 3.0 and for USB 3.0 to run at super speed, you need PCIe 2.0 (or Gen2).
Testing PCIe version
You can use GPU-Z to determine which PCIe-Version the slot has where you got your graphics card plugged in -- let the mouse pointer hover over the bus interface field and wait for the tooltip and it will reveal the PCI-e version of your graphics card as well as the one of your mainboard. If you confirm it is Gen2 (or PCI 2.0) try to use that slot to put a confirmed-as-working-with-the-Kinect-2-USB3.0-card in it. (Having onboard graphics or a second PCI-Ex16 slot will definitely come in handy here).
Hope this helps.
I think it has to do with the USB 3.0 version, older machines won't run it. You need USB "3.1" and controllers usually manufactured after 2013 have it. It's often mislabelled as USB 3.0 in marketing material. USB 3.1 is also known as "SuperSpeed" or "SS10" which goes up to 10 Gbit/s. USB 3.0 "only" transports at 5 Gbit/s.
I have two five years old big rigs (Z68X-UD3H-B3, i7-3770K, and a 970a-D3, FX-8350) and it constantly disconnects. Both have 2011 board technology.
I also have two laptops, a VAIO and a Lenovo, which were built after 2013 (when they changed to USB 3.1) and it runs fine on both of those machines.
I too suspected the power supply at one point, nope, I thought I had a broken Kinect (bought a second, nope, now I own two.)
Other things to check:
- You might be able to use a USB 3.1 PCI card as long your MotherB will carry it.
- Remember to load the Kinect SDK 2.0 and also update the driver to the 2016 driver (SDK 2.0 comes with the 2014 driver).
- Remember USB 3.x is the "Blue" USB plug not the black.
This is not a case of requirements increasing beyond the capabilities of USB3.0!
Its also not a problem with Win10 1809 or KinectSDK 1409.
It will disconnect if your apps have no access to either microphone or camera.
You can check or reset your settings the easiest with a free program called OOSU10.
Runs fine on my 2012 laptop.
If your problem is that the Kinect Configuration Verifier does not start at all, then this is caused by having disabled the printer spooler service.

Kinect Infrared Camera Not working

I am using the Kinect 2 with the newest available SDK version 2.0. Everything works except IR, tested it with both SDK infrared demo example and Kinect Studio, both result in a black screen. I also looked at the code and capturing Kinect IR frames does not result in any errors, it just consists of all minimum values.
This is quite weird, as I thought IR was used to calculate depth and I can successfully read depth information. Also, I checked (with my cellphone camera) that the IR emitter is turned on and off correctly, just data is not received correctly for some reason.
After encountering the problem I made a fresh install on another computer, as I suspected I had broken my system somehow. I got exactly the same results after installing Kinect SDK. Everything except infrared works.
Has anyone seen this kind of behaviour before?
check this out
https://social.msdn.microsoft.com/Forums/en-US/70dcceb7-8d2f-485f-b3e9-f2d4b399fbe7/kinect-v2-infrared-not-working?forum=kinectv2sdk
try updating graphics card drivers

Color and depth stream don't work anymore

I used until yesterday afternoon a Kinect for XBOX 360 on my computer, a MacBook Pro 15" Late 2011, whose specifications are available here. I use Windows 7 (natively installed, without using virtual machines). The version of the SDK I had installed was 1.0.
All of a sudden, from today the Kinect no longer worked. Initially I thought it was some error in my code, but I noticed that the program remained stuck at the beginning, when I called the method KinectSensor.Start().
I started looking for information on the internet. I read about a solution obtained by reinstalling the drivers. It did not work, and then I tried to install version 1.6 of the SDK. Unfortunately, even that did not work.
I've seen at this stage, there might be compatibility issues with certain USB host controllers, such as the Intel 5 Series/3400 Series Chipset USB host controller. In my case, however, there should be no problems (because there were not ever been up to yesterday):
To check if the problem was really due to the sensor, and not to my application, I run one of the test applications provided with the SDK, called Kinect Explorer. However, I encountered the same problem with this test application. After waiting about one minute, when the Kinect Explorer starts I cannot see neither the color stream, nor the depth stream, nor information about skeleton. The only thing I can do is move the Kinect up and down, changing the angle of the neck. Even the microphone array seems to work properly.
I read two interesting posts about this kind of problem: this and this, which have not been answered.
In the first of these two links, the user who reports the problem says that the hardware has been compromised. I thought the same thing myself until I started again Kinect Explore, initially with the sensor unplugged. Once started this program, I plug-in the cable, and I noticed that Kinect Explorer has marked the Kinect sensor as Connected. After a short initialization phase, I again see the color stream, while the depth stream showed an image of uniform color (green-gray):
This situation lasted a few seconds, after which the image is locked and the question came up. Also, sometimes the FPS value drops from 30 to 29.
I am able to reproduce this latter situation only after keeping the Kinect unplugged for a while (10 minutes are sufficient).
How can I solve this strange and terrible problem? Is it possible to restore the Kinect sensor, and make it works again? Or do I have to conclude that the sensor is irretrievably broken?

USB programming

I want to program a microcontroller (AVR) to control some leds through USB. It's just out of interest in how to build and program USB devices.
There are some AVR microcontrollers that support the USB protocol or I could implement the USB protocol in an another microcontroller myself, but I wonder what to use to write your own drivers on the computer.
My level in system programming: total noob (hence the question)
So what is the literature you people would advice to get good knowledge of the USB technology and how to write your own drivers and beyond?
P.S.: I know:
C (probably will need it here)
Java (probably won't need it here)
Python (hope can use it here)
assembler (hopefully won't need it here XD).
...
P.P.S: driver development differs for different OS's. I use Linux and Windows, so any material related to one or both of these systems is welcome.
Well, although you can develop and write your own USB driver, the beauty of USB is that you don't need to write your own driver. the USB Implementers Forum has defined class specifications for all the standard device classes. If you can make your device fit into a standard device class the driver has already been written for you!
If you truly want to become familiar with USB development, you should start by reviewing the USB approved class specification documents.
If you are into framework for AVR microcontrollers with hardware USB then take a look into LUFA, and if you are into AVRs with software USB then look into V-USB. They have both implemented many USB classes so you don't have to do it on your own - just use them.
That sounds like a great project! I'd suggest starting off with something a little simpler since you're - as you say - a "total n00b". I'm not sure what hardware you currently have (or have in mind) but what I would suggest for the total beginner is the STK500. It's a development board that's very well supported in both Linux and Windows and will give you the most flexibility. It comes with LEDs and switches built in for your projects, but you will need to get a microcontroller. And for that I recommend the ATMega32, a great multi-purpose IC that's also well supported and has lots of documentation on the web.
Once you get those I suggest you do your development on Linux using avr-gcc (make sure to also install avr-libc). If you're using Ubuntu it's easy to get all the packages you need:
% sudo apt-get install gcc-avr avr-libc avrdude
Those should get you up and running. I'd suggest Googling around for help writing your first programs but another good resource is the online materials for this class at Cornell.
That's enough to get your feet wet with AVR microcontrollers and the development tools. The sky is the limit at that point but since you said you want to get into USB I'd suggest using the excellent V-USB framework to have your ATMega32 act as a USB device. After that, as they say, the steps to flipping LEDs are a piece of cake :).
I wonder what to use to write your own
drivers on the computer
libusb (here, here and here)
wdk
WinDriver
For libusb variants info read this
You could us libusb. It's powerful and cross-platform.
But what you're trying to do is a rather simple control interface. You can sidestep most of the complexity by using HIDAPI, I think.
http://www.signal11.us/oss/hidapi/
HID devices often use generic drivers that come packaged into the OS. That way you don't actually have to write any drivers ever, you just make your device compliant with the generic driver and tailor the client software to it.
I think this is what's usually done in the hobbyist electronics field, which is what you're interested in here.
HIDAPI is even recommended for simple communications with HID devices in the libusb FAQ since its a bit more complicated to do it across platforms using libusb.
One good way to go is just to develop a HID device, since the driver is built in to most higher level OSes and pretty flexible for simple IO like you are talking about. Another good option is just using a USB RS232 device or software. I use PICs which have a number of nice devices with USB onboard.
I had built my own test bed based on the ARDUINO UNO and i was using the ionlabs programmer of type usbasp and it worked perfectly fine but it did not allow to convert the TTL back to Rs-232 and hence i couldn't use the features such as serial.print() and i had to install the ftdi cable which allowed me to do this.
The drivers were the libusb 1.xx working just fine.
If you want to program the AVR you can use the ARDUINO software bundle or the stino to upload the programs.
You need to know c(only basics).
I created a USB-keyboard adapter last year for my capstone. I did not do the host programming but used existing code that you can find on the web.But I did program the device side and for that I got a lot of help from this website Teensy Look into their "Code Library" which has code for Keyboard, Mouse and others. Also, the USB protocol handbook will always be useful and you should always consult it when you are doing stuff with USB.
I wonder whether your AVB acts as a host or device. I guess your board is a usb device and you need to light the leds on your board. So, it may be a good way to initialize your board as a HID device. To achieve this goal, you need a HID gadget software stack running on your board. References as follows:
gadget framework in uboot
HID specefication usb org
debug tools such as USB Protocol Analyzer
libusb running on Host PC to send packets
The Microsoft documentation area of the WDK (Windows Development Kit) is recently available on MSDN. There is a section on USB, though you would be best to read the earlier sections first, in particular the "Getting Started" areas. They assume you'll be using C as the programming language for driver development.
WDK Site
WDK - USB Section
For Linux, the Linux USB website should be able to point you in the right direction. In particular you'll want the Programming Guide for Linux USB Device Drivers.

USB for embedded devices - designing a device driver/protocol stack

I have been tasked to write a device driver for an embedded device which will communicate with the micro controller via the SPI interface. Eventually, the USB interface will be used to download updated code externally and used during the verification phase.
My question is, does anyone know of a good reference design or documentation or online tutorial which covers the implementation/design of the USB protocol stack/device driver within an embedded system? I am just starting out and reading through the 650 page USB v2.0 spec is a little daunting at the moment.
Just as a FYI, the micro controller that I am using is a Freescale 9S12.
Mark
Based upon goldenmean's (-AD) comments I wanted to add the following info:
1) The embedded device uses a custom executive and makes no use of a COTS or RTOS.
2) The device will use interrupts to indicate data is ready to be retrieved from the device.
3) I have read through some of the docs regarding Linux, but since I am not at all familiar with Linux it isn't very helpful at the moment (though I am hoping it will be very quickly).
4) The design approach, for now at least, it to write a device driver for the USB device then a USB protocol layer (I/O) would reside on top of the device driver to interpret the data. I would assume this would be the best approach, though I could be wrong.
Edit - A year later
I just wanted to share a few items before they vanish from my mind in case I never work on a USB device again. I ran into a few obstacles when developing code and getting it up and running for the first.
The first problem I ran into was that when the USB device was connected to the Host (Windows in my case) was the host issues a Reset request. The USB device would reset and clear the interrupt enable flags. I didn't read the literature enough to know this was happening, thus I was never receiving the Set-Up Request Interrupt. It took me quite a while to figure this out.
The second problem I ran into was not handling the Set-Up Request for Set_Configuration properly. I was handling it, but I was not processing the request correctly in that the USB device was not sending an ACK when this Set-Up Request came in. I eventually found this out by using a hardware USB protocol analyzer.
There were other issues that I ran into, but these were the two biggest ones that took me quite a while to figure out. The other issue I had to worry about is big-endian and little-endian, Freescale 9S12 vs USB data format (Intel), respectively.
I ended up building the USB device driver similar to UART device drivers I had done in the past. I have posted the code to this at the following URL.
http://lordhog.wordpress.com/2010/12/13/usb-drive
I tend to use structures a lot, so people may not like them since they are not as portal as using #defines (e.g., MAX3420_SETUP_DATA_AVAIL_INT_REQR 0x20), but I like them since it makes the code more readable for me. If anyone has questions regarding it please feel free to e-mail and I can try to give some insight to it. The book "USB Complete: The Developer's Guide" was helpful, so long as you knew what areas to concentrate on. This was a simple application and only used low-speed USB.
While writing a device driver for any interface (USB, Parallel port, etc...) the code needed to be developed would depend upon whether there is any Operating System(OS), RTOS running on that Processor/Micro controller.
e.g. if thats going to run say WinCE - It will have its own Driver development Kit , and steps to be followed in the device driver development. Same for any other OS like Linux, symbian.
If its going to be a plain firmware code(No OS) which is going to control the processor/microcontroller, then it's a different situation altogether.
So based on either of the above situation u are in, one needs to read & understand:-
1.) The Hardware Specification of the processor/micro controller development board - Register files, ports, memory layout, etc.
2.) USB spec
3.) Couple of pointers i found quickly. Google shud be ur friend!
http://www.lrr.in.tum.de/Par/arch/usb/usbdoc/ - Linux USB device driver
http://www.microsoft.com/technet/archive/wce/support/usbce.mspx
-AD
I've used an earlier edition of USB Complete by Jan Axelson. Indeed very complete.
From the editorial review:
Now in its fourth edition, this developer's guide to the Universal Serial Bus (USB) interface covers all aspects of project development, such as hardware design, device firmware, and host application software.
I'm curious, why did you pick the 9S12? I used it at a previous job, and was not pleased.
It had lousy gcc support so we used Metrowerks
which may have been okay for C, but often generated buggy C++
had a lousy IDE with binary project files!
The 9s12 was also slow, a lot of instructions executed in 5 cycles.
Not very power efficient, either.
no barrel shifter, made operations that are common in embedded code slow
not that cheap.
About the only thing I dislike more is an 8051. I'm using an ARM CortexM3 at my current job, it's better than a 9S12 in every way (faster clock, more work done per clock, less power consumption, cheaper, good gcc support, 32-bit vs. 16-bit).
I don't know which hardware you're planning to use but assuming that's flexible, STMicro offers a line of microcontrollers with USB/SPI support and a library of C-code that can be used with their parts. -- I've used their ARM7 series micros for years with great success.
Here is an excellent site maintained by Jonathan Valvano, a professor at the University of Texas. He teaches four courses over there (three undergraduate, one graduate), all are about using a 9S12 microcontroller. His site contains all the lecture notes, lab manuals, and more importantly, starter files, that he uses for all his classes.
The website looks like it's from the 90's, but just dig around a bit and you should find everything you need.
users.ece.utexas.edu/~valvano/
Consider AVR for your next MCU project because of it's wonderful LUFA and V-USB libraries.
I'm working on a project using the Atmel V71. The processor is very powerful and among lot's of high end connectivity offered on chip is a USB engine that will do device or host modes for 480 Mhz or 48Mhz (not USB 3.0). The tools are free and come with a number of host and device USB example projects with all the USB stack code right there. It supports 10 end points and all the transfers are done via DMA so you have most of the processor horsepower available for other tasks. The Atmel USB stack works without needing an RTOS