MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.79k stars 494 forks source link

Image | NanoPi M4 #2399

Closed N3mill0 closed 4 years ago

N3mill0 commented 5 years ago

Specs: https://www.friendlyarm.com/index.php?route=product/product&product_id=234

Give us some formal device information:

Is the SBC officially supported by the Debian installer?

If not, is a reliable 3rd party Debian image available for this SBC?

cocoflan commented 4 years ago

Screen flashes afther some time takes 30 sec. or more, and is trying to look for some kind of resolution, then its black again.

Strange or not?

MichaIng commented 4 years ago

@cocoflan Hmm, can you SSH into it?

cocoflan commented 4 years ago

video component problem i guess, i use an old flatscreen monitor with vga to hdmi convertor, works good on the script version but not on the image you sent me.

cocoflan commented 4 years ago

My build from the ground up works perfect, so there must be some trouble in the hardware drivers you compiled or so i guess.

cocoflan commented 4 years ago

what i have noticed is that the mac address with nanopi m4 v1, always changes after reinstallation. so i can't test ssh without screen for the moment.

cocoflan commented 4 years ago

Can't the "Image | NanoPi M4" name be changed to "Image | NanoPi M4v1" to avoid confusion in issues?

rafee74 commented 4 years ago

Boot time is as before:

This times are without any software ore services added to the standard installation.

MichaIng commented 4 years ago

@cocoflan

My build from the ground up works perfect, so there must be some trouble in the hardware drivers you compiled or so i guess.

I didn't compile anything. It's just the DietPi installer run on the official Armbian image, nothing else. How did you build from ground up? The Armbian build tools or what you mean?

what i have noticed is that the mac address with nanopi m4 v1, always changes after reinstallation. so i can't test ssh without screen for the moment.

That is indeed annoying. I have to look into this, there must be something actively covering the real hardware MAC address but IMO this should not be done without user knowledge, so routers can always identify known hardware.

Can't the "Image | NanoPi M4" name be changed to "Image | NanoPi M4v1" to avoid confusion in issues?

I am not even sure if I add this image at all. From all our test results it looks like it doesn't make a difference if M4, NEO4 or T4 is used, hence a single image is sufficient, and since T4 image currently works best and is the only one that enables full hardware features on T4, this is what we'll keep, as of current state.

@rafee74 Okay thanks for your testing @cocoflan as well. So at least it boots now from SDcard and eMMC, only slow, same as the T4 image already did. As long as the official Armbian image, or one build with their build tools does not do better, we cannot do much, as this is all we get. However Linux mainstream support for ARMs is increasing fast and as long as it's only boot time, not a major issue (IMO).

cocoflan commented 4 years ago

The tool i used for my good working setup is https://github.com/armbian/build, and then used the script from dietpi. https://github.com/MichaIng/DietPi/issues/1285

Used minimal non graphical terminal base build for the building process.

Greetings cocoflan :-)

MichaIng commented 4 years ago

@cocoflan What is the kernel version?

uname -a
cocoflan commented 4 years ago

4.4.192-rk3399 is the kernel version.

Linux DietPi 4.4.192-rk3399 #6 SMP Tue Oct 8 18:32:46 CEST 2019 aarch64 GNU/Linux

Greetings

MichaIng commented 4 years ago

@cocoflan Ah, this is the major difference, I used the 5.4 mainline kernel image. But probably the advantages do not yet outweigh the disadvantages.

cocoflan commented 4 years ago

Ah ok yes this must be it, i will test a new image with armbian build tool on kernel 5 to test and see.

Greetings en thx to keep me informed.

cocoflan commented 4 years ago

Or cane you make an image with the lower kernel version to test?

Greetings

MichaIng commented 4 years ago

@cocoflan Okay, I'll do that later.

MichaIng commented 4 years ago

@cocoflan Done: https://dietpi.com/downloads/testing/DietPi_NanoPiM4v1-ARMv6-Buster_Linux4.4.7z

cocoflan commented 4 years ago

Ok thx will test it soon.

Greetings

cocoflan commented 4 years ago

Did a first run, and boots like normal, no delays or no screen trouble with this image!!!

Will run some test to see if all is running like on my image!!

At first sight it looks likes it's ok with this kernel!!

Greetings cocoflan

rafee74 commented 4 years ago

I confirm the booting time is half than the previous images. I'll test graphics and analog audio (what I'm interesting in) and let you know.

MichaIng commented 4 years ago

Okay many thanks for testing guys. I think I'll recreate M4/NEO4/T4 images with 4.4 kernel then. Not sure if we want to offer both? 5.X kernel has several other advantages that might outweigh the long boot time for some users. Depends on use case...

cocoflan commented 4 years ago

You are welcome, keep ont he good work. Will the install image of dietpi M4v1 be available on the SBC list on dietpi website?

Greetings cocoflan

cocoflan commented 4 years ago

How can i change the wifi hotspot adress for dhcp in commandline, because i see it is using the same adress like my other SBC with dietpi and i think i have a conflict, it is to test on this new image that works great for the moment?

cocoflan commented 4 years ago

Netdata package is not working from the package installer list on nanopi M4v1 image.

I installed it from https://docs.netdata.cloud/packaging/installer/ with the installer script:

bash <(curl -Ss https://my-netdata.io/kickstart.sh)

This does work.

Greetings cocoflan

MichaIng commented 4 years ago

@cocoflan On Debian Buster, the APT package is quite new, isn't it? But generally this is not a NanoPi M4 issue, could you open a new issue and paste the installer outputs/errors on this?

rafee74 commented 4 years ago

I'm having trouble with LXDE or LXQt in the last image. I've installed them (LXQt the first time and the unistalled it and Xserver and installed LXDE) and selected the automatic login with a user of mine (not dietpi). At boot the login process stops when it has to start X server and on Xorg.0.log there sre those lines:

...
...
...
[    18.667] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[    18.668] (EE) Failed to load 
/usr/lib/xorg/modules/drivers/modesetting_drv.so: librga.so: cannot open 
shared object file: No such file or directory
[    18.668] (EE) Failed to load module "modesetting" (loader failed, 0)
[    18.668] (EE) No drivers available.
[    18.668] (EE)
Fatal server error:
[    18.668] (EE) no screens found(EE)
[    18.668] (EE)
Please consult the The X.Org Foundation support
       at http://wiki.x.org
   for help.
[    18.668] (EE) Please also check the log file at 
"/home/easy/.local/share/xorg/Xorg.0.log" for additional information.
[    18.668] (EE)
[    18.783] (EE) Server terminated with error (1). Closing log file.

I've tried to solve and searched on Internet but I haven't found anything. I've tried also to compile librga.so following the instructions on this forum but it didn't work. Am I doing something wrong?


About the reboot command not working (see my previous messages), I've found the problem come when I login with normal user and then I launch su to become root. In this state, even if I'm root, when i launch reboot or any other root command it always response command not found The problem is in the $PATH variable, because if I launch echo $PATH I have those results:

As you can see, even if I become root from normal user, the PATH variable is always the same. Only if I login directly with root the PATH variable is ok for root user. I'm used to that if I sued to root I can do anything like I login directly with root. Is that ok or again I'm doing something wrong?

MichaIng commented 4 years ago

@rafee74 Ah jep, known issue fixed with v6.29. Please try:

wget https://github.com/rockchip-linux/rk-rootfs-build/raw/master/packages/arm64/rga/lib/librga.so -O /usr/lib/
cocoflan commented 4 years ago

Try update the system first with apt update and apt upgrade there are 2 updates for xwin env., and then try again. i had the same problem, and was fixed with first updating the 2 packages.

I am running the lxde env.

Greetings

MichaIng commented 4 years ago

@cocoflan Hmm, I hope it did not simply overwrite the xserver packages with the ones from Debian repo. Need to check the package versions then. Because AFAIK the Debian repo packages do not provide full GPU acceleration.

cocoflan commented 4 years ago

ok good to know, i will test your other solution.

Greetings

cocoflan commented 4 years ago

wget https://github.com/rockchip-linux/rk-rootfs-build/raw/master/packages/arm64/rga/lib/librga.so -O /usr/lib/

i get an error "/usr/lib/: Is a directory"

rafee74 commented 4 years ago

I test the @cocoflan solution and it worked ok.

@MichaIng I'll test also your solution, I want to reinstall again your last image and compare GPU acceleration

cocoflan commented 4 years ago

ok nice to hear that.

thx

MichaIng commented 4 years ago

@cocoflan Ah, since when wget -O does require a filepath. Okay then:

wget https://github.com/rockchip-linux/rk-rootfs-build/raw/master/packages/arm64/rga/lib/librga.so -O /usr/lib/librga.so
cocoflan commented 4 years ago

It worked with your wget solution also! i think it's a better solution indeed for the full GPU acceleration.

Greetings

cocoflan commented 4 years ago

es2gears is working now, did not work on my apt update apt upgrade solution.

So your solution is the one to use!

Greetings

cocoflan commented 4 years ago

The problem with netdata is it makes no errors on install, only can't open the web interface on port 19999.

Greetings

MichaIng commented 4 years ago

@cocoflan Okay I'm not sure when I find time to test the Netdata installer, until then I suggest to install the APT package respectively via dietpi-software.

Great that acceleration works now. I'll see if I can upload new package versions that don't get overwritten by Debian packages.

cocoflan commented 4 years ago

ok very good thx

greetings

MichaIng commented 4 years ago

Okay the xorg-server-core package as least has been updated, although no visual version string change:

cd /tmp
wget https://github.com/rockchip-linux/rk-rootfs-build/raw/master/packages/arm64/xserver/xserver-xorg-core_1.20.4-1_arm64.deb
dpkg -i xserver-xorg-core_1.20.4-1_arm64.deb
rm xserver-xorg-core_1.20.4-1_arm64.deb

I updated that one on our server as well.

cocoflan commented 4 years ago

Ok nice to hear!

Greetings

rafee74 commented 4 years ago

So, as promised, here are the results of the hardware acceleration tests. All tests were done with desktop environment LXDE and LXQt (I've done a brief test with Mate but I don't report it here as the final result is the same). I've done tests for:

Each configuration was tested with es2gears and glxgears commands. I leave each command running so that it give me at least 10 results for each configuration. Then I make an FPS average of those 10 results.

A parenthesis about es2gears: it didn't work for me, contrary to what @cocoflan wrote. If I launch it, I have this error on shell: es2gears: error while loading shared libraries: libEGL.so.1: cannot open shared object file: No such file or directory To make it work, I have to apt install libegl-mesa0; it didn't worked again because libEGL.so.1 was not created. I have to ln -s /usr/lib/aarch64-linux-gnu/libEGL_mesa.so.0.0.0 /usr/lib/aarch64-linux-gnu/libEGL.so.1 and finally it worked. So I don't know it this library is necessary or not.

By the way, here are my results, ordered by FPS:

Configuration FPS avg   Configuration FPS avg
es2gears_lxde_rck-xorg+librga+last-xorg 326,44   glxgears_lxqt_rck-xorg+librga 69,46
es2gears_lxqt_rck-xorg+librga+last-xorg 589,52   glxgears_lxqt_rck-xorg+librga+last-xorg 98,58
es2gears_lxqt_rck-xorg+librga 595,78   glxgears_lxqt_deb-xorg+librga 249,00
es2gears_lxde_deb-xorg 661,64   glxgears_lxqt_deb-xorg 258,36
es2gears_lxde_deb-xorg+librga 789,60   glxgears_lxde_rck-xorg+librga 258,62
es2gears_lxde_rck-xorg+librga 924,32   glxgears_lxde_rck-xorg+librga+last-xorg 270,10
es2gears_lxqt_deb-xorg+librga 1363,24   glxgears_lxde_deb-xorg 327,98
es2gears_lxqt_deb-xorg 1400,94   glxgears_lxde_deb-xorg+librga 350,04

As you can see, for both desktop environments and for both commands, the best configuration is using the Debian/Armbian Xorg package.

MichaIng commented 4 years ago

@rafee74 Many thanks for doing all these tests.

But one reason could be apt install libegl-mesa0. Note that those mesa lib packages are the vendor-independent ones without any GPU acceleration. And installing this package should have purged the RockChip Mali library for Mali-T864 support. To reinstall it:

cd /tmp
wget https://dietpi.com/downloads/binaries/rk3399/libmali.deb
apt install ./libmali.deb
rm libmali.deb
MichaIng commented 4 years ago

Added this symlink to installs on DietPi v6.29: https://github.com/MichaIng/DietPi/commit/1ee20325d3f2400dfdf7ab8448c556e24f15120d

rafee74 commented 4 years ago

Do you remember if you changed anything else between those two tests?

No, all tests where done after installed Mesa library.

I redone the tests after reinstalled libMali library and recreating all simlinks. I've done tests with only last RockChip Xorg package and this is a 10 tests average: LXDE: 1369,4 LXQt: 1373,62

Now FPS are quite the same for both desktops.

BUT All previous tests were done by my normal user easy. With libMail installed when i launch es2gears I have these error:

ERROR: The DDK is not compatible with any of the Mali GPUs on the system.
The DDK was built for 0x860 r2p0 status range [0..15], but none of the GPUs matched:
EGLUT: failed to initialize EGL display

Accessing to desktop with root user the program runs ok.

And, as last information, yesterday I forgot to tell you that when I launch es2gears I don't see any rotating gears even if the FPS where counted anyway. The same was today with libMali library and executing with root. glxgears show me rotating gears.

rafee74 commented 4 years ago

I have another issue: I have no audio out from jack connector. Only HDMI audio and only after installing manually pulseaudio I don't know if this is another known issue, I have searched but I didn't find anything.

MichaIng commented 4 years ago

@rafee74 Hmm, strange about the error. Did you try to add the easy user to video and render groups? Should actually not be required within X session but just to test:

usermod -aG video,render easy

I found a very similar issue: https://forum.armbian.com/topic/5416-gpu-driver/ Other SoC but similar driver sources, error etc.

I am not sure if those gear test tools might invoke DRM and/or KMS as well. There are two other packages available for that: https://github.com/rockchip-linux/rk-rootfs-build/tree/master/packages/arm64/libdrm Also I am not sure if those are in any way different from the ones from Debian repo. Usually the Mali/GPU-specific drivers should be the most important ones, EDIT: Nope these should be working just the same from both sources.

Audio jack should not be related. You selected (prior to installing pulseaudio) the sound card via dietpi-config? Did you try to configure the ALSA mixer?

rafee74 commented 4 years ago

@MichaIng Tried you suggestion to add my user to video and render groups with no success. Now, when I execute es2gears through easy user I have this error EGLUT: failed to initialize EGL display Like the previous error but without first 2 lines

Tried also to install libdrm packages you linked, though you wrote they were the same as of Debian. Again I not see anything on the window, only a dark window.


I know audio jack is no related to video issue. I've selected sound card from dietpi-config during first boot configuration and i selected realtekrt5651co option, detected as hw:2,0 (indeed, I don't remember if it was already automatically selected). However, I just checked and it is already selected.

MichaIng commented 4 years ago

@rafee74 Can you please paste the output of:

ls -Al /dev/mali*
rafee74 commented 4 years ago

@MichaIng

root@DietPi:/var/log# ls -Al /dev/mali*
crw-rw---- 1 root video 10, 52 mar 31 16:02 /dev/mali0
rafee74 commented 4 years ago

@rafee74 Please try:

apt install xserver-xorg-legacy

Tried with no success, same error as before

I try to check the list of upgradable packages an this is the result:

root@DietPi:~# apt list --upgradable -a
Elencazione... Fatto
libdrm2/stable 2.4.97-1 arm64 [aggiornabile da: 2.4.97-1]
libdrm2/now 2.4.97-1 arm64 [installato, aggiornabile a: 2.4.97-1]

But the installed version and the proposed upgrade version are the same. Is this related to library installation by link you posted?