Stereopi v2 as usb device

SLP v2 RaspiOS image discussion
Post Reply
Posts: 2
Joined: Sun Nov 07, 2021 2:11 pm

Stereopi v2 as usb device

Post by anu1905 »

Hello, I would like to use my Stereopi v2 (with CM4) as a USB device. I'm a macOS user and I need the stereopi to be recognized on my MacBook as a webcam. Could someone guide and/or provide instructions? Thanks!

User avatar
Site Admin
Posts: 900
Joined: Tue Apr 16, 2019 9:23 am

Re: Stereopi v2 as usb device

Post by Realizator »

Hello anu1905,
To say briefly you have two ways:
1. The simplest one - use HDMI->USB adaptor
In this case, the HDMI capture device (like this one) captures the StereoPi HDMI output. So this device is visible as a web camera. No settings, no tricks.
2. The most difficult - use USB gadget mode
You can force StereoP to use a USB C port in client mode. And StereoPi can act as a USB device - for example, Ethernet card, storage, etc. For example, in this article, you can find a way to use a USB connection as a network (it's for V1, but applicable to V2 too).
But webcam mode is a challenging feature. All known software realizations are unstable and tricky. The most stable realization is described here by Jeff Geerling, but it is for the single camera only.

I know StereoPi v2 is used in USB mode in some advanced projects. But in those cases, it uses a USB connection as a network to pass through the video stream to the host PC, with appropriate receiving part at the Big Brother.

So, if you want to use it in "just works" mode - use the HDMI-USB capture device.
Eugene a.k.a. Realizator

Posts: 2
Joined: Sun Nov 07, 2021 2:11 pm

Re: Stereopi v2 as usb device

Post by anu1905 »

The HDMI--USB video capture device worked like a charm! Thank you so much!

Posts: 4
Joined: Mon May 30, 2022 3:51 pm

Re: Stereopi v2 as usb device

Post by asdf »

I did as described in the article and I cannot make it work, at least with the Stereopi v2. The device does not show up on my host computer. I have tried powering it from one of the usb-a ports in my computer and also from the usb-c one. Is there a problem with the v2?

My /boot/config.txt file is:

Code: Select all

# For more options and information see
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border

# uncomment to force a console size. By default it will be display's size minus
# overscan.

# uncomment if hdmi display is not detected and composite is being output

# uncomment to force a specific HDMI mode (this will force VGA)

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display

# uncomment for composite PAL

#uncomment to overclock the arm. 700 MHz is the default.

# Uncomment some or all of these to enable the optional hardware interfaces

# Uncomment this to enable infrared communication.

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)

# Enable DRM VC4 V3D driver on top of the dispmanx display stack

and my /boot/cmdline.txt is

Code: Select all

console=serial0,115200 console=tty1 root=PARTUUID=cecda96b-02 rootfstype=ext4 elevator=deadline rootwait quiet splash plymouth.ignore-serial-consoles modules-load=dwc2,g_ether

Posts: 215
Joined: Tue May 21, 2019 12:33 pm
Location: France

Re: Stereopi v2 as usb device

Post by stereomaton »

The article was written for v0.9, I do not have a v2 and thus I did not examine the differences.

You may look at dmesg command to see if the kennel emits an error message about it.

By the way, I see in your config.txt that you set both dr_mode=host and peripheral which could likely be a problem.
Stereophotographer and hacker
Despite my quite active participation in the forum, I am not in the StereoPi team
StereoPi (v1) Standard Edition + CM3Lite module + a few cameras

Posts: 4
Joined: Mon May 30, 2022 3:51 pm

Re: Stereopi v2 as usb device

Post by asdf »

Found it! As it turns out, I had to connect the usb_cli jumper in the stereopi, which I learned is necessary from this article.

Post Reply