Well if you can ping it, the nics are ok, and is a different issue because the issue I wrote above the eth0 don't respond the pings
So I was able to do some benchmarks finally. We are moving soon to a new home, from the current 500/30 cable to 1000/300 FTTH pppoe internet. I bought the R4S hoping that it will be able to deal with this and maybe even do sqm on top.
I have seen it route gigabit with sqm but not how it deals with the additional pppoe overhead. I'm happy to report that it is fully capable of saturating Gigabit pppoe nat and even doing sqm over it with a+ rating on bufferbloat waveform test site. So I'm very happy with my choice, this is a perfect little router for Gigabit speeds.
speedtest page without sqm:
bufferbloat test with sqm set to 870:
all this over a pppoe connection.
I was using Anaelorlinski OpenWrt 22.03.5 (stable) minimal build. Schedulers were both on schedutil, irq on small cores, queues on the big cores.
FYI: I had time to build from Git (2023-05-13, just before kernel 5.15.111 got pushed) and update my device. My R4S is running smooth since about 12 hours.
Video: Did anyone here manage to get hardware encoding/decoding working?
could you give some tips how to do it?
Would you share your config settings please? also your net-smp-affinity? im using Qosify with the @anaelorlinski builds with Pppoe, and im setting my download to 700mbs to achieve a A rating on waveform, wondering if i have something configured incorrectly. Thanks
That's not entirely correct, the r6c traded one of the 2.5gb ports for an M.2 2280. The r6s lacks that option so I would not call the r6c a "budget version". M.2 could provide storage,WIFI or SATA ports (etc).
Yes, I'm sure there is room for improvement, I just played around with it for 1 day as we're not permanently at the new home yet. Just had to make sure it will be fine after we move there soon. For the config which I liked the most for the speed tests with pppoe+sqm I haven't even changed much from the defaults.
By default the IRQ's are going on the big cores, I haven't changed that. Also I left the default schedutil scheduler, as performance always keeps the freqs (and thus the consumption and temp) at max, while powersave keeps them fixed on the lowest. I just add these lines to set the queues to spread among the small cores in /etc/rc.local.
echo f > /sys/class/net/eth0/queues/rx-0/rps_cpus
echo f > /sys/class/net/eth1/queues/rx-0/rps_cpus
For SQM settings I just specified the limits like 800000 down / 290000 up and had cake/piece of cake set which are the defaults.
Thanks alot for that. I just got my R4S last week and couldnt get over 550mbps with SQM. I made the same chnages as you and im getting ~750mbps now with comfortable CPU usage.
I got an answer from support. Wanted to share here if anyone is curious.
Hi,
Related to the kernel version, 5.15 mainline kernel does not have mpp and other driver support, but the 4.19 kernel does, so you can try the 4.19 version of the kernel.
https://dl.friendlyelec.com/nanopir4s
image filename:
01_Official images/01_SD card images/rk3399-sd-friendlywrt-21.02-kernel4-20230527.img.gz
Question e-mail:
Dear Tech Support,
I hope you are doing well. I am writing to seek your help regarding hardware-enabled video encoding on the R4S router. I have been exploring the possibility of using H264 hardware encoding capabilities on this device, as mentioned on the FriendlyARM website.
During my research, I came across a GitHub repository called https://github.com/jjm2473/ffmpeg-rk. It seems that there is potential for achieving hardware-accelerated video encoding using the Rockchip platform. However, I encountered an issue where I am unable to find the following device nodes on my R4S router:
"/dev/hevc_service"
"/dev/hevc-service"
"/dev/mpp_service"
I would like to inquire about the current progress regarding hardware-accelerated video encoding on the R4S router in May 2023. I am particularly interested in utilizing the Mali-T864 GPU, which supports OpenGL® ES1.1/2.0/3.0/3.1, OpenCL™, DX11, and AFBC.
Could you kindly provide me with any information, guidance, or resources that can help me enable hardware-accelerated video encoding on my R4S router? I would greatly appreciate any insights or assistance you can provide in this matter.
I am eagerly looking forward to your support and guidance to enable H264 hardware-supported encoding on my R4S router. It would significantly enhance the performance of my device and enable it to handle video encoding tasks more efficiently.
Thank you in advance for your attention to this matter. I appreciate any assistance or information you can provide. Please let me know if you need any additional details or if there is any further information that would be useful in addressing this issue.
Best regards,
This week Tianling Shen pushed kernel 6.1 support for Rockchip to git. I built master with kernel 6.1.29 yesterday. So far everything I use works great (uptime about 12 hours).
Hello there!
I hope you're all doing well. I recently acquired a Nanopi R4S and have been experimenting with OpenWrt using the images provided by anaelorlinski. Specifically, I'm using the ext4 version for my 128GB SD card. While I've made some progress, there are a few aspects that I'm still trying to figure out, and I could use some guidance from experienced users.
Firstly, the basic layout of my SD card consists of two partitions, and there is an unpartitioned residual space remaining. I've come across a recommendation from Mercy to partition and format this residual space, adding it as a third partition to my SD card. I'm wondering if it would be advisable to delete the second partition that currently houses the /opt/ folder for Docker. My goal is to use the third partition for Docker and storing my files. What would be the recommended approach in this case?
Additionally, the image I'm using already includes AdguardHome. I was able to access the dashboard using port 3000, but I'm uncertain about the complete installation process. I understand that I need to specify a port for the admin dashboard and another port for the DNS listening server. Could someone please advise which ports I should use and how I can integrate it with the DNS settings on OpenWrt?
One concern that has caught my attention is the presence of legacy iptables rules in the firewall. The system warns against mixing iptables and nftables rules, as it may lead to incomplete traffic filtering. Considering my goal of enforcing DNS over HTTPS and DNS over TLS, as well as hijacking all DNS traffic to force it through AdguardHome, should I be worried about this warning? Previously, on a regular router without AdguardHome, I used the HTTPS DNS Encrypt package and added an adblock using dnsmasq to achieve similar functionality.
I'm curious if anyone else in the community uses AdguardHome and has successfully reinforced it for all their DNS-related needs. I would greatly appreciate hearing about your experiences and any recommendations you may have.
- To use the unpartitioned space, if you use ext4 then this is similar to a standard linux distribution and you can use fdisk to create the partition, mkfs to format it and add it to the fstab to mount it at boot
- For AdGuardHome if you want to replace the DNS server with AdGuardHome follow this guide : [How-To-Updated 2021] Installing AdGuardHome on OpenWrt [Manual and opkg method] , it has all information provided and this is how my setup works
well, while I'm still learning how to implement my R4S does anyone have issues when restarting your device? it seems when it shutdowns or I restart it doesn't detect the ethernet cable to my laptop, I mean the led with the LAN is on and I see there is like IP assigned but is nothing transmitted, so in order to fix it I need to plug out/in the ethernet cable, is this a common issue or I need to install anything extra?
I know that happened to me once at a power outrage where the LAN won't reconnect to my switch.... I think that was with the initial release of openwrt 22.x .....currently on 22.03.4
It doesn't happen on my R4S, however I am only using the stock version from OpenWrt team, not any other variants.
wanted to share some insights with you all. Recently, I came across a useful tool called taskset
that allows you to assign specific CPU cores to tasks, enabling better control over resource allocation. If you're looking to optimize CPU utilization for specific tasks or services, taskset
can be a handy tool to have in your toolkit.
For instance, if you have a big.LITTLE architecture with a mix of Cortex-A72/A73 (big) and Cortex-A53 (LITTLE) cores, you can use taskset
to distribute tasks accordingly. By assigning performance-intensive tasks to the high-performance cores and less CPU-intensive tasks to the energy-efficient cores, you can achieve better performance and power efficiency.
I found something unexpected, ffmpeg
seems more performant on the R4S A53 CPU's! It might be affected by other processes, but I tried twice with similar results. I thought it was worth sharing here.
time taskset -c 0-3 ffmpeg -i 23-06-17_12-40-00camera-1.mp4 -c:v mpeg4 output.mp4 -y
real | 0m 42.45s |
---|---|
user | 1m 23.08s |
sys | 0m 1.58s |
time taskset -c 4-5 ffmpeg -i 23-06-17_12-40-00camera-1.mp4 -c:v mpeg4 output.mp4 -y
real | 0m 32.13s |
---|---|
user | 0m 39.79s |
sys | 0m 0.90s |
Edit: It seems all CPU's are clocked at the same speed:
Processor : 0
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 1
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 2
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 3
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 4
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 2
processor : 5
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 2
Online I read: " The Nanopi-R4S is based on the RK3399 SoC which is a dual Cortex-A72 core and a quad Cortex-A53. In FriendlyWRT the A72 is clocked at 1.8GHz and the A53 at 1.4GHz." - Could it be that the A72 is not running at 1.8GHz in OpenWRT?
Edit: The moment that I switched my ffmpeg stream to CPU 4,5 led to a nice reduction on my 5m CPU load chart.
Where are you getting CPU clock speed info from in that output?
BogoMIPS
?
I'm no expert but I've seen others post that BogoMIPS
doesn't indicate CPU clock speed.
OpenWrt supports the standard frequencies of 1.4 GHz and 1.8 GHz.
The RK3399 processor can slow down from max speed when demand is low unless it is set to stay at high frequency.
You may find the info from the output of
grep "." /sys/devices/system/cpu/cpu?/cpufreq/cpuinfo*
interesting.
Here is the output from my R4S with very little load on it:
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq:1008000
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq:1416000
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq:408000
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency:40000
/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_cur_freq:1008000
/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq:1416000
/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_min_freq:408000
/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_transition_latency:40000
/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_cur_freq:1008000
/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_max_freq:1416000
/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_min_freq:408000
/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_transition_latency:40000
/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_cur_freq:1008000
/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_max_freq:1416000
/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_min_freq:408000
/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_transition_latency:40000
/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq:408000
/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_max_freq:1800000
/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_min_freq:408000
/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_transition_latency:440000
/sys/devices/system/cpu/cpu5/cpufreq/cpuinfo_cur_freq:408000
/sys/devices/system/cpu/cpu5/cpufreq/cpuinfo_max_freq:1800000
/sys/devices/system/cpu/cpu5/cpufreq/cpuinfo_min_freq:408000
/sys/devices/system/cpu/cpu5/cpufreq/cpuinfo_transition_latency:440000
...or other info such as
grep "." /sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies:408000 600000 816000 1008000 1200000 1416000
/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_frequencies:408000 600000 816000 1008000 1200000 1416000
/sys/devices/system/cpu/cpu2/cpufreq/scaling_available_frequencies:408000 600000 816000 1008000 1200000 1416000
/sys/devices/system/cpu/cpu3/cpufreq/scaling_available_frequencies:408000 600000 816000 1008000 1200000 1416000
/sys/devices/system/cpu/cpu4/cpufreq/scaling_available_frequencies:408000 600000 816000 1008000 1200000 1416000 1608000 1800000
/sys/devices/system/cpu/cpu5/cpufreq/scaling_available_frequencies:408000 600000 816000 1008000 1200000 1416000 1608000 1800000
I hope that helps. :-)
it seems is stable now, I'm using the minimal image from anaelorlinski, I just removed the default adguard package and installed the edge version of adguard following the script from mercy, it seems stable at the moment, very happy with the r4s although maybe is an overkill.
I didn't use AdGuard so I can't tell, I actually use LXC to run PiHole on top of it (plugged an old 8GB USB stick), R4S has plenty of resources for that.