Linux and Primesense - linux

I have for a longer time tried to get my Asus Pro Live sensor to work on Linux, currently Fedora, but I have tried ubuntu 12.04 and Ubuntu 13.10 as well. I have installed openni, openni2 and sensor_master on my computer. Everything compiles, but when I try to run NiViewer, all I get is
Could not open "1d27/0600#3/4": Failed to set USB interface!
The 55-primesense-usb.rules file is present in /etc/udev/rules.d/ and when I type lsusb it says:
Bus 003 Device 004: ID 1d27:0600 ASUS
I have googled for it but cannot find anything helpful. Does anyone have a clue where the problem is?
Some of the output from dmesg:
[55363.811218] usb 3-4: new high-speed USB device number 6 using xhci_hcd
[55363.826016] usb 3-4: New USB device found, idVendor=1d27, idProduct=0600
[55363.826018] usb 3-4: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[55363.826019] usb 3-4: Product: PrimeSense Device
[55363.826021] usb 3-4: Manufacturer: PrimeSense
[55363.826609] usb 3-4: Not enough bandwidth for new device state.
[55363.826614] usb 3-4: can't set config #1, error -28
[56819.384811] usb 3-3: USB disconnect, device number 5
I have tried both usb 2.0 and 3.0 and it works in windows.
/ Erik

The Asus Pro, like any other webcam, needs to reserve USB bandwidth, and this should be adaptive depending on the actual capture resolution and bandwidth, but that is not always the case: many WebCams, like Logitech C910 "preventively" reserve a chunk of USB capacity large enough to prevent other webcams from using it. The UVC driver, which is pervasively used in Linux knows about this under the feared I get a "No space left on device" (-28) error when trying to stream from more than one camera simultaneously., see UVC driver FAQ. This seems to be your issue. Trying to connect the cameras in your system in different USB port configurations can help.

Related

linux virtual comport driver for ARM cortex A8

I have been working on this problem for quite a while now and cannot seem to find the correct driver for Linux to interface with an STM32F407. The Linux runs on an AR drone 2.0. The STM already acts as a virtual Com-port as itself when I connect it to my computer and then I can interact with it. On the AR drone 2.0 it is not listed as a COM-port but it does detect it as a USB device when I attach it. When I telnet it, it gives me this information:
Bus 001 device 002: ID 0483:5740 SGS Thomson Microelectronics
Bus 001 device 001: ID 1d6b:0002
The first one is obviously the one I need to look at and I looked at the vendor ID on this website. http://www.linux-usb.org/usb.ids
this vendor ID gave me indeed the STM32F407, but I cannot find the Linux driver for this device. I was able to put the STM into a Linux computer and then looked at what driver it used.
It was the CDC_AMC driver. I looked it up but now I have the next problem.
it needs the virtual COM-Port driver to interact with the STM32.
The Drone runs on a busybox Linux version v1.14.0 and I have not enough experience with Linux to know what driver I have to use and where I can find it.
Does it also have something to do with what processor it uses? In that case, the drone has a: ARM Cortex A8 1 GHz 32-bit processor
The following is seen in the output of dmesg:
usb 1-1: new full speed USB device using musb_hdrc and address 2 ecc correction in bits 939,
usb 1-1: skipped 4 descriptors after interface
usb 1-1: default language 0x0409
usb 1-1: udev 2, busnum 1, minor = 1
usb 1-1: New USB device found, idVendor=0483, idProduct=5740
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: Pozyx Virtual ComPort in FS Mode
usb 1-1: Manufacturer: Pozyx Labs
usb 1-1: SerialNumber: 396D323F3336
usb 1-1: uevent

USB<>serial communication not working on linux

I'm currently working on a project in which I have to communicate with a custom-made sonar board over an USB<>Serial connection with cts/rts hardware flow control at a baud rate of 4,499,456.
MATLAB code for sending and receiving data is already available and fully tested on Windows.
The problem occurs when trying to execute the MATLAB code on linux (Ubuntu 14.10/15.04). Both the commands for toggling the LED on the board (write) as well as receiving information (read) are not working.
Python ports of the MATLAB code using the pyserial and pylibftdi library do allow writing, but also hang on receiving data.
Does anyone have any idea as to why it does work on Windows but not Ubuntu? Maybe a driver issue? Or something having to do with cts/rts on Linux?
lsusb output
Bus 002 Device 004: ID 0403:6014 Future Technology Devices International, Ltd FT232H Single HS USB-UART/FIFO IC
dmesg output
[11906.209231] usb 2-3: new high-speed USB device number 5 using ehci-pci
[11906.346701] usb 2-3: New USB device found, idVendor=0403, idProduct=6014
[11906.346713] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[11906.346720] usb 2-3: Product: USB <-> Serial Converter
[11906.346725] usb 2-3: Manufacturer: FTDI
[11906.346730] usb 2-3: SerialNumber: FT69T4N
[11906.351716] ftdi_sio 2-3:1.0: FTDI USB Serial Device converter detected
[11906.351800] usb 2-3: Detected FT232H
[11906.352234] usb 2-3: FTDI USB Serial Device converter now attached to ttyUSB1
Edit: Just logging my progress in case somebody encounters the same issue. The problem seems to lie in the baudrate; changing it to 115200 allows reading from the device, but messes up sending data to it.
Apparently the FTDI driver doesn't work to well with very high/non-standard baudrates. I ended up solving this by using a baudrate of 3,000,000

Smart card reader detection on Linux

I have a smart card reader called SK-284. It support two communication methods, RS232 and USB.
In my case only USB is enable. When I connect this device to my Linux laptop, via USB, It wont get detected. I run '$dmesg' command to check on which ttyUSB port it get detected, I got following output,
[ 2321.208330] usb 2-1.2: new full-speed USB device number 7 using ehci_hcd
[ 2321.384628] generic-usb 0003:8203:8288.0003: hiddev0,hidraw1: USB HID v1.10 Device [\xffffffe6\xffffffb7\xffffffb1\xffffffb7\xffffffb1\xffffffe5\xffffff9c\xffffffb3\xffffff9c\xffffffb3\xffffffe5\xffffff88\xffffff9b\xffffff88\xffffff9b\xffffffe8\xffffff87\xffffffaa\xffffff87\xffffffaa\xffffffe6\xffffff8a\xffffff80\xffffff8a\xffffff80\xffffffe6\xffffff9c\xffffffaf\xffffff9c\xffffffaf\xffffffe6\xffffff9c\xffffff89\xffffff9c\xffffff89\xffffffe9\xffffff99\xffffff90\xffffff99\xffffff90\xffffffe5\xffffff85\xffffffac\xffffff85\xffffffac\xffffffe5\xffffff8f\xffffffb8\xffffff8f\xffffffb8 CRT450 USB 1.1] on usb-0000:00:1d.0-1.2/input0
[ 2326.634925] usb 2-1.2: USB disconnect, device number 7
[ 2326.855479] usb 2-1.2: new full-speed USB device number 8 using ehci_hcd
[ 2326.954303] usb 2-1.2: config index 0 descriptor too short (expected 9, got 0)
[ 2326.954310] usb 2-1.2: can't read configurations, error -22
[ 2327.027211] usb 2-1.2: new full-speed USB device number 9 using ehci_hcd
[ 2327.171371] generic-usb 0003:CEA0:2840.0004: hiddev0,hidraw1: USB HID v1.10 Device [\xffffffe6\xffffffb7\xffffffb1\xffffffb7\xffffffb1\xffffffe5\xffffff9c\xffffffb3\xffffff9c\xffffffb3\xffffffe5\xffffff88\xffffff9b\xffffff88\xffffff9b\xffffffe8\xffffff87\xffffffaa\xffffff87\xffffffaa\xffffffe6\xffffff8a\xffffff80\xffffff8a\xffffff80\xffffffe6\xffffff9c\xffffffaf\xffffff9c\xffffffaf\xffffffe6\xffffff9c\xffffff89\xffffff9c\xffffff89\xffffffe9\xffffff99\xffffff90\xffffff99\xffffff90\xffffffe5\xffffff85\xffffffac\xffffff85\xffffffac\xffffffe5\xffffff8f\xffffffb8\xffffff8f\xffffffb8 CRT284 USB 1.1] on usb-0000:00:1d.0-1.2/input0
My laptop specification:
OS: Ubuntu 12.04
Kernel: 3.2.0-54-generic-pae
When I connect same device to Windows 7 and run device manager, It got detected under Human Interface Device (HID). and some test applications are running fine.
My task is to write a small code on Linux to detect the smart card by device.
So where do I get to know on which ttyUSB port is used by this device, or any other method to get connected to this device.
Thanks in advance.
You may try to change some parameter in usbcore module:
echo y > /sys/module/usbcore/parameters/old_scheme_first
and then replug you usb-device.
As it is full-speed device (not hi-speed) you may also do such thing:
rmmod ehci-hcd
insmod uhci-hcd
insmod ohci-hcd
It seems like there is problem in usb communication. Probably on the usb-device side, because usb-host expects 9 bytes but usb-device sends 0 bytes.

USB host and device functionality on SBC 6845 board using kernel modules

I am working on SBC 6845(Atmel processor) in linux embedded development. My kernel version is 2.6.30.
This board comes with 2 USB ports(Both with Type A), one can be configured as host and other as USB device.
I have configured these USB modules in kernel. I have burned kernel and file system with necessary modules including USB modules. I have loaded these USB modules through /init.d/rcS file.
When board turns on and I type lsmod on console it shows me these modules loaded.
When I connect board to computer, USB is not detected (device functionality).
When I connect pendrive to board, it is not detected (host functionality).
/init.d/rcS Script
#install USB Gadgate mass_storage
modprobe g_file_storage file=/home/mass_storage/backed_storage_file stall=n
losetup -o 4096 /dev/loop0 /home/mass_storage/backed_storage_file
#install USB ehci-hcd
modprobe ehci-hcd
rcS running log
g_file_storage gadget: File-backed Storage Gadget, version: 20 November 2008
g_file_storage gadget: Number of LUNs=1
g_file_storage gadget-lun0: ro=0, file: /home/mass_storage/backed_storage_file
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
atmel-ehci atmel-ehci: Atmel EHCI UHP HS
atmel-ehci atmel-ehci: new USB bus registered, assigned bus number 1
atmel-ehci atmel-ehci: irq 22, io mem 0x00800000
atmel-ehci atmel-ehci: USB 2.0 started, EHCI 1.00
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: Atmel EHCI UHP HS
usb usb1: Manufacturer: Linux 2.6.30 ehci_hcd
usb usb1: SerialNumber: atmel-ehci
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
lsmod output
Module Size Used by Not tainted
ehci_hcd 30132 0
g_file_storage 24260 0
Any help is welcome!
Your drivers seem well installed. I don't have a straight answer but I work with software-hardware integration very often. Here is what I would do to get more clues. That kind of processor often have pins that are multipurposes. Sometimes, on an evaluation board, they are not configured the way we want by default. You can look at the documentation but also, you can use an Oscilloscope and probe the D+ and D- of the USB. Are they OK when in IDLE? What happen when you connect a device on your host port? The first few things will be done by the USB controller and involves little even no interaction with the software after the controller is configured. If you see the beginning of a negociation (a bunch of 0s and 1s) then, you know your hardware is configured properly and your basic driver is installed and work properly. The result of this will narrow the scope of the problem.
You are missing upper layer drivers. EHCI is only an interface driver, you need device drivers on top of it. Board<-->PC communication is usually done via serial over USB, so for this you need USB Serial driver. In Kernel config go to Device Drivers -> USB Support -> USB Serial Converter support and select driver according to the chip on your board/cable.
Here's an example dmesg dump seen when board is connected to the Ubuntu laptop:
[ 3469.923779] usb 2-1.2: new full-speed USB device number 5 using
ehci_hcd
[ 3470.019145] cp210x 2-1.2:1.0: cp210x converter detected
[ 3470.091614] usb 2-1.2: reset full-speed USB device number 5 using
ehci_hcd
[ 3470.184995] usb 2-1.2: cp210x converter now attached to ttyUSB0
I believe similar situation is with pendrive too - upper layer driver is missing.

Discover where are my USB speakers (device)

I'm running Debian Sid and I want to know where are my USB speakers in system. For example: When I plug my pen drive, dmesg shows where it is (sda, sdb, etc). But when I plug my USB Speakers, it doesn't show anything:
[12032.284042] usb 2-2: new full speed USB device using ohci_hcd and address 2
[12032.497098] usb 2-2: New USB device found, idVendor=0d8c, idProduct=0103
[12032.497103] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[12032.497107] usb 2-2: Product: USB Sound Device
[12032.497109] usb 2-2: Manufacturer: C-Media INC.
[12032.497266] usb 2-2: configuration #1 chosen from 1 choice
How could I discover where it is? Is there a command to show devices connected?
Thank you.
It's added as the next available ALSA card.
cat /proc/asound/cards
The easiest way is to diff the listing of /dev before and after the device is connected.
(Oops, I see that I probably misunderstood the question. Sorry. I'll leave my answer in case it's remotely useful).
Try lsusb. It gives you an overview of USB devices connected.

Resources