Sinamics
Posts: 4
Joined: Sat Feb 14, 2015 7:31 am

[Buster] USB camera, Internal data stream error

Fri Aug 30, 2019 8:16 pm

Spec
  • Raspberry Pi 3 Model B Rev 1.2
    Raspbian Buster Lite, Linux raspberrypi 4.19.69-v7+
    gstreamer 1.14
    Tested with USB Logitech C920 and USB TRUST TRINO 720p
Problem
When upgrading from stretch to buster image the gstreamer pipeline fails with Internal data stream error
I have tried several diffrent pipelines but they all fails with the same error. Seems like some sort of conflict in Buster image.
dmesg log reveals the cannot get freq at ep 0x84 error and i belive this might be the root cause.

Both Stretch Lite and Desktop works like a charm.

Pipeline used for this example

Code: Select all

gst-launch-1.0 -v -e --gst-debug=v4l2src:5 v4l2src device=/dev/video0 ! queue ! video/x-h264,width=1280,height=720,framerate=30/1 ! h264parse ! omxh264dec ! udpsink sync=false
Error message (--gst-debug=v4l2src:5)

Code: Select all

Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.286012635 16375  0x1002f50 DEBUG                v4l2src gstv4l2src.c:520:gst_v4l2src_negotiate:<v4l2src0> caps of peer: video/x-raw, width=(int)640, height=(int)480, framerate=(fraction)15/1, format=(string)I420; video/x-raw, width=(int)640, height=(int)480, framerate=(fraction)15/1, format=(string)NV12
0:00:00.286246332 16375  0x1002f50 DEBUG                v4l2src gstv4l2src.c:526:gst_v4l2src_negotiate:<v4l2src0> intersect: EMPTY
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.001050311
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

dmesg log

Code: Select all

2724.283426] usb 1-1.3: USB disconnect, device number 8
[ 2725.307493] usb 1-1.4: USB disconnect, device number 5
[ 2727.390400] usb 1-1.2: new high-speed USB device number 9 using dwc_otg
[ 2727.611162] usb 1-1.2: New USB device found, idVendor=0c45, idProduct=6340, bcdDevice= 0.00
[ 2727.611176] usb 1-1.2: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[ 2727.611186] usb 1-1.2: Product: USB 2.0 Camera
[ 2727.611195] usb 1-1.2: Manufacturer: Sonix Technology Co., Ltd.
[ 2727.616148] uvcvideo: Found UVC 1.00 device USB 2.0 Camera (0c45:6340)
[ 2727.637411] uvcvideo 1-1.2:1.0: Entity type for entity Extension 4 was not initialized!
[ 2727.637429] uvcvideo 1-1.2:1.0: Entity type for entity Processing 3 was not initialized!
[ 2727.637441] uvcvideo 1-1.2:1.0: Entity type for entity Camera 1 was not initialized!
[ 2727.637820] input: USB 2.0 Camera: HD 720P Webcam as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/input/input4
[ 2727.647744] usb 1-1.2: 3:1: cannot get freq at ep 0x84

lsusb

Code: Select all

[email protected]:/home/pi# lsusb
Bus 001 Device 009: ID 0c45:6340 Microdia Camera
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

ls /dev/vi*

Code: Select all

/dev/video0  /dev/video1  /dev/video10  /dev/video11  /dev/video12

Any advice is highly appreciated.
Last edited by Sinamics on Fri Aug 30, 2019 10:31 pm, edited 1 time in total.

User avatar
HermannSW
Posts: 2007
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: [Buster] USB camera cannot get freq at ep 0x84

Fri Aug 30, 2019 8:45 pm

> When upgrading from stretch to buster image
>
Did you start from a scratch installed Buster, or did you dist-upgrade somehow?
I read somewhere that Buster should be/needs to be installed from scratch ...
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

Sinamics
Posts: 4
Joined: Sat Feb 14, 2015 7:31 am

Re: [Buster] USB camera cannot get freq at ep 0x84

Fri Aug 30, 2019 10:23 pm

HermannSW wrote:
Fri Aug 30, 2019 8:45 pm
> When upgrading from stretch to buster image
>
Did you start from a scratch installed Buster, or did you dist-upgrade somehow?
I read somewhere that Buster should be/needs to be installed from scratch ...
I did a clean install from scratch.
I also tried rpi-update, but problem remains.

Sinamics
Posts: 4
Joined: Sat Feb 14, 2015 7:31 am

Re: [Buster] USB camera, Internal data stream error

Sat Aug 31, 2019 7:42 am

I noticed there is a discrepancies between Buster and Stretch v4ctl compliance.
Could this cause any trouble?

Is there anyone else using v4l2 / gstreamer and USB camera with Buster ?

Buster

Code: Select all

[email protected]:/home/pi# v4l2-compliance | grep FAIL
        test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: FAIL
        test VIDIOC_QUERYCTRL: FAIL
        test VIDIOC_G/S_PARM: FAIL
        test VIDIOC_G_FMT: FAIL
        
        Total: 44, Succeeded: 40, Failed: 4, Warnings: 2
Stretch

Code: Select all

v4l2-compliance
Total: 43, Succeeded: 43, Failed: 0, Warnings: 0

aerialone
Posts: 1
Joined: Fri Oct 25, 2019 12:09 am

Re: [Buster] USB camera, Internal data stream error

Fri Oct 25, 2019 12:20 am

Has anyone figured this out yet I need to use USB composite video with pi4 .

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8068
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: [Buster] USB camera, Internal data stream error

Fri Oct 25, 2019 9:27 am

@aerialone With Pi4 omxh264dec will fail as it tries to access the legacy 3D driver which doesn't exist. gst-omx needs to be built with either some build flags altered, or patched to not try egl_render. I identified the issue, but not the solution.

@Sinamics Pi3 should be OK. What kernel version are you running on your Stretch install vs that on Buster? uname -a in each case.
In the switch from Stretch to Buster you will have bumped up GStreamer version (1.10 to 1.14), and potentially kernel version (4.14 to 4.19). Which one causes the problem would be the big question. You should be able to use rpi-update on Stretch to upgrade to the same or later kernel as Buster which allows us to exclude one factor from the equation.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Troubleshooting”