Libcomposite's g_ether + g_webcam on Buster Lite, Stretch Lite and Jessie Lite in Pi Zero W do not work

Open
#3,965 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
c, linux

Research direction

Start by reproducing the reported matrix on the listed Jessie, Stretch, and Buster Lite versions, then inspect the dwc2_hsotg_ep_sethalt logs alongside the configfs-gadget UVC and RNDIS setup. Done means determining whether webcam plus RNDIS is supported on Pi Zero W and documenting a confirmed cause or kernel change.

Written by the indexing model from the issue text.

Description

Hi.

I am quite new to this reporting but can help to investigate. I believe this is a kernel bug and not sure has this ever worked before. I am not sure if this is related to https://github.com/raspberrypi/linux/issues/3862 or/and https://github.com/raspberrypi/linux/issues/2076. I can try to help resolve or fix it as a team if I could get guidance on this.

So, I have a Pi Zero W with a Pi Camera. I have been looking at making the Pi as a UVC gadget using https://github.com/climberhunt/uvc-gadget and with ConfigFS or g_webcam non-modular approach (not sure what is this method called) but I mostly experiment and use ConfigFS method.

I have also read about the possibility of configuring gadgets on Linux kernel where I can make multi-gadgets device so I can make USB webcam + storage or RNDIS ethernet + storage but not webcam + RNDIS ethernet on the Pi Zero W with all the lite OS. So here is the matrix of what is successful on the Zero W and libcomposite.

  • USB webcam --> OK
  • USB webcam + USB storage --> OK
  • USB RNDIS ethernet + USB storage --> OK
  • USB webcam + USB RNDIS ethernet --> FAILED

When it fails, what I get is, on Windows 10, I can ping the Pi via USB cable ethernet and that part works. Device Manager sees no errors (no exclamations) for UVC Camera and RNDIS Network Adapter entries. When using the Win10 Camera App to stream, I get this error (something like this): 0xa00f4271 (0x800703e3)

Then I look at the Pi logs and see something like below:

configfs-gadget gadget: uvc_function_bind
dwc2 20980000.usb: bound driver configfs-gadget
IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
dwc2 20980000.usb: new device is high-speed
dwc2 20980000.usb: new device is high-speed
dwc2 20980000.usb: new address 1
configfs-gadget gadget: high-speed config #1: c
configfs-gadget gadget: uvc_function_set_alt(2, 0)
configfs-gadget gadget: reset UVC Control
configfs-gadget gadget: uvc_function_set_alt(3, 0)
IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready
configfs-gadget gadget: uvc_function_set_alt(3, 0)
configfs-gadget gadget: uvc_function_set_alt(3, 0)
dwc2 20980000.usb: dwc2_hsotg_ep_sethalt(ep ceadd390 ep0, 1)
dwc2 20980000.usb: dwc2_hsotg_ep_sethalt(ep ceadd390 ep0, 1)
random: crng init done
dwc2 20980000.usb: dwc2_hsotg_ep_sethalt(ep ceadd390 ep0, 1)
dwc2 20980000.usb: dwc2_hsotg_ep_sethalt(ep ceadd390 ep0, 1)
dwc2 20980000.usb: dwc2_hsotg_ep_sethalt(ep ceadd390 ep0, 1)
dwc2 20980000.usb: dwc2_hsotg_ep_sethalt(ep ceadd390 ep0, 1)
Bluetooth: Core ver 2.22

The dwc2_hsotg_ep_sethalt is where I am stuck and currently my path on this trail.

I have tried with all of these Raspberry Pi OSes.

  • Jessie Lite 2017-07-05 Linux version: 4.9.35+
  • Stretch Lite 2017-08-17 Linux version: 4.9.41+
  • Buster Lite 2019-07-10 Linux version: 4.19.57+

and I get same behaviour. Standalone USB webcam, it works but anything webcam with RNDIS ethernet gadget fails.

  • Am I doing something wrong?
  • Should the USB gadget mode work for USB webcam + RNDIS ethernet (my guess/understanding is yes but I cannot find concrete online materials for this except for similar but not-Pi-devices)?
  • Does the Pi Zero W OTG ever worked for USB webcam + RNDIS ethernet?

Help please, anyone?

Thank you! :-)

Dominant language
C
Stars
13.2k
Forks
5.5k
Avg merge
2d 21h
Merged PRs (30d)
21

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/linux

All issues in raspberrypi/linux

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.