[Experiment] armbian on NanoPi A64


Recommended Posts

1 minute ago, guidol said:

Some time ago the NanoPi A64 was there on SALE


Yes, there will be no mora sales for this board ... 

 

2 minutes ago, guidol said:

Maybe anyone who knows github better than I could help me?


In general it should be a simple task - yes. Its the same as Pine64, only new board config with different name and boot config ... I think that's all. Do a test build, apply some Gitfu and send PR.


https://www.freecodecamp.org/news/how-to-make-your-first-pull-request-on-github-3/

https://docs.armbian.com/Process_Contribute/

Link to post
Share on other sites
Want Armbian t-shirt or a cup?

On 9/16/2019 at 8:48 AM, Igor said:


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.

@Igor could you please give me a idea/clue how to create a PR for a .dts(.dtb) ?
I created a diff - see attachment - (in git format with option -Naur) for the .dts patch/update, but I dont know how to get it into the armbian-build-system to to upload it or doing a "git diff:(
 

I couldnt also find a 
./cache/sources/linux-mainline/linux-5.6.y/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
in my newly cloned build-git-directory to edit it and create a PR out of it :(

 

nanopia64_Naur_diff.patch

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

You could extract the dts from the built linux-source package.

@Werner I got both files here locally - the original from 5.6.2/5.6.5 and the changed one with audio/usb enabled - so I could make the diff, but I dont know how to get it as "push" in the armbian-build-system or which is the right directory that it can be used
as current & dev.

Link to post
Share on other sites
On 4/24/2020 at 11:29 PM, Hannes Worst said:

Great work Guidol! Thanks for all your tireless efforts!

@Hannes Worst Thanks! :)
As you did ask about the audio/USB-Port in the FriendlyARM forum:

I did check that you could use my .dtb from kernel 5.6.2/5.6.5 buster/bullseye also with the focal minimal image with kernel 5.6.5 ;)

It works (as I did think it should do)

So download the focal image 

https://dl.armbian.com/nanopia64/nightly/Armbian_20.05.0-trunk.117_Nanopia64_focal_dev_5.6.5_minimal.img.xz
and replace the .dtb after the first boot via sftp/cp as described below in the "code":
 

 _   _ ____  _      _    __   _  _
| \ | |  _ \(_)    / \  / /_ | || |
|  \| | |_) | |   / _ \| '_ \| || |_
| |\  |  __/| |  / ___ \ (_) |__   _|
|_| \_|_|   |_| /_/   \_\___/   |_|

Welcome to Armbian Focal with Linux 5.6.5-sunxi64

No end-user support: untested automated build

package bsp-kernel[20.05.0-trunk.117] u-boot[20.05.0-trunk.117] dtb   [20.05.0-trunk.117]
firmware          [20.05.0-trunk.117] config[] branch[dev]


Replace .dtb after boot:
( download sun50i-a64-nanopi-a64_guido_562.dtb from the thread: 
https://forum.armbian.com/applications/core/interface/file/attachment.php?id=6318 )
===============================================================================================
root@nanopia64:/home/guido# cp ./sun50i-a64-nanopi-a64_guido_562.dtb /boot/dtb/allwinner/sun50i-a64-nanopi-a64.dtb


because of the "minimal-focal-image":
===============================================================================================
root@nanopia64:~# apt install alsa-utils

Audio active:
===============================================================================================
root@nanopia64:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sun50ia64audio [sun50i-a64-audio], device 0: 1c22c00.dai-sun8i-codec-aif1 sun8i-codec-aif1-0 [1c22c00.dai-sun8i-codec-aif1 sun8i-codec-aif1-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: allwinnerhdmi [allwinner,hdmi], device 0: 1c22800.i2s-i2s-hifi i2s-hifi-0 [1c22800.i2s-i2s-hifi i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

===============================================================================================
Upper USB-Port active:
===============================================================================================
[  199.562825] usb 1-1: new high-speed USB device number 2 using ehci-platform
[  199.632323] usb 1-1: New USB device found, idVendor=058f, idProduct=6387, bcdDevice= 1.00
[  199.632337] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  199.632345] usb 1-1: Product: Mass Storage Device
[  199.632353] usb 1-1: Manufacturer: JetFlash
[  199.632360] usb 1-1: SerialNumber: E52W3ZUB
[  199.643146] usb-storage 1-1:1.0: USB Mass Storage device detected
[  199.643685] scsi host0: usb-storage 1-1:1.0
[  199.726743] usbcore: registered new interface driver uas
[  200.653122] scsi 0:0:0:0: Direct-Access     JetFlash Transcend 8GB    8.07 PQ: 0 ANSI: 2
[  200.655137] sd 0:0:0:0: [sda] 15687680 512-byte logical blocks: (8.03 GB/7.48 GiB)
[  200.655843] sd 0:0:0:0: [sda] Write Protect is off
[  200.655856] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[  200.656600] sd 0:0:0:0: [sda] No Caching mode page found
[  200.660188] sd 0:0:0:0: Attached scsi generic sg0 type 0
[  200.662038] sd 0:0:0:0: [sda] Assuming drive cache: write through
[  200.798721]  sda: sda1 sda2 sda3
[  200.801957] sd 0:0:0:0: [sda] Attached SCSI removable disk
===============================================================================================
===============================================================================================
Lower USB-Port active:
===============================================================================================
[  245.788467] usb 3-1: new high-speed USB device number 2 using ehci-platform
[  245.830410] usb 3-1: New USB device found, idVendor=04e8, idProduct=0110, bcdDevice= 0.50
[  245.830421] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  245.830427] usb 3-1: Product: USB DRIVE
[  245.830432] usb 3-1: Manufacturer:
[  245.830437] usb 3-1: SerialNumber: 61471C0025F5
[  245.831038] usb-storage 3-1:1.0: USB Mass Storage device detected
[  245.831469] scsi host1: usb-storage 3-1:1.0
[  246.862088] scsi 1:0:0:0: Direct-Access              USB DRIVE        1.13 PQ: 0 ANSI: 0 CCS
[  246.862573] sd 1:0:0:0: Attached scsi generic sg1 type 0
[  246.864318] sd 1:0:0:0: [sdb] 506880 512-byte logical blocks: (260 MB/248 MiB)
[  246.865129] sd 1:0:0:0: [sdb] Write Protect is off
[  246.865142] sd 1:0:0:0: [sdb] Mode Sense: 03 00 00 00
[  246.870009] sd 1:0:0:0: [sdb] No Caching mode page found
[  246.875434] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[  246.908570] sd 1:0:0:0: [sdb] Attached SCSI removable disk
===============================================================================================

@Igor here once again the question: how do I get the newer/changed .dts/.dtb in the armbian-build-system?
My .dts/.dtb do work from kernel 5.6.2 up on buster/bullseye and focal
Without the newer .dtb audio and one of the two USB-Ports wouldnt be active :( 
Thanks for informations in advance! :) 

Link to post
Share on other sites
5 minutes ago, guidol said:

how do I get the newer/changed .dts/.dtb in the armbian-build-system?


By making a patch with changes toward upstream DTB. This is a bit more complicated. DTB are constructed from more different files and BLOB is a compilation of them in a binary format - file which you have (sun50i-a64-nanopi-a64_guido_562.dtb). But we need to apply changes only to nanopi-a64.dts ... if you can create a diff of changes between your (search for decompile DTB to DTS) its a step forward. Otherwise I or somebody else will do this once we find some time https://armbian.atlassian.net/browse/AR-228

Link to post
Share on other sites

@Igor  I searched the web for the right command - and found that the option -label should work for a a/ b/ gif-style diff.
I used
 

diff -u --label a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts --label b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts ./sun50i-a64-nanopi-a64_v565_org.dts ./sun50i-a64-nanopi-a64_guido_562.dts > ./xxx-npi-a64-audio-usb-dts.patch

and did get the following "patch"-file:
 

--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
@@ -139,7 +139,7 @@
                simple-audio-card,name = "sun50i-a64-audio";
                simple-audio-card,aux-devs = <0x0e>;
                simple-audio-card,routing = "Left DAC\0DAC Left\0Right DAC\0DAC Right\0ADC Left\0Left ADC\0ADC Right\0Right ADC";
-               status = "disabled";
+               status = "okay";
                phandle = <0x4c>;

                simple-audio-card,dai-link@0 {
@@ -607,8 +607,8 @@
                        phys = <0x2a 0x00>;
                        phy-names = "usb";
                        extcon = <0x2a 0x00>;
-                       dr_mode = "otg";
-                       status = "disabled";
+                       dr_mode = "host";
+                       status = "okay";
                        phandle = <0x63>;
                };

@@ -901,7 +901,7 @@
                        resets = <0x02 0x28>;
                        dma-names = "rx\0tx";
                        dmas = <0x2d 0x04 0x2d 0x04>;
-                       status = "disabled";
+                       status = "okay";
                        phandle = <0x77>;
                };

@@ -915,7 +915,7 @@
                        resets = <0x02 0x24>;
                        dmas = <0x2d 0x0f 0x2d 0x0f>;
                        dma-names = "rx\0tx";
-                       status = "disabled";
+                       status = "okay";
                        phandle = <0x10>;
                };

@@ -926,7 +926,7 @@
                        interrupts = <0x00 0x1c 0x04>;
                        clocks = <0x02 0x38 0x02 0x6b>;
                        clock-names = "bus\0mod";
-                       status = "disabled";
+                       status = "okay";
                        phandle = <0x11>;
                };

@@ -1260,7 +1260,7 @@
                        dmas = <0x2d 0x1b>;
                        resets = <0x02 0x29>;
                        dma-names = "tx";
-                       status = "disabled";
+                       status = "okay";
                        phandle = <0x41>;
                };

@@ -1269,7 +1269,7 @@
                        simple-audio-card,format = "i2s";
                        simple-audio-card,name = "allwinner,hdmi";
                        simple-audio-card,mclk-fs = <0x100>;
-                       status = "disabled";
+                       status = "okay";
                        phandle = <0x8a>;

                        simple-audio-card,codec {
@@ -1313,7 +1313,7 @@
                codec-analog@1f015c0 {
                        compatible = "allwinner,sun50i-a64-codec-analog";
                        reg = <0x1f015c0 0x04>;
-                       status = "disabled";
+                       status = "okay";
                        phandle = <0x0e>;
                };

Is this useable?

xxx-npi-a64-audio-usb-dts.patch

Link to post
Share on other sites
8 minutes ago, Igor said:

Does not cleanly apply. Make a patch with our tool CREATE_PATCHES="yes"

Ahh - yes thats the way to go :)

Here in Turkey its late, so this will be a todo for tomorrow ;)

 

At which "stage" (screen paused) is the right for a .dts?

Kernel isnt it OR?

Link to post
Share on other sites

@Igor : hope this helps for https://armbian.atlassian.net/browse/AR-228
"Enable audio and USB on Nanopi A64"

 

I did found that I had to edit
/guido/build/cache/sources/linux-mainline/orange-pi-5.6/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi

for activating audio & upper USB

With "Create_Patches="yes" in /build/userpatches/config-example.conf
I did change the content at the "pause" for /sources/linux-mainline/orange-pi-5.6/
and teh system did create /build/output/patch/kernel-sunxi64-dev.patch

renamed the file for the Pull-Request ;) to board-nanopi-a64-activate-audio-usb.patch

 

Pull-Request:

https://github.com/armbian/build/pull/1927

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

I did found that I had to edit
/guido/build/cache/sources/linux-mainline/orange-pi-5.6/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi

for activating audio & upper USB


Well, this patch activates audio and (upper) USB on all A64 boards ... which is probably just fine.

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


Well, this patch activates audio and (upper) USB on all A64 boards ... which is probably just fine.

I hope so - that it wouldnt harm a board like the Pine64.
Is there normally a chance to restrict such a patch to a special/single board?

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

Is there normally a chance to restrict such a patch to a special/single board?


Proper way is that this common dtsi file have common definitions but disabled and each board enable function that is actually wired. If you compare Pine64 and Nanopi A64 ... probably there is no change, but elsewhere it might be. I propose to rather adjust the board dts. That is by the book.

If I merge this patch in, some other board might have some issues ...

Link to post
Share on other sites
On 4/7/2020 at 9:27 PM, guidol said:

Next step kernel 5.6.2 and bullseye :)

- analog-audio does work (have to set "AIF1_DA0" in alsamixer to the value 22 and headphone to 79

  to not get a distorted sound )

- HDMI-audio does work but is distorted and HDMI has no controls inside alsamixer :(

for setting up analog audio more easy I will attach a asound state file ;)
 

stored/created with:
alsactl --file ./asound_npi_a64.state store

could be restored with:
alsactl --file ./asound_npi_a64.state restore

 

asound_npi_a64.state

Link to post
Share on other sites

@guidol Awesome work, this Nanopi of mine has been living in a drawer for quite a while, very nice to see it getting some extended life. :)

I did almost as you said, downloaded the Armbian buster image and the linked dts from this thread, then

cp ./sun50i-a64-nanopi-a64_guido_562.dtb /boot/dtb/allwinner/sun50i-a64-nanopi-a64.dtb

Tried the minimal image with fossa first with the right kernel, but couldn't get the desktop environment working very good.

 

On booting I get this

Welcome to Armbian buster with Linux 5.4.33-sunxi64

aplay gives me

m@nanopia64:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: allwinnerhdmi [allwinner,hdmi], device 0: 1c22800.i2s-i2s-hifi i2s-hifi-0 [1c22800.i2s-i2s-hifi i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0

No analog audio as you can see and there are no settings in alsamixer that can enable it either. The upper USB port works fine now though.

 

Using armbian-config -> system -> other to switch kernel gives me this error.

Test install failed. Can't change firmware, Check /tmp/switch_kernel.log

This file contains: linux-image-dev-sunxi64=20.05.0-trunk.117 linux-dtb-dev-sunxi64=20.05.0-trunk.117 linux-u-boot-nanopia64-dev

This matches the behaviors for all the 5.6.2 kernels in armbian-config too.

Seems strange, all other updates and installations are going fine.

 

Noticed there was a minimal image under the downloads section yesterday so maybe I'll just have to try to have a little patience for a desktop build in the coming days.

 

 

Link to post
Share on other sites
2 hours ago, mackemint said:

@guidol Awesome work, this Nanopi of mine has been living in a drawer for quite a while, very nice to see it getting some extended life. :)

 

Noticed there was a minimal image under the downloads section yesterday so maybe I'll just have to try to have a little patience for a desktop build in the coming days.

@mackemint

The minimal image from the last night

https://dl.armbian.com/nanopia64/nightly/Armbian_20.05.0-trunk.120_Nanopia64_focal_dev_5.6.5_minimal.img.xz

has working upper usb and analog/hdmi audio (downloaded and testet it right now).

 

The .dtb before kernel 5.6 did have another structure - so I could be that with kernel 5.4 the 5.6-dtb doesnt activate the analog-audio :(

I havent checked/compiled  a desktop-version, because I normally use the NanoPi A64 headless.

 

For a older kernel like the 5.4 you could try older .dtb's from this thread:
from 30.09.2019: 
sun50i-a64-nanopi-a64_fixed_usb_audio.dtb
https://forum.armbian.com/applications/core/interface/file/attachment.php?id=5250

 

or from the 23.11.2019:

sun50i-a64-nanopi-a64.dtb_7nd
https://forum.armbian.com/applications/core/interface/file/attachment.php?id=5490

 

Did you try to set up a armbian-build-system to compile a actual desktop-image?
I could try to compile a focal image with desktop and check if its running
(what did not run good as you lik with the desktop?)
but I cant upload a image anywhere, because my line has only 0.7MB upload :(

 

And because its a unsupported armbian version it maybe dont supprt kernel switching :(

Link to post
Share on other sites

I did a fresh to Armbian_20.05.0-trunk_Nanopia64_focal_dev_5.6.8_desktop.img
with the armbian-build-system


Looks fine :)

On the desktop I got problems with the mouse freezing, so I changed in armbian-config the governor to 648-1008Mhz and performance - because with mor than 1008Mhz I got problems also headless with the NPi A64 restarting.

With that desktop did come find - but I got there no sound (but now no time because of the evening dinner ;) )
[EDIT] with my alsa savestate above analog audio does work in Firefox-Browser 
with Youtube :)

Mouse-Pointer is flickering like the framerate of the video :( but no Dia-Picture-show :) 

Attached some pictures :)

 

armbian_desktop_NPIA64_568.jpg

NPI_A64_desktop_governor.jpg

NPi_A64_kernel_568.jpg

NPi_A64_playing_Youtube.jpg

Link to post
Share on other sites

so I tested the desktop with kernel 5.6.8-dev and ubuntu focal, but I think at this time (with this kernel and ubuntu focal) it isnt really useable,  because the NPi A64 is getting hot as 60-80 degree celsius. it seems that there is in this version no hardware accelleration.

I dont know maybe it is better in a older version?

 

As text-console "server" the NPi A64 is running fine and cool (idle under 30 degree celsius)

 

For the desktop version I tested all governors, but with conservative/ondemand/powersave the desktop did freeze in a very short time.

Governor schedutil and userspace doesnt freeze, but lagged.

Performance als governor was the only real useable selection, but it was better with 648-1008Mhz than 648-1152Mhz - over 1008Mhz the system does more stutter in a youtube-video than limited to the 1008Mhz.

 

For now I will go back to the Text-Console-Server-Setting ;) where the NPi A64 is running fine :)

Link to post
Share on other sites

Using the Buster image, kernel 5.4.33 for the nanopi-a64 from the downloads section. Installed full desktop. Copied Guidol's dtb and pasted it over the old one. Armbianmonitor shows a temperature of 33 degrees Celsius. Seems very low. Everything functions: usb, ethernet, enz. Only sound is distorted. The system gets stuck when I am trying to use it. Without it it runs smooth.

Link to post
Share on other sites

@guidol Thanks for trying it out for me! Wasn't expecting it to be such a smooth process to build Armbian, but I did ending up trying it out for myself. :)

Made one Armbian_20.05.0-trunk_Nanopia64_buster_dev_5.6.8_desktop, with your alsa savestate the sound was very very distorted. Both as in gain not possible to set without severe clipping (tried setting all the levels in alsamixer to very low but barely any difference) but also it sounded like the sample rate wasn't correct, audio was pitched down. Tried setting it to 44100 in .asoundsrc but that didn't help

This morning I had finished building Armbian_20.05.0-trunk_Nanopia64_bullseye_dev_5.6.8_desktop. Here the desktop env flickers very badly with 0 or more windows open, for more than one the GUI toggles between the open windows in a very epilepsy-inducing manner. -_-

 

Shame that there seems to be so many issues with the desktop env, I was hoping this would be a viable setup for a portable SunVox-machine. I remember it running very smoothly on the desktop builds provided by FriendlyArm, but these I can't even get to boot anymore for some reason. Tried downloading both from the old MediaFire folders and the new MegaUpload hosting place.

 

Maybe I'll give another shot at installing a headless again with the Mate desktop env. Analog audio out or bust for my part :)

Oh, and if I don't reply again in a while it seems that new users can't post too often. Spambot protection is serious over here. :D

Link to post
Share on other sites
52 minutes ago, mackemint said:

Oh, and if I don't reply again in a while it seems that new users can't post too often. Spambot protection is serious over here. :D

Unfortunately the only way to limit the work for the team to keep forums clean. Spam is a hugh problem but nobody notices it (which is good).

Link to post
Share on other sites

@Hannes Worst and @mackemint  are you using the sound only via HDMI or did you also try analog-audio?
For me the sound is distorted only/mostly at HDMI, but there we have no control in the alsamixer :(
The saved alsa-state is only my configuration of analog-audio, which work mostly perfect on my amplified Logitech Speakers.

 

@Hannes Worst which .dtb version did you use for Ubuntu with the kernel 5.4.33?

 

Low temperatures I do only get like @Hannes Worst in the command-shell without using a desktop.

@mackemint Nice to read, that you now seem to have a own armbian-build-system :)
For the distorted analog-sound (not HDMI) did you try to lower AIF1 DA0 to 16-22 and DAC to a max. of 79?
(Headphone is here also at a max. of 79)

 

NPi_A64_analog_audio_FUL.thumb.jpg.1835de99bc8207bf6222f12da7cb72d5.jpg

 

Today I created the Pull-Request https://github.com/armbian/build/pull/1935 for disabling i2s1 - 1c22400
because it isnt needed for analog audio nor sound_hdmi. For sound_hdmi only i2s2 1c22800 is needed.

Link to post
Share on other sites
16 minutes ago, Hannes Worst said:

Guidol, I used your dtb file as suggested in your post on monday 08.45 h. Only hdmi-sound is offered. I have used the Debian-Buster image instead of Ubuntu. I am curious for the further progression you are making om the image, thanks!

this .dtb will only work if you are using kernel >= 5.6.x

 

For older kernels you could try - as did wrote on Thursday:
 

For a older kernel like the 5.4 you could try older .dtb's from this thread:
from 30.09.2019: 
sun50i-a64-nanopi-a64_fixed_usb_audio.dtb
https://forum.armbian.com/applications/core/interface/file/attachment.php?id=5250
 

or from the 23.11.2019:
sun50i-a64-nanopi-a64.dtb_7nd
https://forum.armbian.com/applications/core/interface/file/attachment.php?id=5490

 

Link to post
Share on other sites
On 5/2/2020 at 12:41 PM, Werner said:

Unfortunately the only way to limit the work for the team to keep forums clean. Spam is a hugh problem but nobody notices it (which is good).

I do appreciate that very much!

 

On 5/2/2020 at 2:24 PM, guidol said:

@Hannes Worst and @mackemint  are you using the sound only via HDMI or did you also try analog-audio?

The saved alsa-state is only my configuration of analog-audio, which work mostly perfect on my amplified Logitech Speakers.

I'm only interested in analog audio personally, tried your alsa-state and setting all the DAC output volumes low but the sound wasn't only distorted but probably the sample rate was incorrect which caused the pitch-down effect. Maybe I got the kernels mixed up.

 

I'll give it another try with the minimal image and try to install an X server to be able to run SunVox, from a quick browse around the forum it seems like xorg is the way to go?
Will report back with my results. =)

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...