trejan
Posts: 1216
Joined: Tue Jul 02, 2019 2:28 pm

Re: VLI firmware v2.0 - powersaving features enabled

Mon Dec 09, 2019 9:07 pm

Serveurperso wrote:
Mon Dec 09, 2019 7:33 pm
How to prevent VL805 from updating ?
Edit /etc/default/rpi-eeprom-update and add ENABLE_VL805_UPDATES=0

Other option is to disable ASPM in the USB controller using the setpci command mentioned by iEvgeny. You'll need to run it every boot though.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2239
Joined: Thu Jul 11, 2013 2:37 pm

Re: VLI firmware v2.0 - powersaving features enabled

Mon Dec 09, 2019 9:12 pm

For people experiencing webcam issues, what happens if you use the 0137ab firmware and run the following commands?

Code: Select all

sudo apt install pciutils
sudo setpci -s 01:00.0 0xd4.B=0x40
This disables PCIe link power management on the VLI chip.
Rockets are loud.
https://astro-pi.org

User avatar
Serveurperso
Posts: 25
Joined: Tue May 21, 2019 1:30 pm
Contact: Website

Re: VLI firmware v2.0 - powersaving features enabled

Wed Dec 11, 2019 7:17 am

jdb wrote:
Mon Dec 09, 2019 9:12 pm
For people experiencing webcam issues, what happens if you use the 0137ab firmware and run the following commands?

Code: Select all

sudo apt install pciutils
sudo setpci -s 01:00.0 0xd4.B=0x40
This disables PCIe link power management on the VLI chip.
Hi,

I returned to stock updated image and the last VL805 eeprom to check your command :
Do not work for me sorry:( same problem : video capture start but the stream look empty. ffmpeg debug trace don't see the problem !

Code: Select all

[email protected]:~# rpi-eeprom-update
BOOTLOADER: up-to-date
CURRENT: Tue 10 Sep 10:41:50 UTC 2019 (1568112110)
 LATEST: Tue 10 Sep 10:41:50 UTC 2019 (1568112110)
VL805: up-to-date
CURRENT: 000137ab
 LATEST: 000137ab
[email protected]:~# apt install pciutils
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  pciutils
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 271 kB of archives.
After this operation, 1,222 kB of additional disk space will be used.
Get:1 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf pciutils armhf 1:3.5.2-1 [271 kB]
Fetched 271 kB in 0s (603 kB/s)  
Selecting previously unselected package pciutils.
(Reading database ... 46850 files and directories currently installed.)
Preparing to unpack .../pciutils_1%3a3.5.2-1_armhf.deb ...
Unpacking pciutils (1:3.5.2-1) ...
Setting up pciutils (1:3.5.2-1) ...
Processing triggers for man-db (2.8.5-2) ...
[email protected]:~# setpci -s 01:00.0 0xd4.B=0x40
[email protected]:~#
The only way for me now is the rollback :
rpi-eeprom-update -u /lib/firmware/raspberrypi/bootloader/critical/vl805-00013701.bin
And
ENABLE_VL805_UPDATES=0
inside
/etc/default/rpi-eeprom-update
Work perfectly to prevent automatic updates. EDIT : NO:(
Last edited by Serveurperso on Wed Dec 11, 2019 7:38 am, edited 1 time in total.
Make your own raspberry robot, control it over the internet in FPV mode with super low latency and securely share access on it to your friends with Vigibot.com! You are welcome to test our robots now!
https://www.vigibot.com (100% free, no ads)

User avatar
Serveurperso
Posts: 25
Joined: Tue May 21, 2019 1:30 pm
Contact: Website

Re: VLI firmware v2.0 - powersaving features enabled

Wed Dec 11, 2019 7:37 am

trejan wrote:
Mon Dec 09, 2019 9:07 pm
Serveurperso wrote:
Mon Dec 09, 2019 7:33 pm
How to prevent VL805 from updating ?
Edit /etc/default/rpi-eeprom-update and add ENABLE_VL805_UPDATES=0

Other option is to disable ASPM in the USB controller using the setpci command mentioned by iEvgeny. You'll need to run it every boot though.
There is a problem :
- I run the downgrade cmdline
- Reboot / Downgraded OK
- I do a second reboot
- VL805 is Upgraded ! The ENABLE_VL805_UPDATES=0 do not work.

The only way I found is to disable completly the eeprom upgrade service :

Code: Select all

systemctl disable rpi-eeprom-update
No more update on reboot...
Make your own raspberry robot, control it over the internet in FPV mode with super low latency and securely share access on it to your friends with Vigibot.com! You are welcome to test our robots now!
https://www.vigibot.com (100% free, no ads)

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2239
Joined: Thu Jul 11, 2013 2:37 pm

Re: VLI firmware v2.0 - powersaving features enabled

Wed Dec 11, 2019 10:44 am

Serveurperso wrote:
jdb wrote:
Mon Dec 09, 2019 9:12 pm
For people experiencing webcam issues, what happens if you use the 0137ab firmware and run the following commands?

Code: Select all

sudo apt install pciutils
sudo setpci -s 01:00.0 0xd4.B=0x40
This disables PCIe link power management on the VLI chip.
Hi,

I returned to stock updated image and the last VL805 eeprom to check your command :
Do not work for me sorry:( same problem : video capture start but the stream look empty. ffmpeg debug trace don't see the problem !
From a basic Raspbian install, what commands to I need to run to replicate your ffmpeg video stream?
Rockets are loud.
https://astro-pi.org

User avatar
Serveurperso
Posts: 25
Joined: Tue May 21, 2019 1:30 pm
Contact: Website

Re: VLI firmware v2.0 - powersaving features enabled

Wed Dec 11, 2019 3:13 pm

jdb wrote:
Wed Dec 11, 2019 10:44 am
From a basic Raspbian install, what commands to I need to run to replicate your ffmpeg video stream?
I remplaced all variable tocken with value inside my cmdline :

Code: Select all

 "CMDDIFFUSION": [
  "/usr/local/vigiclient/processdiffusion",   (it's ffmpeg)
  " -loglevel debug",
  " -f v4l2",
  " -i /dev/video0",
  " -vf hqdn3d=0:0:50:50",                     (same problem without this filter)
  " -pix_fmt yuv420p",
  " -c:v libx264",
  " -preset fast",
  " -tune zerolatency",
  " -profile:v baseline",
  " -b:v 1500000",
  " -maxrate 1500000",
  " -bufsize 1500000",
  " -g 25",
  " -f rawvideo",
  " tcp://127.0.0.1:8000"
 ],
 
implode :

Code: Select all

ffmpeg -loglevel debug -f v4l2 -i /dev/video0 -pix_fmt yuv420p -c:v libx264 -preset fast -tune zerolatency -profile:v baseline -b:v 1500000 -maxrate 1500000 -bufsize 1500000 -g 25 -f rawvideo tcp://127.0.0.1:8000
But if you want exactly the same configuration you need my USB video capture adapter and a raw H264 baseline decoder
The USB Video capture I use have a good hardware deinterlacing filter (like yadif).
I think the problem is the same with any basic USB video capture or webcam and transcode to any other output format ! But if I can help you...

If you want I can give you a root access on this Raspberry PI, there is a brand new ready to stream raspbian image.
You can do realtime test here : https://www.vigibot.com
Click on the small blue robot icon named "Astro" from "Pascal" user. The live video appear, (it's a sensitive analog astronomy camera for sky monitoring)

Pascal
Make your own raspberry robot, control it over the internet in FPV mode with super low latency and securely share access on it to your friends with Vigibot.com! You are welcome to test our robots now!
https://www.vigibot.com (100% free, no ads)

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2239
Joined: Thu Jul 11, 2013 2:37 pm

Re: VLI firmware v2.0 - powersaving features enabled

Wed Dec 11, 2019 4:41 pm

Well that ffmpeg command works for me with the Logitech 4K Brio cam. No idea what transport it is using, though - could be either mjpeg, raw or encoded h264.

@pfavr - same question - what ffmpeg command are you using for 4k mjpeg output?
Rockets are loud.
https://astro-pi.org

pfavr
Posts: 6
Joined: Sun Mar 06, 2016 7:06 am

Re: VLI firmware v2.0 - powersaving features enabled

Wed Dec 11, 2019 9:40 pm

jdb wrote:
Wed Dec 11, 2019 4:41 pm
Well that ffmpeg command works for me with the Logitech 4K Brio cam. No idea what transport it is using, though - could be either mjpeg, raw or encoded h264.

@pfavr - same question - what ffmpeg command are you using for 4k mjpeg output?

This is the command I'm using:

Code: Select all

ffmpeg -f v4l2 -input_format mjpeg -video_size 3840x2160 -framerate 30 -thread_queue_size 64 -i /dev/video0 -c:v copy -copyts -r 30 out.mov
When I was using the newest USB firmware, I had to change the -video_size option to 1920x1080 to make it work. Caused me quite some headache :D

Thanks for supporting us - really appreciate it!

Best regards,

Peter

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2239
Joined: Thu Jul 11, 2013 2:37 pm

Re: VLI firmware v2.0 - powersaving features enabled

Fri Dec 13, 2019 1:40 pm

OK. Weird stuff is happening.

First, the setpci command isn't sticking because the PCIe link control register is being reset to 0x43, i.e. ASPM enabled, despite writing 0x40 to it. Writing either 0x41 or 0x42 sticks, so I bet the VLI firmware has a task that's clobbering the register if ASPM is disabled.

With PCIe link ASPM enabled, I have two [email protected] yuyv422 cameras that exhibit different behaviours. One camera will get about 2fps via ffmpeg, with many dropped isochronous packets. The other will work just fine at 30fps. The working camera has a video data endpoint alt setting of 3x820-byte packets per isochronous service interval, the broken camera has an alt setting of 3x1020.

On the analyzer with the broken camera attached, there are sporadic times where no isochronous transfers take place, i.e. the controller is not asking the camera for video data. Subsequent video packets have the "error" bit set in the UVC header which causes the driver to throw data away until the camera resets the bit on the start of a new frame. Immediately before the data stream stops, there is a very delayed IN transfer that does not transfer all 3 isochronous packets before the microframe expires. I would guess that the xhci controller is reporting an error at this point, and Linux is cancelling all the outstanding endpoint transfers.

With ASPM "a bit disabled" - 0x41 - the broken camera works.

Similar behaviour can be observed with the Logitech 4k webcam. With default ASPM, 4k streams are stuttery with an average of 11fps - with link control = 0x41 I get 30fps.

Can you repeat your webcam tests after running sudo setpci -s 01:00.0 0xd4.B=0x41?
Rockets are loud.
https://astro-pi.org

User avatar
Serveurperso
Posts: 25
Joined: Tue May 21, 2019 1:30 pm
Contact: Website

Re: VLI firmware v2.0 - powersaving features enabled

Sun Dec 15, 2019 4:05 pm

Hello,

- I just put on my Raspberry PI 4 the fresh Raspbian Image (+Vigibot software) from my CI/CD.

- First boot, USB Capture Work (because old EEPROM from previous image with EEPROM update disabled)
- Second boot (EEPROM auto update) - USB Capture NOT Work (It mimics good functioning but no video)

- I keep the "bad" ffmpeg capture process runing and I type your cmd " setpci -s 01:00.0 0xd4.B=0x41 "
- Video appear immediately on vigibot.com without other action.

Interesting :I don't need to restart ffmpeg process to repair it with setpci.
You are on the right way for the debug.
Make your own raspberry robot, control it over the internet in FPV mode with super low latency and securely share access on it to your friends with Vigibot.com! You are welcome to test our robots now!
https://www.vigibot.com (100% free, no ads)

neeto33
Posts: 1
Joined: Mon Dec 30, 2019 5:42 am

Re: VLI firmware v2.0 - powersaving features enabled

Mon Dec 30, 2019 6:04 am

As foot note,
This also affects streams for DVB-T USB receivers.
I have three DVB-T USB receivers plugged into a USB3 hub on one of the Pi 4's USB3 ports.
Without the setci -s 01:00.0 0xDB.B=0x41 there is continual breakup of the stream, like what others have reported from their webcam.
Been chasing this for a number of weeks - glad to get to the bottom of it.

crnewton
Posts: 7
Joined: Wed Dec 18, 2019 11:00 am

Re: VLI firmware v2.0 - powersaving features enabled

Mon Jan 06, 2020 11:19 am

I had 2 issues that seem to be related to this firmware update.
the update didn't fix it for me, 'sudo setpci -s 01:00.0 0xD4.B=0x41' dit fix it (with our without this update).

my problems were:
- usb lagging & key sticking when using usb webcam:
https://www.raspberrypi.org/forums/view ... p?t=256681
https://www.raspberrypi.org/forums/view ... 8&t=246771
- pygame.getimage unable to get a high resolution from the usb camera:
https://bugs.launchpad.net/raspbian/+bug/1857438

I hope this info helps.

KaraokeAmerica
Posts: 12
Joined: Wed Jul 10, 2019 2:52 pm

Re: VLI firmware v2.0 - powersaving features enabled

Wed Feb 26, 2020 4:01 pm

itsmedoofer wrote:
Sun Sep 08, 2019 12:07 pm
Hi,

Booting from a PNY SSD.....
I may have been in hibernation for the last 6 months so sorry if I missed this and revived this old thread, but are you saying you booted a Pi4 from USB? I thought that feature wasn't available yet?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25440
Joined: Sat Jul 30, 2011 7:41 pm

Re: VLI firmware v2.0 - powersaving features enabled

Wed Feb 26, 2020 4:13 pm

KaraokeAmerica wrote:
Wed Feb 26, 2020 4:01 pm
itsmedoofer wrote:
Sun Sep 08, 2019 12:07 pm
Hi,

Booting from a PNY SSD.....
I may have been in hibernation for the last 6 months so sorry if I missed this and revived this old thread, but are you saying you booted a Pi4 from USB? I thought that feature wasn't available yet?
It's not. They would need to be using an SD card for initial boot.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

tyjtyj
Posts: 3
Joined: Mon May 26, 2014 1:55 pm

Re: VLI firmware v2.0 - powersaving features enabled

Tue Mar 24, 2020 7:05 pm

jdb wrote:
Sat Sep 07, 2019 6:56 am
Weird. Injecting current into the D+/D- lines has been known to stop the PMIC from starting up as it causes leakage into the 3.3V supply.
The only way that the firmware could be changing this behaviour is if Vbus isn't removed during device reset - worth investigating.
Do we have solution to this? the issue remain on latest stable firmware.

Return to “Troubleshooting”