weixin_39525812
weixin_39525812
2021-01-12 04:25

USB camera redirection

Hi, I'm trying to create a thin client using a raspberry pi 3 (client) with current wheezy installed connecting to a windows 10 machine. I am using xfreerdp command and sound, microphone etc. is working quite well. Now I want to share the USB camera (Logitec) connected to the pi so I can use it in video calls done via the thin client. But USB redirection doesn't work. The camera can be accessed on the pi and when I connect it to the Windows 10 machine it works there as well. I assume that this isn't related to the driver then.

I tried to use /usb:ID;dev:046d:0863 as well as /dvc:urbdrc,dbg,dev:046d:0836. The latter one seems to work at least somehow as in the protocol I get some message about device being registered. However there is an error message about bus:1 dev:4 not existing in udevman. I found some threads where this was discussed and seems to be neglectable. However, in the connected Windows 10 session I can't access the camera.

I used cmake with -DWITH_PCSC=ON -DWITH_NEON=OFF -DTARGET_ARCH=ARM -DCHANNEL_URBDRC_CLIENT=ON.

running xfreerdp as root doesn't work neither.

Any hint what the issue can be? Is USB forwarding of a camera to a Windows 10 machine possible at all?

C.

该提问来源于开源项目:FreeRDP/FreeRDP

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

6条回答

  • weixin_40001805 weixin_40001805 4月前

    The USB redirection feature requires server side setup (don't remember if that is active/supported by default in windows 10). On top of that it is not well tested, so your mileage may vary. For starters, https://blogs.technet.microsoft.com/enterprisemobility/2010/06/10/introducing-microsoft-remotefx-usb-redirection-part-1/ tells how it works on the server side.

    点赞 评论 复制链接分享
  • weixin_39525812 weixin_39525812 4月前

    : This link is all about client side set-up. But in my scenario the client is the raspberry pi, not a windows machine.

    I found the following info: http://stackoverflow.com/questions/33719489/how-to-enable-usb-redirection-in-windows-10 and followed the gp procedure. Now it seems there is a little progress: When running sudo xfreerdp ... /dvc:urbdrc,dbg,dev:046d:0836 without that set-up on the Windows machine (server), I got: [17:38:56:904] [3327:3328] [ERROR][com.winpr.timezone] - Unable to find a match for unix timezone: Etc/UTC [17:38:56:014] [3327:3328] [INFO][com.freerdp.gdi] - Local framebuffer format PIXEL_FORMAT_BGRX32 [17:38:56:015] [3327:3328] [INFO][com.freerdp.gdi] - Remote framebuffer format PIXEL_FORMAT_RGB16 [17:38:56:285] [3327:3328] [INFO][com.freerdp.channels.drdynvc.client] - Loading Dynamic Virtual Channel urbdrc [17:38:56:285] [3327:3328] [ERROR][com.freerdp.channels.urbdrc.client] - error processing arguments [17:38:56:297] [3327:3328] [WARN][com.freerdp.channels.urbdrc.client] - bus:0 dev:0 not exist in udevman [17:38:56:297] [3327:3328] [INFO][com.freerdp.channels.urbdrc.client] - VID: 0x046D, PID: 0x0836 [17:38:57:403] [3327:3328] [DEBUG][com.freerdp.channels.urbdrc.client] - Port: 4 [17:38:57:403] [3327:3328] [DEBUG][com.freerdp.channels.urbdrc.client] - DevPath: 1-1.4 [17:38:57:404] [3327:3328] [DEBUG][com.freerdp.channels.urbdrc.client] - Hub BUS/DEV: 1 2 [17:38:57:404] [3327:3328] [DEBUG][com.freerdp.channels.urbdrc.client] - libusb_open success! [17:38:57:405] [3327:3328] [DEBUG][com.freerdp.channels.urbdrc.client] - Regist Device: Vid: 0x046D Pid: 0x0836 InterfaceClass = 0x01 [17:38:57:405] [3327:3328] [WARN][com.freerdp.channels.urbdrc.client] - bus:1 dev:5 not exist in udevman [17:38:57:405] [3327:3328] [DEBUG][com.freerdp.channels.urbdrc.client] - UDEVMAN device registered. [17:38:57:405] [3327:3328] [TRACE][com.freerdp.channels.urbdrc.client] - [17:39:33:545] [3327:3328] [INFO][com.freerdp.client.x11] - Closed from X11

    With that Windows 10 set-up I now get: ... [17:31:47:461] [3243:3244] [DEBUG][com.freerdp.channels.urbdrc.client] - UDEVMAN device registered. [17:31:47:461] [3243:3244] [TRACE][com.freerdp.channels.urbdrc.client] - [17:31:49:118] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - [17:31:49:120] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - Size=16 InterfaceId=0x0 Mask=0x0 [17:31:49:120] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - [17:31:49:122] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - Size=12 InterfaceId=0x0 Mask=0x0 [17:31:49:122] [3243:3256] [ERROR][com.freerdp.channels.urbdrc.client] - unknown FunctionId 0x1 [17:31:49:122] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - Size=24 InterfaceId=0x2 Mask=0x1 [17:31:49:122] [3243:3256] [DEBUG][com.freerdp.channels.urbdrc.client] - ... [17:31:49:122] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - [17:31:49:122] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - Size=12 InterfaceId=0x2 Mask=0x1 [17:31:49:122] [3243:3256] [DEBUG][com.freerdp.channels.urbdrc.client] - ... [17:31:49:122] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - recv RIMCALL_RELEASE [17:31:49:123] [3243:3257] [DEBUG][com.freerdp.channels.urbdrc.client] - ... [17:31:49:123] [3243:3257] [TRACE][com.freerdp.channels.urbdrc.client] - [17:31:49:124] [3243:3258] [TRACE][com.freerdp.channels.urbdrc.client] - [17:31:49:125] [3243:3258] [TRACE][com.freerdp.channels.urbdrc.client] - ======= SEARCH ======= [17:31:49:140] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - [17:31:49:158] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - Size=16 InterfaceId=0x0 Mask=0x0 [17:31:49:158] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - [17:31:49:167] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - Size=12 InterfaceId=0x0 Mask=0x0 [17:31:49:167] [3243:3256] [ERROR][com.freerdp.channels.urbdrc.client] - unknown FunctionId 0x1 [17:31:49:168] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - Size=24 InterfaceId=0x2 Mask=0x1 [17:31:49:168] [3243:3256] [DEBUG][com.freerdp.channels.urbdrc.client] - ... [17:31:49:168] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - [17:31:49:168] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - Size=12 InterfaceId=0x2 Mask=0x1 [17:31:49:168] [3243:3256] [DEBUG][com.freerdp.channels.urbdrc.client] - ... [17:31:49:168] [3243:3256] [TRACE][com.freerdp.channels.urbdrc.client] - recv RIMCALL_RELEASE [17:31:49:169] [3243:3259] [DEBUG][com.freerdp.channels.urbdrc.client] - ... [17:31:51:499] [3243:3244] [INFO][com.freerdp.client.x11] - Closed from X11

    Meaning something is happening after the "UDEVMAN device registered" info. However, the USB device is still not available in the RDP session. Does anyone know something about that "unknown FunctionId 0x1" ERROR?

    C.

    点赞 评论 复制链接分享
  • weixin_40001805 weixin_40001805 4月前

    Yes, I've mixed up the blog posts, oops ^^ I've just tried with current FreeRDP master c966f71e9b34a05584d721807490b4bbd7606b6c and successfully redirected my webcam. Command line was

    /dvc:urbdrc,dev:<vid>:<pid></pid></vid>
    without the debug (the command line parsing for this particular channel is not very good, the whole thing would need a lot of love)
    点赞 评论 复制链接分享
  • weixin_39525812 weixin_39525812 4月前

    Thank you for this further information. I modified the files and used that to make and install. Unfortunately the camer is still not working.

    HOWEVER: This turned out to be a Windows/USB-Camera issue eventually. Checking the device manager in Windows I saw that the machine tried to establish the USB-Camera but failed (even though it could when directly connected and I have current drivers installed). So I tried with an old camera ('Quickcam Pro for Notebooks Pro' instead of 'B525 HD Webcam') and redirection works for that one. Even without the modifications you proposed.

    As proof of concept was established, I tried to go into more details about a working thin client solution and promptly ran into the next issue concerning USB redirection. This only works when run as root.

    when I run xfreerdp ... /dvc:urbdrc,dev:046d:08cb (not as root) I get the following result:

    [15:18:24:955] [1453:1454] [ERROR][com.winpr.timezone] - Unable to find a match for unix timezone: Etc/UTC [15:18:24:461] [1453:1454] [INFO][com.freerdp.gdi] - Local framebuffer format PIXEL_FORMAT_BGRX32 [15:18:24:461] [1453:1454] [INFO][com.freerdp.gdi] - Remote framebuffer format PIXEL_FORMAT_RGB16 [15:18:24:624] [1453:1454] [INFO][com.freerdp.channels.drdynvc.client] - Loading Dynamic Virtual Channel urbdrc [15:18:24:625] [1453:1454] [ERROR][com.freerdp.channels.urbdrc.client] - error processing arguments [15:18:24:643] [1453:1454] [WARN][com.freerdp.channels.urbdrc.client] - bus:0 dev:0 not exist in udevman [15:18:24:644] [1453:1454] [INFO][com.freerdp.channels.urbdrc.client] - VID: 0x046D, PID: 0x08CB [15:18:24:644] [1453:1454] [ERROR][com.freerdp.channels.urbdrc.client] - libusb_open: (by id) error: 0xFFFFFFFD (-3) [15:18:29:354] [1453:1454] [INFO][com.freerdp.client.x11] - Closed from X11

    -> ERROR on opening the device

    I thought that this was about authorization so I have created a file /etc/udev/rules.d/50-usb-cam.rules with: SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="08cb", MODE:="0666"

    This rule seems to work in general. udevadm test /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 returns: ... MODE 0664 /lib/udev/rules.d/50-udev-default.rules:41 MODE 0666 /etc/udev/rules.d/50-usb-cam.rules:1 PROGRAM 'mtp-probe /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 1 5' /lib/udev/rules.d/69-libmtp.rules:1429 starting 'mtp-probe /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 1 5' 'mtp-probe /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 1 5'(err) 'failed to execute '/lib/udev/mtp-probe' 'mtp-probe /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 1 5': No such file or directory' 'mtp-probe /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 1 5' [2224] exit with return code 2 handling device node '/dev/bus/usb/001/005', devnum=c189:4, mode=0666, uid=0, gid=0 set permissions /dev/bus/usb/001/005, 020666, uid=0, gid=0 ...

    As I read this the system sets permissions to 666 for my usb camera (001/005).

    But xfreerdp ... /dvc:urbdrc,dev:046d:08cb still runs into that libusb_open error. Any ideas what's behind that? I can't run xfreerdp as root in my application.

    C.

    点赞 评论 复制链接分享
  • weixin_40001805 weixin_40001805 4月前

    Looks like you still have permission issues. Maybe it is enough to add your user to usb group (that of course depends on your distribution settings). Closing this as the redirection is working (permissions are out of scope for us to support)

    点赞 评论 复制链接分享
  • weixin_39525812 weixin_39525812 4月前

    Thanks for the help. solved that with: sudo chmod 0666 /dev/bus/usb/001/005

    点赞 评论 复制链接分享

相关推荐