Help needed diagnosing poor IP camera performance with only 'some' hvms

17 views
Skip to first unread message

*Null* **

unread,
Jan 24, 2020, 10:30:27 AM1/24/20
to qubes-users
I had three cameras attached to a PoE switch, which was plugged into a NIC on a qubes machine. They ran through an OpnSense hvm(standalone) and out through sys-net. Performance was fine but I wanted to move to a qubes template-based vm to control the NIC.

So I created a Debian-10-minimal template, installed qubes-core-agent-networking and qubes-core-agent-network-manager(the only non stock things installed), assigned the NIC to the AppVM(in HVM mode), and configured the camera facing NIC(ens7 in this case) as "Shared to Other Computers". I gave the debian vm the same ram(4gb) and vcpus(2) as the OpenSense hvm. Performance was terrible.

On an external wifi I could typically get a stream of 4000 kbps with the OpnSense hvm routing the cameras through Qubes.
Now, I am getting at best 100kbps and the connection drops off.

To test, I attached the NIC to a Fedora 30 vm running an apache server and was able to connect to the cameras at 4000kbps. In all cases, the cameras have been routed through the same sys-net and sys-firewall vms whether they are coming from OpnSense, debian, or fedora.

I have a similar setup connecting other computers to Qubes, where their NICS are run by a copy of the debian-minimal hvm and browsing and downloading is unaffected. I can usually get about 90% of my network connection speed, through a vpn, with it set up this way.

For my own education, what could be causing the differences in the connections with these cameras?
Are the cameras saturating a buffer I could tweak?


*Null* **

unread,
Jan 25, 2020, 9:52:11 AM1/25/20
to qubes-users
I did find one thing that may or may not be related. The NICs on my machine are Realtek 8111E and there is some chatter on the Internets that the standard driver for this NIC family are buggy. During install debian and fedora default to the driver 'r8169' which is suspect. The correct driver should be r8198 for this family of cards.

Some of these r8198 drivers are available in the debian non-free section. But enabling by enabling this repo in qubes, or installing the debian package 'firmware-realtek' does not update the driver firmware.

I tried to build the driver following these instructions: https://unixblogger.com/how-to-get-your-realtek-rtl8111rtl8168-working-updated-guide/
Using apt install r8168-dkms and this seemed to conflict with qubes itself because I suspect it is trying to build into 4.19.84.pvops.qubes.x86_64 instead of what it thinks is going to be the debian kernel. It throws "error bad return status for module build on kernel: 4.19.84.pvops.qubes.x86_64

downloading the drivers from realtek and using their auto installer also runs into a problem trying to generate latent entropy at ./include/linux/random.h:26:31 giving an error for latent entropy undeclared. Perhaps this is to do with the qubes method of generating randomness being different as well.

Either way this may all not matter because the data rate from these cameras is fine in fedora, which is using the same or similar r8169 driver. But the 8111 and 8168 network chips are pretty common so maybe their correct drivers should be added into qubes itself at some point.
Reply all
Reply to author
Forward
0 new messages