Kategoriarkiv: Raspberry Pi

Tips and tricks and information regarding Raspberry Pi 4 and newer.

Make the best performance on Raspberry pi 4 with XPI and Manjaro

Categori : Raspberry Pi

 

Experience with XPI and how-to make it faster and smoother in your setup.

First, I will tell I have used this configuration for over a year now, and I have almost only worked with Pi 4 as my main computer for desktop computing with email, surfing, Tinkercad design for 3d printing. Prusa slicer for 3d printing and Free Pascal/Lazarus for programming.

Issues?

I have no complaints about the system’s performance. The system works more reliability than my Mac or my Windows 10 computer. I explain in detail what I mean by these :

I feel the PI is sold as a playground for kids, seriously? Okay, that’s great, but the performance is much greater than an I/O board to get some LED’s blinking. I think the Pi computer is hardly underestimated and must be taken more seriously as an everyday computer for almost any regulars pc-users. For an LED game I recommend Arduino UNO 3, this is a lovely small computer for an electronics workshop.

Perhaps the leaks of a stable OS’s in the past (I will not go deeper here), are the reasons, but not more. Now we have Manjaro – that preform just great on the Raspberry Pi 4, and have the stability that’s are extremely high.

So I hope you join? Try it, I am almost sure you will be surprised over the stability of the OS vs Windows/macOS.

The system I use is with the power management board XPI – but you can run the system without it. Without the XPI board, you do not need the dtoverlay=gpio lines under.

Changes to the config.txt file:

gpu_mem=256
dtoverlay=vc4-fkms-v3d
arm_freq=2000
over_voltage=6
dtoverlay=gpio-shutdown,gpio_pin=21,active_low=0,gpio_pull=off
dtoverlay=gpio-poweroff,gpio_pin=20
dtoverlay=dwc2,dr_mode=host

More info : The first dtoverlay line is used by the XPI power management board to talk to the Manjaro/Raspberry Pi to start the shutdown process (no need for any script!). The second line tells the XPI board when the Raspberry Pi is idle and complete shutdown and it’s safe to turn off the power. The third line tells the Raspberry Pi to use the onboard power-USB-C port as a USB Host for other devices – booth USB 3 and USB 2 devices can be connected to the power-USB-C port on the Raspberry Pi 4. If so, you must provide power to the 5V-pins on the GPIO header on the Raspberry Pi. This works, and gives you the fifth USB port on Raspberry Pi!

Changes to the Chromium browser (chrome://flags):

Override software rendering list = Enabled
Smooth Scrolling = Enabled
GPU rasterization = Enabled
Hardware-accelerated video decode = Enabled
Zero-copy rasterizer = Enabled
Vulkan = Enabled

This WILL play full-screen video (if you have a good Internet line) in real HD, 1920×1080 pixel in your Chromiun browser! Give it a second or 2 to stabilize. It takes about 50-70 % CPU trust, so it’s no real hardware optimization here, that’s bad. Hope things get better someday. Sadly, for the moment, H264 video plays better on the old Pi 3b+…

Digging deeper

Are there no issues at all? Oh, Yes, but it has been issues that are my fault. Bad cable and connectors, bad USB to SATA cables. Low power issues. I “feed” my Pi now with 5 volts and 5 amp power supply on booth GPIO 5v-pins and the USB-C connector and believe this works ok.

I have tried all the firmware versions in over a year now. The current version is dated sometime in march 2021 now, and that works great. It was some issues when the Pi did not start/boot that has now been fixed in the March 2021 release of the firmware for the Pi 4.

Current Power problem and the Raspberry Pi 4

There are issues with the power lines on Raspberry Pi 4. This does not compute! 3 Amp max in via the USB-C connector and what is left to the 4 x USB ports? – after the main board takes what it’s needed (about 0.8 to 1.8 amp)? Remember most USB devices now only uses power from the USB line and do not come with an external power supply. Also, the Raspberry Pi 4 has “fuses” that look down the USB port, if current overload goes over about 1.2 amp per port, and also close down” the USB port if voltage goes under 4.6 volt or over 5.6 volts. This summarizes that you must provide more sources (from the same power sources) with power if you have power-hungry USB devices. Many times it’s bad because the SATA-disk reboot and the system kick’s out the USB SATA drive. The system crash! The solution is more power to everything in your configuration.

This is the only “design” error I find on Raspberry Pi 4 : It should have a separate power in connector, and not use the USB-C or Micro-USB on RPI3 to do the job. I am sure this is the main reason for the Raspberry Pi to halt in most cases.

Widevine?

I read last month Widevine for Raspberry Pi is official? Hmmm, Official? Official only for the 32-bit Raspbian Os?. Not sure what people mean, but it works great on Raspberry pi 32-bit Os whit a package name widevinecmd0 or something. So, let’s hope we will see Widevine in the daylight with a 64-bit package soon? There are some docker packages out there, you can install to get an older chromium 32-bit with Widevine to run on Manjaro, but I feel this isn’t the right way to do things. But it works while we hopefully wait for a 64-bit Widevine for Raspberry Pi.

If you do not know what Widevine is, then it is to use Spotify, Netflix, Disney plus, Amazon Prime, etc in your browser (aka play in Chromium browser).

Software to install

There is no special software to install to get this setup working. The Manjaro Pacman/Pamac installer is just a great way to add/remove software on your system. You got the latest version right in the box.

Disk and drives

I boot from SSD! I never use SD cards more. In the beginning, I tried this, but when I crapped up some big sd card and lose all my installs, I changed to only SSD drive via a USB-to-SATA cable – easy, and very stable system and a great file transfer speed. I have tried 2-3 different UASP adapters, but I have not got this to work, don’t know the way.

I will update this document if a find other useful things that will increase the performance in the system for you.

Regards
Morten Steenberg

Install a good Spotify player on Raspberry Pi 4 with Manjaro

Categori : Raspberry Pi

Yes, there is a Spotify player who works on Manjaro 20.06 and with Raspberry Pi 4!

You find it in the software manager with the name ncspot. The version I installed (Aug 2020) is 0.2.0-1. This is in the AUR file system, so you have to have enabled this before your search.

Install it from scratch and rebuild it. It’s written in Rust – it takes time, but it’s worth it.

After du have installed it, there is no creepy .conf file to edit. Just type in your username and password and find a song and hit play straight away.

– Then it plays on your Raspberry Pi 4 without any problems.

It’s extremely fast relative to the original Spotify app. Some tricky keyboard shortcuts, but it plays all your playlists and everything you find on Spotify right away on your Raspberry Pi 4 with Manjaro 20.06.

Remember the ncspot has no GUI, only a text screen in the console. But it presents music – you did not look at the music, you hear. Works great for me. And it update Manjaro’s internal player with cover etc.


Written by Morten Steenberg
August 2020

Permalink to this article: http://minibase.no/?p=1610

How to Install new apps that are not supported by Arm architecture on Manjaro 20.06 on Pi 4

Categori : Raspberry Pi

Yes, you find new program in the AUR archive, and try to install and got an error that the architecture is not supported. You give up? Don’t!!

Most of these programs can be recompiled to work with the arm architectures with only change one line! Not all but mostly.

You see most off the program in the AUR achieve is mostly supported by x86 or int386, and not arm. But since most Linux apps have source code, you can just recompile the package/program from scratch. That’s all, easy. Try it before you give up!

You have to enable AUR packages in settings in the software manager first – If you not already have done that.

This is a sample to rebuild Balena Etcher for you!

  1. Search for “balena” in the software manager in Manjaro on your Pi 4.
  2. Select balena-etcher (for the moment v. 2:1.5.102-1 in July 2020).
  3. After you have started the build of this package/program you got an error who tells you that this package/program is not build for ‘aarch64’ architectures. Don’t give up. You only need rebuild the package. Continue reading under.
  4. Select go/do again. Then you got a window up who tells you to quit or change construction/build files (rightmost icon). Click this icon.
  5. Then you got an editor up, first with the textfile PKGBUILD (forgot the others). Lock here? See something strange? Look for the line arch=(x86_64).
  6. Here is the fix. Change the text x86_64 to aarch64. Then save.
  7. Next (after save) start to build again.
  8. Now the complete package will be rebuild to hopefully support aarch64 structure, and not any x86 structure.
  9. This can take awhile.
  10. Sit down and take a coffee – you got a new fresh build of Balena Etcher, who works on Manjaro on your Raspberry Pi 4.

Written by Morten Steenberg
July 2020

Permalink to this article: http://minibase.no/?p=1602

How to install Lazarus 2.0.10 & FPC 3.2.0 on Manjaro 20.06 with Raspberry Pi 4

Categori : Raspberry Pi

Yes, the new version of Manjaro 20.06 with Raspberry Pi 4 works great together, and the performance is just amazing with a small Raspberry Pi 4.
Here is a little guideline to install Lazarus on your Pi 4.

But I can’t find any install on this Aarch system for Lazarus 2.0.10. Only older outdated versions. So : I had to do it the manual way. Hard? not! – It only looks nasty with all the shell scripts to run – Don’t be afraid, go on! It’s not too hard.

Here we go

  1. Install FPC: Download the file fpc-3.2-0.aarch64-linux.tar from (you find the file other places to) the site under:
    – Download the file from http://freepascal.org/down/aarch64/linux-canada.var – This is binary files, and it will install quickly.
  2. Unpack the file to a temporary folder first, somewhere. You will have the option later to select the destination folder, so don’t worry.
  3. Open the console and cd to the folder where you extract the files. Find the file install.sh and run it with ./install.sh
    – Select the default folder. Like /home/yourusername/fpc-3.2.0 (Hit Enter)
    – Select Yes to install the documentation (Hit y and Enter)
    – Select install demos (Hit y and Enter)
    – Also, hit Enter again to install demos in the default folder (Hit Enter)
    – Also, Hit Y to insert the right version in fpc.cfg file (Hit Y and Enter)
  4. Install FPC source. This you can do via the Software manager here in Manjaro, just search for fpc-src and you find the file and install it.
  5. Install Make. You find it under the software manager, install the file/program Make.
  6. Install gtk2 (GUI toolkit, needed when compiling Lazarus). You find this in the software manager. Version i use is 2.24.32-2.
  7. Install Lazarus. Download this file via http://sourceforge.net/projects/lazarus/files/ and select/click on Lazarus Zip_GZip (this is the source) Then select Lazarus 2.0.10 and then download lazarus-2.0.10-2.zip (newest July 2020!).
    – Unzip this Zip file to a place you want in your home folder hierarchy. Perhaps try (from home) Lazarus? Remember after you have compiled the Lazarus, this will also be the home folder for Lazarus. So think twice when you unzip the Lazarus source.
  8. Next is to set the path so you can compile the source code of Lazarus, if you use “fpc-3.2.0” as folder name from your home folder, you enter this in the console :
    export PATH=”$PATH:/home/yourusername/fpc-3.2.0/bin”
    – Note: Don’t copy/paste the line over direct, use your keyboard to get the right
    – Remember to change yourusername to you right username (name before @ i console).
  9. You can now use fpc compiler in your home folder or anywhere, try to enter fpc in the console, and then press Ctrl+C to exit. If you start the fpc compiler, you are ready for step 10 here, else something is wrong! try check over again…
  10. Now go to the folder where you unzipped the Lazarus and enter this in the console:
    make clean bigide
    – This shod start the compiling of Lazarus, and take about 10-20 minutes…
  11. Double-tap (in the Lazarus folder) in Dolphin file-browser, the file startlazarus – not the startlazarus.app. Then the window “Configure Lazarus IDE” opens with an error it can’t find the fpc binaries. Click browse and go to your fpc folder, then the bin folder, then select the fpc file.
    – Important you select THE file fpc, and not the complete folder!
    – This will return to the window with no errors.
    – Click button “Start IDE”
  12. Create a small project with a button etc, and then try to compile/build (hit F9). You probably get some errors:
    – Not found FPCRES – Add this line under the last -FD line in the hidden file in your home folder, with the name “fpc.cfg” and edit this with Kate. Add a new the line under the -FD line:
    -FD/home/yourusername/fpc-$fpcversion/bin
    – If you got an error that the compiler not found crtbegin and crtend files are missing. Add a new line after et last -Fl line with:
    -Fl/usr/lib/gcc/aarch64-unknown-linux-gnu/9.3.0
    – Then add a package in the software manager with the name gcc and gcc-libs – if it not already is installed. This gives you the crtbegin.o and crtend.o file.
  13. At last, I prefer a docking system in the Lazarus Ide, activate the already light preinstalled packages with (Lazarus Ide→Package→Install/uninstall packages) :
    AnchorDocking 1.0 or Sparta_DockedFormEdtiro 0.0
    AnchorDockingDsgn 1.0
    … And you can uninstall an older package how is only create trouble later for you, that is the package: Chmhelppkg… (Old help file system on Windows?). You don’t need it and it also has a bug when you try to recompile Lazarus with this package included!
  14. You are done. Happy programming with fpc/lazarus.

Freepascal.org updated for arm - aarch Lazarus

As of 15 August 2020, there is also a new guideline on freepascal.org. Very similar to my original guide over, from July. Check this out : https://wiki.freepascal.org/Install_on_aarch64_Arch_or_Manjaro

BONUS TIPS
Wish to support QT5 Widgets controls in your apps in Pi/Lazarus/Manjaro?
– No problem!


Super easy to «add» support for QT5 style in your apps. This also follows the default theme.

  • Install in software manager in Manjaro the file qt5pas.
  • In your program you create/In Lazarus : In menu Project→Project Options→Scroll down to “Additions and Overrides”.
  • Click on the button “Set LCLWidgetType”, select “Value gt5
  • Press OK button.
  • You’re done. God Luck.

Written by Morten Steenberg
July 2020

Permalink to this article: http://minibase.no/?p=1530