0
guidol

[Experiment] armbian on NanoPi A64

Recommended Posts

USB-Patch (for the upper port) did also work on the "new" debian Buster / armbian 5.86 :)

NanoPi_A64_Buster.jpg

 

NanoPi_A64_Buster_upper_USB.jpg

Share this post


Link to post
Share on other sites

Yesterday I did try 10 times to install Pihole to the NanoPi A64 (running debian buster), but got serveral unexpected restarts :(

After giving up yesterday and lying in the bed I did think about the cpu-frequencies.....

 

The original /etc/default/cpufrequtils file for debian buster (tweaked from Pine64) is:

ENABLE=true
MIN_SPEED=480000
MAX_SPEED=1200000
GOVERNOR=ondemand

but on the NanoPi A64 the frequency do start at 648000 and I dont know how high it could be stable (on the FriendlyArm Page the NanoPi A64 is advertised for 1152000). I got the NanoPi A64 serveral weeks running with SETI-Client and 960000

 

So I did try to install Pihole with:
 

ENABLE=true
MIN_SPEED=648000
MAX_SPEED=960000
GOVERNOR=conservative

And it succeeded like it could with debian buster:

 

After fixing the lighttpd - Pihole does work now with debian buster on the NanoPi A64 ;)

 

Maybe later I will try a more normal config ;)

 

ENABLE=true
MIN_SPEED=648000
MAX_SPEED=1010000
GOVERNOR=ondemand
 

Share this post


Link to post
Share on other sites

Hi, Is there any link to download this version with the changes to support the A64? 

Also how stable is it and is there any improvements that can be done?

Share this post


Link to post
Share on other sites
21 minutes ago, Rami Khawaly said:

Hi, Is there any link to download this version with the changes to support the A64? 

Also how stable is it and is there any improvements that can be done?

No :( there is no downloadable image, because its unofficial.

You could install the armbian-build-system and change the file of the Pine64 (see first page of this thread) and compile the image by yourself.

 

Another non-armbian-option is to take a look at

https://github.com/avafinger/nanopi-a64-firmware   or

https://github.com/avafinger/nanopi-a64-kodi

Share this post


Link to post
Share on other sites

little change at usb@1c19000 for the .dts/.dtb in the latest compile:

 

change from:

dr_mode = "otg";
status = "disabled";

change to:

status = "okay";
dr_mode = "host";

and you will get a working new version with boot usb-ports also working ;)
 

login as: root
root@192.168.6.116's password:
 _   _ ____  _         _    __   _  _
| \ | |  _ \(_)       / \  / /_ | || |
|  \| | |_) | |_____ / _ \| '_ \| || |_
| |\  |  __/| |_____/ ___ \ (_) |__   _|
|_| \_|_|   |_|    /_/   \_\___/   |_|

Welcome to Debian Buster with Armbian Linux 5.3.0-rc6-sunxi64
package bsp-kernel[5.96] u-boot[5.96] dtb[5.96] firmware[5.96] config[5.96]

System load:   0.03 0.07 0.03   Up time:       4 min
Memory usage:  10 % of 989MB    IP:            192.168.6.116
CPU temp:      39°C
Usage of /:    10% of 15G

[ General system configuration (beta): armbian-config ]

Last login: Fri Sep  6 15:00:08 2019 from 192.168.6.17

root@npi-a64(192.168.6.116):~#

armbianmonitor -u
System diagnosis information will now be uploaded to http://ix.io/1Uqg
 

Share this post


Link to post
Share on other sites

Here the commands for uncompile/editing and compiling the .dtb / .dts - files

(

check filename because of your board-configuration file in the armbian-build-system

maybe 

sun50i-a64-nanopi-a64 or

sun50i-a64-nanopia64

------------------------------------------------------------------------
CONVERT dtb to dts
------------------------------------------------------------------------
dtc -I dtb -O dts /boot/dtb/allwinner/sun50i-a64-nanopi-a64.dtb -o /boot/dtb/allwinner/sun50i-a64-nanopi-a64.dts

------------------------------------------------------------------------
EDIT dts
------------------------------------------------------------------------
nano /boot/dtb/allwinner/sun50i-a64-nanopi-a64.dts

------------------------------------------------------------------------
CONVERT (BACK) dts to dtb
------------------------------------------------------------------------	
dtc -I dts -O dtb /boot/dtb/allwinner/sun50i-a64-nanopi-a64.dts -o /boot/dtb/allwinner/sun50i-a64-nanopi-a64.dtb

 

Share this post


Link to post
Share on other sites

I have two boards of nanopi-a64. after following the instructions here to enable usb and hdmi audio, i've tried also making the audio jack working (at least for audio output).

 

I did the inclusion of a custom board config as stated in post #1 of this thread.

 

Here is my patch file I add to <armbian-build-path>/patch/kernel/sunxi-dev/
I named it xxx-xxx-nanopi-a64-fix-usb-and-audio.patch so that it would be executed last on the patching stage of the build.

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
index 9b9d915..0b671c7 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
@@ -283,3 +283,48 @@
 &usbphy {
 	status = "okay";
 };
+
+&codec {
+    status = "okay";
+};
+
+&codec_analog {
+    cpvdd-supply = <&reg_eldo1>;
+    status = "okay";
+};
+
+&dai {
+    status = "okay";
+};
+
+&i2s1 {
+    status = "okay";
+};
+
+&i2s2 {
+    status = "okay";
+};
+
+&sound {
+  simple-audio-card,aux-devs = <&codec_analog>;
+  simple-audio-card,widgets = "Microphone", "Microphone Jack",
+            "Headphone", "Headphone Jack";
+  simple-audio-card,routing =
+      "Left DAC", "AIF1 Slot 0 Left",
+      "Right DAC", "AIF1 Slot 0 Right",
+      "Headphone Jack", "HP",
+      "AIF1 Slot 0 Left ADC", "Left ADC",
+      "AIF1 Slot 0 Right ADC", "Right ADC",
+      "MIC2", "Microphone Jack";
+  status = "okay";
+};
+
+&sound_hdmi {
+    status = "okay";
+};
+
+&usb_otg {
+    dr_mode = "host";
+    status = "okay";
+};
+

Adding it at the patching stage avoids having to decompile and recompile into dtb and replacing the one at the boot.

So far so good, audio on hdmi and the audio jack works, you just have to set the default sink device on pulse audio's settings if you want to use either audio outputs.

 

Be aware though that is needed to hold the linux-dtb-dev-sunxi and linux-dtb-dev-sunxi64 packages so that the patches above wont be lost when running apt-get upgrade.

 

Share this post


Link to post
Share on other sites
On 9/15/2019 at 1:09 AM, kevinplatt said:

Be aware though that is needed to hold the linux-dtb-dev-sunxi and linux-dtb-dev-sunxi64 packages so that the patches above wont be lost when running apt-get upgrade.


If you get this working, send a PR (to dev and next) and you don't need to worry about ;) In case board works well, we could also add an image ... we have it for some other CSC targets as well.

Share this post


Link to post
Share on other sites
On 9/15/2019 at 2:09 AM, kevinplatt said:

Adding it at the patching stage avoids having to decompile and recompile into dtb and replacing the one at the boot.

So far so good, audio on hdmi and the audio jack works, you just have to set the default sink device on pulse audio's settings if you want to use either audio outputs.

 

Be aware though that is needed to hold the linux-dtb-dev-sunxi and linux-dtb-dev-sunxi64 packages so that the patches above wont be lost when running apt-get upgrade.

 

Today I compiled Kernel 5.3.1 dev image for the NPi A64 - and after that the U-Boot/Kernel-packages with the patch applied to get the 2 different .dtb/dts files for compare and maybe de-/compile dtb2dts and dts2dtb.

Debian Buster with Armbian Linux 5.3.1-sunxi64
package bsp-kernel[5.98] u-boot[5.98] dtb[5.98] firmware[5.98] config[5.98]

 

Audio-Jack is now working for me - didnt test the HDMI(-Audio)

**** List of PLAYBACK Hardware Devices ****
card 0: sun50ia64audio [sun50i-a64-audio], device 0: 1c22c00.dai-sun8i sun8i-0 []
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: allwinnerhdmi [allwinner,hdmi], device 0: 1c22800.i2s-i2s-hifi i2s-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

 

A little "problem" I did found with armbian-config ==> system ==> hardware

When trying to configure there a hardware-part then there is a small loop of

Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.

and then no hardware is displayed :(

 

For information / testing I will attach all 2 .dtb/.dts and a patch-file for the dts for patching (please check filename)

 

npi_a64_fix_usb_audio.patch sun50i-a64-nanopi-a64_fixed_usb_audio.dtb sun50i-a64-nanopi-a64_fixed_usb_audio.dts sun50i-a64-nanopi-a64_original.dtb sun50i-a64-nanopi-a64_original.dts

Share this post


Link to post
Share on other sites
On 1/28/2019 at 12:53 AM, @lex said:

My last update on this issue in case someone is working to get sound on A64 (>= 4.20).

I tried every patch out there,  triple checked the code , same situation, no sound. 

I must have missed something or overlooked something.

@@lex for sound under kernel 5.3.1 check the message before this one for the .dtb/.dts files 

with these files the analog audio is working (and maybe HDMI-Sound) ;)

Share this post


Link to post
Share on other sites

@guidol

Thanks for the tip.

In fact i have sun50ia64audio available but no sound output on jack. Hdmi-sound always worked.

My kernel is now based on mainline kernel with ir and cedrus patch, i tried to catch up with @jernej's and @kwiboo's patches and learn a few things but these guys are too fast... :):lol: and it is time to slowdown...

Great to see how your work and Armbian progresses, i think you will soon tag it as supported.

This is/was a great board. I am just waiting for that board with the promising Grub open source (like).

 

 

Share this post


Link to post
Share on other sites
1 hour ago, @lex said:

@guidol

Thanks for the tip.

Great to see how your work and Armbian progresses, i think you will soon tag it as supported.

This is/was a great board. I am just waiting for that board with the promising Grub open source (like).

I enjoy to share such informations to all NanoPi A64 Users ;)
And here at armbian not only "my work" - its the work of all armbian-users here which share informations about the NanoPi A64.
I try to collect and connect these informations for getting the NanoPi A64 a better (supported) board :)

 

PS: Sadly the green LED isnt controllable, because its only connected to VCC/GND

Share this post


Link to post
Share on other sites

I'll try incorporating the patches into the dev and the next branch of the build to test on my two nanopi-a64.

I will be rebuilding the images to test it again on my spare time.

Also if successful i might make a PR request so that we can have a supported image.

BTW, my use case for this is just having a 7 inch touch screen attached to the nanopi-a64 and it kinda serves as my dashboard for tasks assigned to me and reminders for system administration in the office.
Also, having spotifyd on the nanopi and have it play spotify to my bluetooth earphones or switching to wired earphones when they die while i am in the office. 


 

 

Share this post


Link to post
Share on other sites

@kevinplatt would it be enough to freeze the dtb-package (for not get rid of the usb & audio fix)

because armbian-config does set much more packages on hold like root, kernel, config, firmware and u-boot?

root@npi-a64(192.168.6.116):/home/guido# apt-mark showhold
armbian-firmware
linux-buster-root-dev-nanopia64
linux-dtb-dev-sunxi64
linux-image-dev-sunxi64
linux-u-boot-nanopia64-dev

 

Today i compiled a image with kernel 5.3.7 and did by mistake/accident a apt update & apt upgrade,

so the USB & audio fix was missing with the newer dtb[5.98.191022]
 

Debian Buster with Armbian Linux 5.3.7-sunxi64
package bsp-kernel[5.98.191022] u-boot[5.98] dtb[5.98.191022] firmware[5.98] config[5.98]

I copied the saved/fixed .dtb in /boot/dtb/allwinner and the fix does work again after reboot ;)

 

I f I only freeze the dtb - can I also have/use the other packages in the newer version?

root@npi-a64(192.168.6.116):/home/guido# apt-mark hold linux-dtb-dev-sunxi64
linux-dtb-dev-sunxi64 set on hold.

root@npi-a64(192.168.6.116):/home/guido# apt-mark showhold
linux-dtb-dev-sunxi64

Or which package (additional to the dtb) could break the fix?

Share this post


Link to post
Share on other sites
On 11/3/2019 at 9:33 AM, Aslak Brekke said:

Hi, is it an Armbian image available yet?

No - because its an UNOFFICIAL experiment of mine as you can see in the headline of this thread..
So, if you do build up a armbian-build-system ( https://docs.armbian.com/Developer-Guide_Build-Preparation/ )

and do create some files/changes (as written in this 2 pages thread here) then
you could compile a armbian-image for the NanoPi A64 which also include the usb/analog-sound patch ;)

Latest version I do run actually:


Debian Buster with Armbian Linux 5.3.8-sunxi64
package bsp-kernel[5.99.191102] u-boot[5.99] dtb[5.99] firmware[5.99] config[5.99] branch[dev]
 

dtb[5.99] compiled with armbian-build-system with installed patch for usb/audio

 

armbianmonitor -u
System diagnosis information will now be uploaded to http://ix.io/20MH

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
0