Modify

Opened 5 years ago

Last modified 2 years ago

#9953 new defect

usbip server on OpenWRT fails after client tries to attach device

Reported by: gertvdijk+openwrt@… Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: usbip Cc:

Description

Situation:

My TP-Link TL-WR1043ND is set up as usbip server, my Ubuntu Natty PC is set up as usbip client. I want to connect my Logitech USB headset device to my laptop using usbip, while it is physically connected to the TP-Link device. While I am also experimenting with alsa/pulseaudio on the same box, I also compiled USB sound modules in-kernel/firmware. However, usbip_bind_driver should remove the claim by the snd-usb-audio module and insert a stub. It is the last part where I get in some trouble.

OpenWRT version: r28007 (trunk build myself)

What I did to reproduce:

  1. Install usbip-server
  2. Reboot OpenWRT (usbip modules are loaded automatically at boot).
  3. Connect the USB device to the TP-Link TL-WR1043ND box
  4. start the usbip daemon in debug mode (foreground): usbipd -d
  5. Check the listing of USB devices:
    # usbip_bind_driver --list
    List USB devices
     - busid 1-1 (046d:0a0b)
             1-1:1.0 -> snd-usb-audio
             1-1:1.1 -> snd-usb-audio
             1-1:1.2 -> snd-usb-audio
             1-1:1.3 -> none
    
  6. Bind usbip to the USB device:
    # usbip_bind_driver --usbip 1-1
    ** (process:1174): DEBUG:  1-1:1.0	-> snd-usb-audio 
    ** (process:1174): DEBUG: unbinding interface
    ** (process:1174): DEBUG:  1-1:1.1	-> snd-usb-audio 
    ** (process:1174): DEBUG: unbinding interface
    ** (process:1174): DEBUG:  1-1:1.2	-> snd-usb-audio 
    ** (process:1174): DEBUG: unbinding interface
    ** (process:1174): DEBUG:  1-1:1.3	-> none 
    ** (process:1174): DEBUG: write "add 1-1" to /sys/bus/usb/drivers/usbip/match_busid
    ** Message: bind 1-1 to usbip, complete!
    
  7. Now, on the client:
    # usbip --list 192.168.0.202
    - 192.168.0.202
         1-1: Logitech, Inc. : ClearChat Pro USB (046d:0a0b)
            : /sys/devices/platform/ar71xx-ehci/usb1/1-1
            : (Defined at Interface level) (00/00/00)
            :  0 - Audio / Control Device / unknown protocol (01/01/00)
            :  1 - Audio / Streaming / unknown protocol (01/02/00)
            :  2 - Audio / Streaming / unknown protocol (01/02/00)
            :  3 - Human Interface Device / No Subclass / None (03/00/00)
    
  8. We can list the USB devices on the OpenWRT device! :) Now let's attach them:
    # usbip --attach 192.168.0.202 1-1
    8 ports available
    
    port 0 attached
    
    # usbip --port
    8 ports available
    
    Port 00: <Port Available>
    Port 01: <Port Available>
    Port 02: <Port Available>
    Port 03: <Port Available>
    Port 04: <Port Available>
    Port 05: <Port Available>
    Port 06: <Port Available>
    Port 07: <Port Available>
    
  9. Apparently it was not attached. Meanwhile, on the server usbipd has output the following:
    connected from 192.168.0.100:45325
    usbip dbg: stub_server.c:  52 (send_reply_devlist) 1 devices are exported
    usbip dbg: usbip_common.c:  82 (dump_usb_device) path                 = /sys/devices/platform/ar71xx-ehci/usb1/1-1
    usbip dbg: usbip_common.c:  83 (dump_usb_device) busid                = 1-1
    usbip dbg: usbip_common.c:  89 (dump_usb_device) Device(C/SC/P)       = (Defined at Interface level) (00/00/00)
    usbip dbg: usbip_common.c:  91 (dump_usb_device) bcdDevice            = 1013
    usbip dbg: usbip_common.c:  96 (dump_usb_device) Vendor/Product       = Logitech, Inc. : unknown product (046d:0a0b)
    usbip dbg: usbip_common.c:  98 (dump_usb_device) bNumConfigurations   = 1
    usbip dbg: usbip_common.c:  99 (dump_usb_device) bNumInterfaces       = 4
    usbip dbg: usbip_common.c: 102 (dump_usb_device) speed                = Full Speed(12Mbps)
    usbip dbg: usbip_common.c: 104 (dump_usb_device) busnum               = 1
    usbip dbg: usbip_common.c: 105 (dump_usb_device) devnum               = 2
    usbip dbg: usbip_common.c:  74 (dump_usb_interface) Interface(C/SC/P)    = Audio / Control Device / unknown protocol (01/01/00)
    usbip dbg: usbip_common.c:  74 (dump_usb_interface) Interface(C/SC/P)    = Audio / Streaming / unknown protocol (01/02/00)
    usbip dbg: usbip_common.c:  74 (dump_usb_interface) Interface(C/SC/P)    = Audio / Streaming / unknown protocol (01/02/00)
    usbip dbg: usbip_common.c:  74 (dump_usb_interface) Interface(C/SC/P)    = Human Interface Device / No Subclass / None (03/00/00)
    connected from 192.168.0.100:45326
    usbip dbg: stub_server.c: 145 (recv_request_import) found requested device 1-1
    usbip dbg: stub_driver.c: 319 (usbip_stub_export_device) write: 4
    
    connect 1-1
    
    # in the system log the following exerpt (full log attached):
    kern.err kernel: usb 1-1: failed to unlink a urb 81b26500, ret -36
    
  10. Now when checking the listing on the server again I see the device isn't completely attached anymore:
    # usbip_bind_driver --list
    List USB devices
     - busid 1-1 (046d:0a0b)
             1-1:1.0 -> snd-usb-audio
             1-1:1.1 -> usbip
             1-1:1.2 -> usbip
             1-1:1.3 -> usbip
    

What I expected to happen is that all USB subdevices are being kept claimed by usbip and the attachment on the client is completed so I can use the device over network.

Despite the kernel gives us errors about the unlinking, I will filed this bug against 'packages' since the USB device works without usbip. However, it could be a kernel-related issue.

Attachments (2)

broken-usbip-systemlog.log (7.6 KB) - added by gertvdijk+openwrt@… 5 years ago.
System log
openwrt-9953.txt (7.7 KB) - added by gertvdijk+openwrt@… 4 years ago.
Kernel trace 10.03.1 WR1043ND

Download all attachments as: .zip

Change History (7)

Changed 5 years ago by gertvdijk+openwrt@…

System log

comment:1 Changed 4 years ago by gertvdijk+openwrt@…

This bug also appears to affect Backfire 10.03.1 on the same device.
I have another box of the same type which just completely reboots without logging anything, on the moment a remote usbip client tries to attach some USB device on the OpenWRT box.

Has anybody succeeded in setting up usbip server on the OpenWRT box and attaching devices remotely? For me all recent builds still fail.

Changed 4 years ago by gertvdijk+openwrt@…

Kernel trace 10.03.1 WR1043ND

comment:2 Changed 4 years ago by gertvdijk+openwrt@…

I've attached the kernel oops/trace I get via serial. This was on clean Backfire 10.03.1 install.

Hope this helps.

comment:3 follow-up: Changed 4 years ago by devel@…

Has anybody succeeded in setting up usbip server on the OpenWRT box and attaching devices remotely?

I was getting the same problems described on https://dev.openwrt.org/ticket/5590. Everything works fine after resolving those problems. I'm using a usb servo controller and webcam over usbip. Works great.

comment:4 in reply to: ↑ 3 Changed 4 years ago by gertvdijk+openwrt@…

Replying to devel@…:

I was getting the same problems described on https://dev.openwrt.org/ticket/5590. Everything works fine after resolving those problems. I'm using a usb servo controller and webcam over usbip. Works great.

Great to hear that.
About "resolving those problems"; do you mean the solution provided in comment 15 in #5590 on its own?

comment:5 Changed 2 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.