Testing USB/IP

Thanks, @TheHacker66, perhaps the problem is connected to my using a non-powered DVD-player; I had hoped, however, that since the player works flawlessly on a pi to have at least the same flawlessness on the Vero. But if a powered usb-hub is a guaranteed solution in this case, I would be willing to buy one, I think- but not quite on the off chance.
I think @sam_nazarko is looking at the source of the problem and will undoubtedly be able to advice a work around in due course, or offer a solution.

In the mean time: As I can’t play the DVD’s using the USB-DVD-player directly connected to the USB-port of the Vero, I tried to be “clever” :sunglasses: : I connected the DVD-player to the raspberrypi, which does play the DVD’s without problems, and then, on the Vero added that pi, and its DVD, as a source in my Vero-video-library.

When I tried to play the DVD from that source on the Vero, unfortunately, OSMC crashed* .
Is this something which I should report separately?

*logs: http://paste.osmc.tv/idisigaxec

If the Pi and Vero4K are both running the latest OSMC (2017.12-1), you might have some success using a newly-added feature in the kernel: USB-over-IP (usbip).

I’ve not tried it myself yet but I found instructions on its use here. Go to the post from “secretagent” at Thu Jul 12, 2012 11:40 am. Start from "Then install usbip: ", since you don’t need to build anything.

If you try it, let us know how you get on.

I tried. No luck so far. Any suggestions welcome.

I followed the relevant steps as explained by secretagent here.

On the pi (in my setup the host, to which the DVD-USB-player is connected) I ran:

sudo apt-get install usbip → installed fine.
sudo modprobe usbip-host → no onscreen output
sudo usbip list -l

Output:

 - busid 1-1.1 (0424:ec00)
   Standard Microsystems Corp. : SMSC9512/9514 Fast Ethernet Adapter (0424:ec00)

 - busid 1-1.4 (0e8d:1887)
   MediaTek Inc. : unknown product (0e8d:1887)

I am trying to share the Mediatek, so I ran:

sudo usbip bind --busid 1-1.4

Output:

usbip: info: bind device on busid 1-1.4: complete

On the Vero4k (in my set up the client) I ran:

sudo modprobe vhci-hcd → no onscreen output

Then I ran (still on the Vero4k, the client):

usbip list –-remote 192.168.178.25 (the ip of the host-pi)

That didn’t work because command usbip “not found”.

So on the Vero4k I ran:

sudo apt install usbip → installed without problem.

then I ran:

sudo usbip list --remote 192.168.178.25

But got

usbip: error: could not connect to 192.168.178.25:3240: System error

As secretagent in his post states that this may occur, and that in that case the binding needs to be redone I issued

sudo usbip bind --busid 1-1.4 on the host (pi) again. But that threw the message:

usbip: error: device on busid 1-1.4 is already bound to usbip-host

So the binding seems okay.

I searched for the “system error” in the original posts but to no avail.

Vero4K-logs, after the system error, are here: https://paste.osmc.tv/pesazarulu

Thoughts?

I just found out I have been warned :wink: … Found this in the log[1].

jan 25 15:18:18 osmc-vero kernel: CFG80211-ERROR) wl_cfg80211_tdls_mgmt : Unsupported action code : 14

Would this be the culprit?

[1]
jan 25 15:18:15 osmc-vero sudo[1329]: osmc : TTY=pts/0 ; PWD=/home/osmc ; USER=root ; COMMAND=/sbin/modprobe vhci-hcd
jan 25 15:18:15 osmc-vero sudo[1329]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)
jan 25 15:18:15 osmc-vero kernel: usbip_core: module is from the staging directory, the quality is unknown, you have been warned.
jan 25 15:18:15 osmc-vero kernel: usbip_core: USB/IP Core v1.0.0
jan 25 15:18:15 osmc-vero kernel: vhci_hcd: module is from the staging directory, the quality is unknown, you have been warned.
jan 25 15:18:15 osmc-vero kernel: vhci_hcd vhci_hcd: USB/IP Virtual Host Controller
jan 25 15:18:15 osmc-vero kernel: vhci_hcd vhci_hcd: new USB bus registered, assigned bus number 3
jan 25 15:18:15 osmc-vero kernel: usb usb3: New USB device found, idVendor=1d6b, idProduct=0002
jan 25 15:18:15 osmc-vero kernel: usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
jan 25 15:18:15 osmc-vero kernel: usb usb3: Product: USB/IP Virtual Host Controller
jan 25 15:18:15 osmc-vero kernel: usb usb3: Manufacturer: Linux 3.14.29-51-osmc vhci_hcd
jan 25 15:18:15 osmc-vero kernel: usb usb3: SerialNumber: vhci_hcd
jan 25 15:18:15 osmc-vero kernel: hub 3-0:1.0: USB hub found
jan 25 15:18:15 osmc-vero kernel: hub 3-0:1.0: 8 ports detected
jan 25 15:18:15 osmc-vero kernel: vhci_hcd: USB/IP ‘Virtual’ Host Controller (VHCI) Driver v1.0.0
jan 25 15:18:15 osmc-vero sudo[1329]: pam_unix(sudo:session): session closed for user root
jan 25 15:18:18 osmc-vero kernel: CFG80211-ERROR) wl_cfg80211_tdls_mgmt : Unsupported action code : 14
jan 25 15:19:43 osmc-vero sudo[1396]: osmc : TTY=pts/0 ; PWD=/home/osmc ; USER=root ; COMMAND=/usr/bin/apt install usbip
jan 25 15:19:43 osmc-vero sudo[1396]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)
jan 25 15:19:56 osmc-vero sudo[1396]: pam_unix(sudo:session): session closed for user root
jan 25 15:20:41 osmc-vero sudo[1482]: osmc : TTY=pts/0 ; PWD=/home/osmc ; USER=root ; COMMAND=/usr/sbin/usbip list --remote 192.168.178.25
jan 25 15:20:41 osmc-vero sudo[1482]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)
jan 25 15:20:42 osmc-vero sudo[1482]: pam_unix(sudo:session): session closed for user root
jan 25 15:24:14 osmc-vero sudo[1552]: osmc : TTY=pts/0 ; PWD=/home/osmc ; USER=root ; COMMAND=/usr/sbin/usbip list --remote 192.168.178.25
jan 25 15:24:14 osmc-vero sudo[1552]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)
jan 25 15:24:15 osmc-vero sudo[1552]: pam_unix(sudo:session): session closed for user root
jan 25 15:29:44 osmc-vero systemd[1]: Starting Cleanup of Temporary Directories…
jan 25 15:29:44 osmc-vero systemd[1]: Started Cleanup of Temporary Directories.

I figured the order of things could be important here. As, on the Vero4k (client), I issued the

sudo modprobe vhci-hcd

and only then installed usbip, I decided to re-issue

sudo modprobe vhci-hcd

No luck. Still the System Error.

In the logs[1] I found

jan 25 15:17:39 osmc-vero kernel: CFG80211-ERROR) wl_cfg80211_tdls_mgmt : Unsupported action code : 14
jan 25 15:17:40 osmc-vero kernel: CFG80211-ERROR) wl_cfg80211_tdls_mgmt : Unsupported action code : 14
jan 25 15:17:40 osmc-vero kernel: CFG80211-ERROR) wl_cfg80211_tdls_mgmt : Unsupported action code : 14

[1] https://paste.osmc.tv/abazirenes

On the host run sudo usbipd -D then try to connect again.

I ran

sudo usbipd -D

on the host. There was no onscreen output.

On the client I ran

sudo usbip list --remote 192.168.178.25

which gave:

Exportable USB devices
======================
 - 192.168.178.25
      1-1.4: MediaTek Inc. : unknown product (0e8d:1887)
           : 
           : (Defined at Interface level) (00/00/00)

Which is more than in the previous try, when we got the System Error.

So I ran the next step which secretagent suggests in his post.

On the client:

sudo usbip attach --host 192.168.178.25 --busid 1-1.4

Which seems to be wrong usage though, as usbip throws:

usage: usbip attach <args>
    -r, --remote=<host>      The machine with exported USB devices
    -b, --busid=<busid>    Busid of the device on <host>
    -d, --device=<devid>    Id of the virtual UDC on <host>

So I tried:

sudo usbip attach -r 192.168.178.25 -b 1-1.4

Which ended with:

usbip: error: open vhci_driver
usbip: error: query

Progress, but not quite there yet.
Would be great if we got this working.

Logs: https://paste.osmc.tv/okapiluqev

What about:

sudo usbip attach --host=192.168.178.25 --busid=1-1.4

I already got it working, so don’t despair. :wink:

Great. So I tried

smc@osmc-vero:~$ sudo usbip attach --host=192.168.178.25 --busid=1-1.4
usage: usbip attach <args>
    -r, --remote=<host>      The machine with exported USB devices
    -b, --busid=<busid>    Busid of the device on <host>
    -d, --device=<devid>    Id of the virtual UDC on <host>

Then I tried:

sudo usbip attach --remote=192.168.168.25 --busid=1-1.4

which seemed to work as it took some time but then threw:

usbip: error: tcp connect

By the way, I am running usbip 2.0:

osmc@osmc-vero:~$ usbip version
usbip (usbip-utils 2.0)

and I found the man-pages here: Linux Manpages Online - man.cx manual pages here.

On the host machine. (This just a USB pendrive BTW.)

osmc@osmc:~$ sudo modprobe usbip_host
osmc@osmc:~$ sudo usbipd -D
osmc@osmc:~$ usbip list --local
 - busid 1-1.1 (0424:ec00)
   Standard Microsystems Corp. : SMSC9512/9514 Fast Ethernet Adapter (0424:ec00)

 - busid 1-1.4 (125f:dc1a)
   A-DATA Technology Co., Ltd. : unknown product (125f:dc1a)
osmc@osmc:~$ sudo usbip bind --busid=1-1.4
usbip: info: bind device on busid 1-1.4: complete

On the other machine (a Vero4K):

osmc@osmc:~$ sudo modprobe vhci_hcd
osmc@osmc:~$ usbip list --remote=192.168.8.33
Exportable USB devices
======================
 - 192.168.8.33
      1-1.4: A-DATA Technology Co., Ltd. : unknown product (125f:dc1a)
           : /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4
           : (Defined at Interface level) (00/00/00)

osmc@osmc:~$ sudo usbip attach --remote=192.168.8.33 --busid=1-1.4
osmc@osmc:~$ sudo usbip port
Imported USB devices
====================
Port 00: <Port in Use> at High Speed(480Mbps)
       A-DATA Technology Co., Ltd. : unknown product (125f:dc1a)
       3-1 -> usbip://192.168.8.33:3240/1-1.4
           -> remote bus/dev 001/004
osmc@osmc:~$ df
Filesystem          1K-blocks     Used Available Use% Mounted on
<snip>
/dev/sdc1            29702020    45084  28125084   1% /media/bf6cd3a8-4c8d-4081-91b4-6a8d0f95093b

Mimicked your “script”:

On host:

osmc@mediaplayer:~$ sudo modprobe usbip_host
osmc@mediaplayer:~$ sudo usbipd -D
osmc@mediaplayer:~$ usbip list --local
 - busid 1-1.1 (0424:ec00)
   Standard Microsystems Corp. : SMSC9512/9514 Fast Ethernet Adapter (0424:ec00)

 - busid 1-1.4 (0e8d:1887)
   MediaTek Inc. : unknown product (0e8d:1887)

osmc@mediaplayer:~$ sudo usbip bind --busid=1-1.4
usbip: error: device on busid 1-1.4 is already bound to usbip-host

So nothing new there, but I wouldn’t have expected that, so:

On client:

osmc@osmc-vero:~$ sudo modprobe vhci_hcd
osmc@osmc-vero:~$ usbip list --remote=192.168.178.25
Exportable USB devices
======================
 - 192.168.178.25
      1-1.4: MediaTek Inc. : unknown product (0e8d:1887)
           : /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4
           : (Defined at Interface level) (00/00/00)

osmc@osmc-vero:~$  sudo usbip attach --remote=192.168.178.25 --busid=1-1.4
osmc@osmc-vero:~$ sudo usbip port
Imported USB devices
====================
Port 00: <Port in Use> at High Speed(480Mbps)
       MediaTek Inc. : unknown product (0e8d:1887)
       3-1 -> usbip://192.168.178.25:3240/1-1.4
           -> remote bus/dev 001/005

Succes? Not sure what made the difference, here, but still: :slight_smile: !

So now this DVD-player should be visible somewhere on the Vero4k. I had a quick rummage through the OSMC-menu, but, well… ehm :confused: : I’m not sure where to look for it though; any pointers?

Run lsusb and see if it’s there. I ran df and the pendrive had been automatically mounted by udisks. Sweet.

osmc@osmc-vero:~$ lsusb
Bus 003 Device 004: ID 0e8d:1887 MediaTek Inc. 

It’s there alright… !

But how to access it through the OSMC menu?

My USB DVD drive is broken so I can’t try anything out, but what did you see on the Pi?

Just to be certain: the pi is the server.

Do you mean:

osmc@mediaplayer:~$ df
Bestandssysteem 1K-blokken Gebruikt Beschikbaar Geb% Aangekoppeld op
devtmpfs            377804        0      377804   0% /dev
tmpfs               382924    14768      368156   4% /run
/dev/mmcblk0p2    14732672  1463764    12497480  11% /
tmpfs               382924        0      382924   0% /dev/shm
tmpfs                 5120        0        5120   0% /run/lock
tmpfs               382924        0      382924   0% /sys/fs/cgroup
/dev/mmcblk0p1      244988    32648      212340  14% /boot
tmpfs                76584        0       76584   0% /run/user/999
tmpfs                76584        0       76584   0% /run/user/1000

The Vero is the client:

osmc@osmc-vero:~$ df
Bestandssysteem     1K-blokken Gebruikt Beschikbaar Geb% Aangekoppeld op
devtmpfs                803816        0      803816   0% /dev
tmpfs                   916052    16904      899148   2% /run
/dev/vero-nand/root   14499760  1118508    12621652   9% /
tmpfs                   916052        0      916052   0% /dev/shm
tmpfs                     5120        0        5120   0% /run/lock
tmpfs                   916052        0      916052   0% /sys/fs/cgroup
tmpfs                   183208        0      183208   0% /run/user/1000

((I have to sign off for now; will hopefully be back tomorrow.))

Did just one more quick test: in osmc on the pi (the server to which the DVD-Player Is directly connected) the “play disc” Menu-Item is still visible but it’s being skipped when I try to reach it. So, locally, the dvd-player is not is usable anymore. Not a problem, mind, but just wanted to mention it.

I believe that’s expected behaviour. You have effectively moved it to a new machine, the Vero.

When you insert a DVD film into the drive, does the device get mounted on the Vero?

Sorry to keep you waiting @dillthedog. Anyway: The Vero4k (client) has been turned off; I do turn it off when I don’t use it (I know there are people who think it’s not necessary) .

After turning it back on, it won’t attach to the DVD-player on the pi (server) anymore (I tried more than once):

osmc@osmc-vero:~$ sudo modprobe vhci_hcd
osmc@osmc-vero:~$ usbip list --remote=192.168.178.25
Exportable USB devices
======================
 - 192.168.178.25
      1-1.4: MediaTek Inc. : unknown product (0e8d:1887)
           : /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4
           : (Defined at Interface level) (00/00/00)
           :  0 - Mass Storage / SFF-8020i, MMC-2 (ATAPI) / unknown protocol (08/02/50)

osmc@osmc-vero:~$ sudo usbip attach --remote=192.168.178.25 --busid=1-1.4
usbip: error: recv op_common
usbip: error: query
osmc@osmc-vero:~$ lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2252:1037  
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

osmc@osmc-vero:~$ df
Bestandssysteem     1K-blokken Gebruikt Beschikbaar Geb% Aangekoppeld op
devtmpfs                803816        0      803816   0% /dev
tmpfs                   916052    16880      899172   2% /run
/dev/vero-nand/root   14499760  1118516    12621644   9% /
tmpfs                   916052        0      916052   0% /dev/shm
tmpfs                     5120        0        5120   0% /run/lock
tmpfs                   916052        0      916052   0% /sys/fs/cgroup
tmpfs                   183208        0      183208   0% /run/user/1000

So, what am I missing?

I did try to find more information about this usbip: error: recv op_common and came across two sources which, if I understand correctly, seem to suggest that usbip is broken and obsolete[1], and what to use instead[2]. The information in these sites goes quite above my level of expertise, and may only be relevant for Ubuntu, but perhaps there is something useful in there?

[1] Bug #1541855 “usbip in 16.04 broken” : Bugs : usbip package : Ubuntu
[2] GitHub - solarkennedy/wiki.xkyle.com: wiki.xkyle.com

Those are Ubuntu-related posts. It seems that devlopment is still continuing. From the USB/IP Sourceforge page USB/IP Project

Development is ongoing in the kernel community, not here. Linux distributions will provide binary packages of usbip.

As to your inability to connect, I suggest you restart the Pi, as well, then load the driver, etc.