Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upWebRTC, WebTorrent & Simple-Peer on ARMv6 RasPI Zero #1752
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi.
Two issues here, one is already solved, I just want to report it.
The second is more about seeking clarification details about the first issue, and it is only indirect related to WebTorrent.
My goal here is more related to report the first (solved) issue, to the people that my have interest, than to ask about the second, which is my interest also but seems to be more difficult to find help...
FIRST ISSUE [already solved]
I just want to report that I successfuly compiled from source, the Node WRTC Module targeting ARMv6 RaspberryPI Zero Platform. I tested it with Simple-Peer and also with WebTorrent-Hybrid (Nodes), they are working.
The tests I did are only very simple, and, for the RaspberryPI Zero, my goal is the BASICS, around datachannel only.
Officially, Node WRTC only supports ARMv7 and better, so I had to compile it from source... and in the process had to build a cross compiler toolchain x86 to ARMv6 (which turn out to be very easy using Crosstool-NG).
In relation to this first issue, I just want to inform that I did a small tutorial, recording all the steps I did, as well as including the scripts with necessary changes to target ARMv6 CPU. Including script/instruction to build the cross compiler.
Keep in mind that, for RPI2, RPI3, RPI4 the Node WRTC Module already have support, so, there is no need of building it from source, just install and use...
Here is the link to the tutorial: https://github.com/t2age/webrtc-armv6
Second issue
This second "issue" is only indirectly related to WebTorrent and thus Simple-Peer, but it is relavant anyway.
The issue is that, the resulting binary that I am getting, according to the utility "readelf", have machine code instructions which is only found on ARMv7 cpus, and, ARE NOT implemented on ARMv6 cpus, thus, if this is true, there is a potential, for, at some circumstances, the binary run into "illegal instruction" fatal-error...
What happens is that, Simple-Peer and WebTorrent-Hybrid ARE WORKING!
The very little tests that I did went without any problems...
And since my goal for the RaspberryPI Zero revolves around datachannel only, I am trying to understand the meaning of the "readelf" output so that I can have a better understanding about the compiled binary that I am getting...
Out of 2000 object files, 12 of them are reported to have ARM NEON and VFPv3 instructions, which according to the ARM datasheet are NOT implemented on the ARMv6 cpus... these 12 files are all related to a module called "boringssl", which is a Google fork of openssl...
I did ask this specific question on "discuss-webrtc" mailing list, here:
https://groups.google.com/forum/#!topic/discuss-webrtc/GCqxmB4qZ1E
No specific answer or infos yet...
Here is a Simple-Peer Datachannel sample that I did and I am using it inside a RaspberryPI Zero, and between a RaspberryPI Zero and RaspberryPI 3, and it is working without problem. WebTorrent-Hybrid also OK for seeding and downloading...
Sample Code is here:https://github.com/t2age/webrtc-easy-power
If anybody here have any information to add about this second issue, please let me know...
A RaspberryPI Foundation core developer answer this question by saying that, a runtime mechanism that check CPU capabilities and then take appropriated actions exist, but he was unable to POSITIVELY make that statement, reserving himself to something like "I believe" or "It is the known practice and it should be the case"...
I have decide to use "brute-force" to deal with this second issue, creating a small set of tests that, when passed, will "certify" the binary for a certain level of working capacity, and, since the goal is only basic stuff around datachannel, for some applications/usage, that should be sufficient to justify the use...
I don't have the tests yet...
Besides these tests, I will love to have more information about...
Why RaspberryPI Zero (single core, ARMv6)?
As I said, my goal here is more about reporting WebRTC and WebTorrent working on a RPIZero, than it is to ask the second issue.
And, I have GOOD REASONS to believe that, it also, can be of interest of all people who have interest in WebRTC and WebTorrent!
Inside the above sample files, I have included a little doc (draft), giving some hints about the reasons WHY run WebRTC or WebTorrent on a single core ARMv6 single board computer.
The following is one slide from the little doc (entitled "cloud zoo")...
Here I am trying to argument that, instead of JUST using little SBCs to build DATA Cloud, we can thing of using little SBCs to build METADATA Cloud, in this case based on WebRTC and WebTorrent/Bittorrent.
The change here is not in coding, just a little Paradigm Shift in mindset!
Another little Paradigm Shift in mindset that I believe we need to promote is shown on another slide below:
I think that we need to "detach" soft apps from the monolithic general purpose desktop PC, and have them running into "domain specific" HARD APPS... again, there is little need to invent something new, it is just a question of changing the Paradigm that is prevalent (the desktop PC)...
I believe that, when WebRTC, BT and WT are running inside the paradigm of the old ALL-in-ONE PC, as cool as they seems to be, they are LIMITED by the old paradigm itself... it is only when we combine them with U$15 (or so) SBCs, that it become possible to UNLEASH the true potential of these platforms (WRTC, WT, BT)...
The full doc is inside the "docs/" folder...
Concluding...
So, because I believe that running WebRTC (simple-peer) and WebTorrent on a ARMv6 RPIZero is such a interesting thing to have, it motivate me to post the information on how to get it compiled from source for the ARMv6 cpu...
Regards all,
Valter