openDsh / dash

Join us on Slack! https://join.slack.com/t/opendsh/shared_invite/zt-la398uly-a6eMH5ttEQhbtE6asVKx4Q
GNU General Public License v3.0
237 stars 69 forks source link

(Feature) Pi3/4 Buildroot build with AADash? #167

Open RuhanSA079 opened 1 month ago

RuhanSA079 commented 1 month ago

Hello,

I was struggling for a long time to get a Pi3/Pi4 to boot fast enough, taking me like 25-30 seconds to boot to the dash application, even on a barebones Debian lite version with no GUI like XFCE.

Has anyone got a faster method of a lightweight kernel with the minimum required modules to boot as fast as possible, (2 seconds or less) with starting the userspace program after the kernel boot?

I really would like to fork buildroot, implement some method to build the aadash application as a software package on Buildroot and start minimizing boot times.

I would need to first build a fresh buildroot image, and see what the boot time is, before committing to compiling aadash.

parad0xnasha commented 2 weeks ago

I can't think of the right analogy right now, but what you're asking is the commitment of hundreds of specialised man-hours, for free, to make your DeLorean fast enough to defeat gravity and enter low earth orbit, so that you may enjoy the view. There are also multiple problems with your "idea", aside from the fact that you want all of this because your implementation is too slow for you. Firstly, and I believe the fundamental issue at hand is of your current 30sec load time, Dash is probably responsible for <10%. Just in case you're not following, 90% or more of your personal grievance has nothing to do with this project. Raspbian is the official OS for the very specific hardware-set known as Raspberry Pi. That's who knows how many man-hours, dedicated to building a Linux distro, using a known hardware-set - It's not without reason, that their Lite build, is precisely what it says on the box - The bare minimum to boot a Linux kernel and ready to take user/hardware input, on Raspberry Pi hardware.

Secondly, your goal is completely irrational, not to mention nowhere near attainable - Regardless of the underlying hardware. If you know some secret line of laptops that I do not, that boots to a graphical interface and executes user software capable of playing media, in under 2 seconds, then please tell me the secret.

Tertiary, you want to achieve this impossibility, using the barest of minimum hardware requirements for the task. Every individual project that aims to provide Dash/AA functionality that I have come across, have mostly taken some specific workarounds to deal with the limitations of 3B+, and conversely a 4B 1GB. Until recently, merely building OpenDash would crash a 3B+, and changes for a 4B-1GB are still in a developer's personal build (I know this, because I raised the issue with him). I can't speak anecdotally, but it stands to reason that running one of these applications on a 3B+ would be rather noticeably slower, than on something with more resources. The project, who charges users for the privilege of its use, sets the hardware minimum requirements as a Raspberry Pi 4 Model B-2GB. That is, they do not support nor can't guarantee its function on 1GB RAM. OSS being what it is, has found ways to make 3B+'s usable because anyone interested in DIYing something like this, probably has one or more sitting around gathering dust.

You want to make the single biggest and easiest impact to your boot times? So 3B+ hardware, is the SD card from the same era? Buy a NEW, modern, brand-named SD-card, that is certified min. class V30 (60 to be sure) & type A2. With the case of Pi 4's, we have USB3. A basic USB-SATA adapter, and a budget SSD drive will wipe the floor with SD's speeds. If you want to push as fast as you can, a brand name, flash-based USB drive, that supports UASP, and has tried and tested performance metrics.

If really wanted to make a difference to the speed, you'd upgrade your hardware, to have NVMe support - Go as fast as you want to, but stick to named brands and reliable metrics. Then, the approach I would take is implementing hardware hibernation (active system-state to disk). If you want faster again, then hardware which will adequately support low-power sleep state, and THEN and only then, might you actually come close to your <2s load target.

At the beginning you said "I really would like to fork buildroot, implement some method to build the aadash application as a software package on Buildroot and start minimising boot times.". Nobody is stopping you from pursuing your own crazy dreams, this is the beauty of OSS. I can guarantee you that all the tools necessary to attempt, even implement your dream already exist and are out there in the open, however you're not going to break the 2s barrier, sorry.

kylegordon commented 1 week ago

To counter the "you're not going to break the 2s barrier" in the above diatribe, the Pi3 can cold boot to a shell in 1.75 seconds according to https://www.furkantokac.com/rpi3-fast-boot-less-than-2-seconds/

I have zero experience of this, but more can be found at the above link.

Good luck. I suspect you will have quite the journey with buildroot and then with the userland applications. The outcome will be fantastic though.