Linux Kernel - USB IP Tools

136 views
Skip to first unread message

Sujith Varghese

unread,
Apr 13, 2018, 1:31:08 AM4/13/18
to inside...@googlegroups.com
Hi Anil and all,

I am trying to pass USB device from Server to Client over the network using Kernel - USB IP Tools. Here Server is a machine which shares the USB device and Client is a machine which uses USB device provided by the server over the network.


For my experiment Server and Client is a same Ubuntu machine and trying to access USB over local host.

Here is my experiment details :-

I downloaded the linux kernel 4.16.0 from https://github.com/torvalds/linux and build it for my ubuntu machine . I use the same config file of my existing ubuntu machine. Rebooted my machine with  kernel 4.16.0 . Please see below

$$OptiPlex-380 4.16.0-custom #1 SMP Wed Apr 11 11:54:04 IST 2018 x86_64 x86_64 x86_64 GNU/Linux

Also i build usbip application corresponding to this kernel. The usbip application source is obtained from https://github.com/torvalds/linux/tree/master/tools/usb/usbip

Thus i ensured that both Drivers and USB IP application are compatible . I successfully shared USB Mass storage device over USB-IP without any issues .
Thanks Torvalds and Sourceforge community for providing the such wonderful utility.

Now i will explain my problem.  I tried to share Logitech USB Web-camera through USB IP utility. Server and Client are running on same machine and i am trying to share device via local host. On server side Web Camera listed and successfully exported . Please see the below log

 sudo ./usbip list -l
 - busid 2-1 (0461:4d81)
   Primax Electronics, Ltd : Dell N889 Optical Mouse (0461:4d81)

 - busid 4-2 (0461:4e04)
   Primax Electronics, Ltd : unknown product (0461:4e04)

 - busid 1-8 (046d:082d)
   Logitech, Inc. : HD Pro Webcam C920 (046d:082d)

 sudo ./usbip bind -b 1-8
 usbip: info: bind device on busid 1-8: complete

On client Side , I could successfully attach this Web Cam. Now i got /dev/video0 interface and lsusb command showing the details of WebCam. After that i try to stream the web cam video through vlc player application, but streaming not started and vlc application terminated with below  error message

[00007f9d94000ff8] v4l2 demux error: cannot open device '/dev/video0': Device or resource busy
[00007f9d94000ff8] v4l2 demux error: cannot open device '/dev/video0': Device or resource busy
[00007f9d94000ff8] v4l2 access error: cannot open device '/dev/video0': No such file or directory
[00007f9d900009b8] core input error: open of `v4l2:///dev/video0' failed

Please find the below kernel messages received, when i started video streaming. Note that USB IP Debug is enabled on kernel menuconfig

.......................
.......................

[ 1254.069608] vhci_hcd: vhci_hub_status:249: port 0 status changed
[ 1254.069620] vhci_hcd: vhci_hub_control:335: typeReq 2303 wValue 4 wIndex 1
[ 1254.069622] vhci_hcd: vhci_hub_control:536:  SetPortFeature: USB_PORT_FEAT_RESET
[ 1254.069623] vhci_hcd: vhci_hub_control:556:  SetPortFeature: default 4
[ 1254.069625] vhci_hcd: vhci_hub_control:596: port 0
[ 1254.069627] vhci_hcd: dump_port_status_diff:128: status prev -> new: 00100501 -> 00100511
[ 1254.069629] vhci_hcd: dump_port_status_diff:142:   CONNECTION
[ 1254.069631] vhci_hcd: dump_port_status_diff:145:   USB_PORT_STAT_SPEED_5GBPS
[ 1254.069632] vhci_hcd: dump_port_status_diff:142:  +RESET
[ 1254.069634] vhci_hcd: dump_port_status_diff:142:   POWER
[ 1254.069635] vhci_hcd: dump_port_status_diff:142:   HIGHSPEED
[ 1254.069637] vhci_hcd: dump_port_status_diff:142:   C_RESET
[ 1254.069639] vhci_hcd: dump_port_status_diff:150:
[ 1254.069640] vhci_hcd: vhci_hub_control:604:  bye
[ 1254.069642] vhci_hcd: vhci_hub_status:249: port 0 status changed
[ 1254.277584] vhci_hcd: vhci_hub_control:335: typeReq a300 wValue 0 wIndex 1
[ 1254.277586] vhci_hcd: vhci_hub_control:415:  GetPortStatus port 1
[ 1254.277588] vhci_hcd: vhci_hub_control:470:  GetPortStatus bye 501 10
[ 1254.277590] vhci_hcd: vhci_hub_control:596: port 0
[ 1254.277592] vhci_hcd: dump_port_status_diff:128: status prev -> new: 00100511 -> 00100501
[ 1254.277594] vhci_hcd: dump_port_status_diff:142:   CONNECTION
[ 1254.277596] vhci_hcd: dump_port_status_diff:145:   USB_PORT_STAT_SPEED_5GBPS
[ 1254.277597] vhci_hcd: dump_port_status_diff:142:  -RESET
[ 1254.277599] vhci_hcd: dump_port_status_diff:142:   POWER
[ 1254.277601] vhci_hcd: dump_port_status_diff:142:   HIGHSPEED
[ 1254.277602] vhci_hcd: dump_port_status_diff:142:   C_RESET
[ 1254.277604] vhci_hcd: dump_port_status_diff:150:
[ 1254.277606] vhci_hcd: vhci_hub_control:604:  bye
[ 1254.277608] vhci_hcd: vhci_hub_status:249: port 0 status changed
**[ 1254.277618] usb usb6-port1: Cannot enable. Maybe the USB cable is bad?**

.......................
.......................

[ 1260.893864] vhci_hcd: vhci_hub_control:335: typeReq 2301 wValue 1 wIndex 1
[ 1260.893866] vhci_hcd: vhci_hub_control:382:  ClearPortFeature: default 1
[ 1260.893873] vhci_hcd: vhci_hub_control:596: port 0
[ 1260.893875] vhci_hcd: dump_port_status_diff:128: status prev -> new: 00100501 -> 00100501
[ 1260.893876] vhci_hcd: dump_port_status_diff:142:   CONNECTION
[ 1260.893878] vhci_hcd: dump_port_status_diff:145:   USB_PORT_STAT_SPEED_5GBPS
[ 1260.893879] vhci_hcd: dump_port_status_diff:142:   POWER
[ 1260.893880] vhci_hcd: dump_port_status_diff:142:   HIGHSPEED
[ 1260.893882] vhci_hcd: dump_port_status_diff:142:   C_RESET
[ 1260.893883] vhci_hcd: dump_port_status_diff:150:
[ 1260.893884] vhci_hcd: vhci_hub_control:604:  bye
[ 1260.893886] vhci_hcd: vhci_hub_status:249: port 0 status changed
**[ 1260.893897] usb usb6-port1: unable to enumerate USB device**

.......................
.......................

[ 1260.893962] vhci_hcd: dump_port_status_diff:128: status prev -> new: 00100501 -> 00000501
[ 1260.893964] vhci_hcd: dump_port_status_diff:142:   CONNECTION
[ 1260.893965] vhci_hcd: dump_port_status_diff:145:   USB_PORT_STAT_SPEED_5GBPS
[ 1260.893966] vhci_hcd: dump_port_status_diff:142:   POWER
[ 1260.893968] vhci_hcd: dump_port_status_diff:142:   HIGHSPEED
[ 1260.893969] vhci_hcd: dump_port_status_diff:142:  -C_RESET
[ 1260.893970] vhci_hcd: dump_port_status_diff:150:
[ 1260.893972] vhci_hcd: vhci_hub_control:604:  bye
[ 1260.893981] vhci_hcd: vhci_hub_control:335: typeReq a300 wValue 0 wIndex 1
[ 1260.893983] vhci_hcd: vhci_hub_control:415:  GetPortStatus port 1
[ 1260.893984] vhci_hcd: vhci_hub_control:470:  GetPortStatus bye 501 0
[ 1260.893986] vhci_hcd: vhci_hub_control:596: port 0
[ 1260.893988] vhci_hcd: dump_port_status_diff:128: status prev -> new: 00000501 -> 00000501
[ 1260.893989] vhci_hcd: dump_port_status_diff:142:   CONNECTION
[ 1260.893991] vhci_hcd: dump_port_status_diff:145:   USB_PORT_STAT_SPEED_5GBPS
[ 1260.893992] vhci_hcd: dump_port_status_diff:142:   POWER
[ 1260.893993] vhci_hcd: dump_port_status_diff:142:   HIGHSPEED
[ 1260.893995] vhci_hcd: dump_port_status_diff:150:
[ 1260.893996] vhci_hcd: vhci_hub_control:604:  bye
**[ 1260.894012] usb usb6: vhci_bus_suspend**


Any help is most appreciated.
Thanks in advance

Anil Kumar Pugalia

unread,
Apr 16, 2018, 6:15:42 AM4/16/18
to inside...@googlegroups.com

Check if it is working without using usbip.

Regards
Anil
Passion: http://sysplay.in (Playing with Systems)
--
You received this message because you are subscribed to the Google Groups "SysPlay's Inside Linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inside_linux...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sujith Varghese

unread,
Apr 16, 2018, 10:43:47 AM4/16/18
to inside...@googlegroups.com
It is working. 

To unsubscribe from this group and stop receiving emails from it, send an email to inside_linux+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "SysPlay's Inside Linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inside_linux+unsubscribe@googlegroups.com.

Anil Kumar Pugalia

unread,
Apr 20, 2018, 8:34:39 AM4/20/18
to inside...@googlegroups.com

Then, it might help tracing the usbip code, as to what is triggering the error.

Regards
Anil
Passion: http://sysplay.in (Playing with Systems)
To unsubscribe from this group and stop receiving emails from it, send an email to inside_linux...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages